sf.utils.random_symplectic

random_symplectic(N, passive=False, block_diag=False, scale=1.0)[source]

Random symplectic matrix representing a Gaussian transformation.

The squeezing parameters \(r\) for active transformations are randomly sampled from the standard normal distribution, while passive transformations are randomly sampled from the Haar measure. Note that for the Symplectic group there is no notion of Haar measure since this is group is not compact.

Parameters
  • N (int) – number of modes

  • passive (bool) – If True, returns a passive Gaussian transformation (i.e., one that preserves photon number). If False (default), returns an active transformation.

  • block_diag (bool) – If True, uses passive Gaussian transformations that are orthogonal instead of unitary. This implies that the positions \(q\) do not mix with the momenta \(p\) and thus the symplectic operator is block diagonal

  • scale (float) – Sets the scale of the random values used as squeezing parameters. They will range from 0 to \(\sqrt{2}\texttt{scale}\)

Returns

random \(2N\times 2N\) symplectic matrix

Return type

array