mm.physics.fock.norm

mrmustard.physics.fock.norm(state, is_dm)[source]

Returns the norm of a ket or the trace of the density matrix. Note that the “norm” is intended as the float number that is used to normalize the state, and depends on the representation. Hence different numbers for different representations of the same state (\(|amp|\) for ket and \(|amp|^2\) for dm).