Superposition of coherent states input Boson Sampler


I was wondering if I can prepare a superposition of coherent (or squeezed) state, i.e. cat state, along with single photon Fock state to be applied to a passive interferometer. Thanks in advance :slight_smile:

Hi @ekccagin!

Assuming your desired initial state is |\psi\rangle = |\mathrm{cat}(\alpha)\rangle \otimes |1\rangle, you can prepare it with the sf.ops.Catstate and sf.ops.Fock operations and then apply your interferometer in the following way

import strawberryfields as sf
from strawberryfields.ops import *

prog = sf.Program(2)

alpha = 1+0.5j
a = np.abs(alpha)
phi = np.angle(alpha)

U = ... # unitary of your interferometer here

with prog.context as q:
    # prepare initial states
    Catstate(a, phi) | q[0]
    Fock(1) | q[1]

    # apply interferometer
    Interferometer(U) | q

eng = sf.Engine('fock', backend_options={'cutoff_dim': 15})
result =, shots=1)
1 Like