mm.lab.abstract.FockMeasurement

class mrmustard.lab.abstract.FockMeasurement(outcome, modes, cutoffs)[source]

Bases: Measurement

A Fock measurement projecting onto a Fock measurement pattern.

It works by representing the state in the Fock basis and then applying a stochastic channel matrix P(meas|n) to the Fock probabilities (belief propagation).

It outputs the measurement probabilities and the remaining post-measurement state (if any) in the Fock basis.

modes

returns the modes being measured

num_modes

returns the number of modes being measured

outcome

Returns outcome of the measurement.

parameter_set

The set of parameters for this transformation.

postselected

returns whether the measurement is postselected, i.e, a outcome has been provided

modes

returns the modes being measured

num_modes

returns the number of modes being measured

outcome
parameter_set

The set of parameters for this transformation.

postselected

returns whether the measurement is postselected, i.e, a outcome has been provided

primal(other)

performs the measurement procedure according to the representation of the incoming state

recompute_stochastic_channel(cutoffs)

Recomputes the stochastic channel.

should_recompute_stochastic_channel()

Returns True if the stochastic channel has to be recomputed.

primal(other)

performs the measurement procedure according to the representation of the incoming state

Return type:

Union[State, float]

recompute_stochastic_channel(cutoffs)[source]

Recomputes the stochastic channel.

This method should be overriden by subclasses as needed.

Return type:

None

should_recompute_stochastic_channel()[source]

Returns True if the stochastic channel has to be recomputed.

This method should be overriden by subclasses as needed.

Return type:

bool