symop.polynomial.channels.unitaries.swap

Mode-swap unitary.

Utility for constructing the 2x2 permutation unitary that exchanges two optical modes.

Functions

swap_u(*[, check_unitary, atol])

Return the 2x2 SWAP unitary.

swap_u(*, check_unitary: bool = False, atol: float = 1e-10) ndarray

Return the 2x2 SWAP unitary.

\[\begin{split}U = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.\end{split}\]
Parameters:
  • check_unitary (bool) – If True, validate unitarity.

  • atol (float) – Tolerance for optional unitary check.

Returns:

Complex matrix of shape (2, 2).

Return type:

ndarray