mm.physics.fock.apply_kraus_to_dm¶
- mrmustard.physics.fock.apply_kraus_to_dm(kraus, dm, kraus_in_modes, kraus_out_modes=None)[source]¶
Applies a kraus operator to a density matrix. It assumes that the density matrix is indexed as left_1, …, left_n, right_1, …, right_n.
The kraus operator has indices that contract with the density matrix (kraus_in_modes) and indices that are leftover (kraus_out_modes). kraus will contract from the left and from the right with the density matrix. For right contraction the kraus op is conjugated.
- Parameters:
kraus (array) – the operator to be applied
dm (array) – the density matrix to which the operator is applied
kraus_in_modes (list of ints) – the indices (counting from 0) of the kraus operator that contract with the density matrix
kraus_out_modes (list of ints) – the indices (counting from 0) of the kraus operator that are leftover (default None, in which case kraus_out_modes = kraus_in_modes)
- Returns:
the resulting density matrix
- Return type:
array