mm.physics.fock.U_to_choi¶
- mrmustard.physics.fock.U_to_choi(U, Udual=None)[source]¶
Converts a unitary transformation to a Choi tensor.
- Parameters:
U (
ndarray
[Tuple
[int
,...
],Union
[TypeVar
(R
,float16
,float32
,float64
),TypeVar
(C
,complex64
,complex128
),TypeVar
(Z
,int16
,int32
,int64
),TypeVar
(N
,uint16
,uint32
,uint64
)]]) – the unitary transformationUdual (
Optional
[ndarray
[Tuple
[int
,...
],Union
[TypeVar
(R
,float16
,float32
,float64
),TypeVar
(C
,complex64
,complex128
),TypeVar
(Z
,int16
,int32
,int64
),TypeVar
(N
,uint16
,uint32
,uint64
)]]]) – the dual unitary transformation (optional, will use conj U if not provided)
- Returns:
the Choi tensor. The index order is going to be \([\mathrm{out}_l, \mathrm{in}_l, \mathrm{out}_r, \mathrm{in}_r]\) where \(\mathrm{in}_l\) and \(\mathrm{in}_r\) are to be contracted with the left and right indices of the density matrix.
- Return type:
Tensor