mm.physics.fock.apply_choi_to_dm

mrmustard.physics.fock.apply_choi_to_dm(choi, dm, choi_in_modes, choi_out_modes=None)[source]

Applies a choi operator to a density matrix. It assumes that the density matrix is indexed as left_1, …, left_n, right_1, …, right_n.

The choi operator has indices that contract with the density matrix (choi_in_modes) and indices that are left over (choi_out_modes). choi will contract choi_in_modes from the left and from the right with the density matrix.

Parameters:
  • choi (array) – the choi operator to be applied

  • dm (array) – the density matrix to which the choi operator is applied

  • choi_in_modes (list of ints) – the input modes of the choi operator that contract with the density matrix

  • choi_out_modes (list of ints) – the output modes of the choi operator

Returns:

the resulting density matrix

Return type:

array