Bargmann Utilities

XY_of_channel

Outputting the X and Y matrices corresponding to a channel determined by the "A" matrix.

au2Symplectic

Helper for finding the Au of a unitary from its symplectic rep.

bargmann_Abc_to_phasespace_cov_means

Function to derive the covariance matrix and mean vector of a Gaussian state from its Wigner characteristic function in ABC form.

cayley

Returns the Cayley transform of a matrix: \(cay(X) = (X - cI)(X + cI)^{-1}\).

symplectic2Au

The inverse of au2Symplectic i.e., returns symplectic, given Au.

wigner_to_bargmann_psi

Converts the wigner representation in terms of covariance matrix and mean vector into the Bargmann A,B,C triple for a Hilbert vector (i.e. for M modes, A has shape M x M and B has shape M).

wigner_to_bargmann_rho

Converts the wigner representation in terms of covariance matrix and mean vector into the Bargmann A,B,C triple for a density matrix (i.e. for M modes, A has shape 2M x 2M and B has shape 2M).

XY_of_channel

mrmustard.physics.bargmann_utils.XY_of_channel(A)[source]

Outputting the X and Y matrices corresponding to a channel determined by the “A” matrix.

Parameters:

A (ComplexMatrix) – the A matrix of the channel

au2Symplectic

mrmustard.physics.bargmann_utils.au2Symplectic(A)[source]

Helper for finding the Au of a unitary from its symplectic rep. Au : in bra-ket order.

bargmann_Abc_to_phasespace_cov_means

mrmustard.physics.bargmann_utils.bargmann_Abc_to_phasespace_cov_means(A, b, c)[source]

Function to derive the covariance matrix and mean vector of a Gaussian state from its Wigner characteristic function in ABC form.

The covariance matrix and mean vector can be used to write the characteristic function of a Gaussian state

Math:

Chi_G(r) = expleft( -frac{1}{2}r^T Omega^T cov Omega r + i r^TOmega^T mean right),

Parameters:
Return type:

tuple[Matrix, Vector, Scalar]

and the Wigner function of a Gaussian state:

Math:

W_G(r) = frac{1}{sqrt{Det(cov)}} expleft( -frac{1}{2}(r - mean)^T cov^{-1} (r-mean) right).

Parameters:
Return type:

tuple[Matrix, Vector, Scalar]

The internal expression of our Gaussian state \(\rho\) is in Bargmann representation, one can write the characteristic function of a Gaussian state in Bargmann representation as

Math:

Chi_G(alpha) = Tr(rho D) = c expleft( -frac{1}{2}alpha^T A alpha + alpha^T b right).

Parameters:
Return type:

tuple[Matrix, Vector, Scalar]

This function is to go from the Abc triple in characteristic phase space into the covariance and mean vector for Gaussian state.

Parameters:
  • A (Matrix) – The A matrix of the state in characteristic phase space.

  • b (Vector) – The b vector of the state in characteristic phase space.

  • c (Scalar) – The c scalar of the state in characteristic phase space.

Returns:

The covariance matrix, mean vector and coefficient of the state in characteristic phase space.

Return type:

tuple[Matrix, Vector, Scalar]

cayley

mrmustard.physics.bargmann_utils.cayley(X, c)[source]

Returns the Cayley transform of a matrix: \(cay(X) = (X - cI)(X + cI)^{-1}\).

Parameters:
  • c (float) – the parameter of the Cayley transform

  • X (Tensor) – a matrix

Returns:

the Cayley transform of X

Return type:

Tensor

symplectic2Au

mrmustard.physics.bargmann_utils.symplectic2Au(S)[source]

The inverse of au2Symplectic i.e., returns symplectic, given Au.

S: symplectic in XXPP order

wigner_to_bargmann_psi

mrmustard.physics.bargmann_utils.wigner_to_bargmann_psi(cov, means)[source]

Converts the wigner representation in terms of covariance matrix and mean vector into the Bargmann A,B,C triple for a Hilbert vector (i.e. for M modes, A has shape M x M and B has shape M).

wigner_to_bargmann_rho

mrmustard.physics.bargmann_utils.wigner_to_bargmann_rho(cov, means)[source]

Converts the wigner representation in terms of covariance matrix and mean vector into the Bargmann A,B,C triple for a density matrix (i.e. for M modes, A has shape 2M x 2M and B has shape 2M). The order of the rows/columns of A and B corresponds to a density matrix with the usual ordering of the indices.

Note that here A and B are defined with respect to the literature.