Running a program with multiple shots in a local engine

Currently, the local backends (FockBackend, GaussianBackend, TFBackend, BosonicBackend) do not support running a program with multiple shots.

Is there any way to run programs with multiple shots locally?

Hey @Omar_Ibna_Nazim! If I understand correctly, you want to be able to do something like eng.run(prog, shots=[1, 10, 100, 1000]), for example. Unfortunately this isn’t supported in Strawberryfields

No, I just want to run eng.run(prog,shots=20). But I obtain the NotImplemented error.

prog = sf.Program(1)
engfock = sf.Engine("fock", backend_options={"cutoff_dim": 6})
with prog.context as q:

    Fock(0) | q[0]
    #Coherent(0,0) | q[0]
with prog.context as q:

    phi = 3.14 / 2
    Rgate(phi) | q[0]
with prog.context as q:
    MeasureFock() | q
results = engfock.run(prog,shots=20)
NotImplementedError: The operation MeasureFock has not been implemented in FockBackend for the arguments {'shots': 20}.

Oh! I see. This is also not supported for the Fock backend. In the docs for measure_fock, it says that when shots > 1, the system state should not be updated to the conditional state of that measurement. This would be the ideal behaviour that we have in mind, but this feature isn’t implemented.