mm.physics.gaussian.general_dyne¶
- mrmustard.physics.gaussian.general_dyne(cov, means, proj_cov, proj_means=None, modes=None)[source]¶
Returns the results of a general-dyne measurement. If
proj_means
are not provided (asNone
), they are sampled from the probability distribution.- Parameters:
cov (Matrix) – covariance matrix of the state being measured [units of 2hbar]
means (Vector) – means vector of the state being measured [units of sqrt(hbar)]
proj_cov (Matrix) – covariance matrix of the state being projected onto [units of 2hbar]
proj_means (Optional Vector) – means vector of the state being projected onto (i.e. the measurement outcome) [units of sqrt(hbar)]. If not provided, the means vector is sampled from the generaldyne probability distribution.
modes (Optional Sequence[int]) – modes being measured (modes are indexed from 0 to num_modes-1), if modes are not provided then the first modes (according to the size of
cov
) are measured.
- Returns:
outcome (sampled means vector of the measured subsystem) [units of sqrt(hbar)], oucome probability [units of hbar**N], post-measurement covariace [units of 2hbar] post-measurement means vector [units of sqrt{hbar}].
- Return type:
Tuple[Scalar, Scalar, Matrix, Vector]