X measurement of non-gaussian states

Is there any way to obtain the position distribution of non-gaussian states such as 1st excited state (|n=1>)?

Hey @Omar_Ibna_Nazim! I think this is what you need but let me know otherwise!

import strawberryfields as sf
from strawberryfields.ops import *

prog = sf.Program(1)
with prog.context as q:
    Fock(1)
    MeasureX | q[0]

eng = sf.Engine('fock', backend_options={"cutoff_dim": 4})
results = eng.run(prog)

Things to check out:

1 Like