mm.physics.fock.apply_choi_to_ket¶
- mrmustard.physics.fock.apply_choi_to_ket(choi, ket, choi_in_modes, choi_out_modes=None)[source]¶
Applies a choi operator to a ket. It assumes that the ket is indexed as left_1, …, left_n.
The choi operator has indices that contract with the ket (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 ket.
- Parameters:
choi (array) – the choi operator to be applied
ket (array) – the ket to which the choi operator is applied
choi_in_modes (list of ints) – the indices of the choi operator that contract with the ket
choi_out_modes (list of ints) – the indices of the choi operator that re leftover
- Returns:
the resulting ket
- Return type:
array
code/api/mrmustard.physics.fock.apply_choi_to_ket
Download Python script
Download Notebook
View on GitHub