symop.modes.labels.polarization

Polarization labels.

This module defines PolarizationLabel, a normalized Jones-vector label used to compute mode overlaps and build stable signatures.

Classes

Polarization(jones)

Polarization label represented by a normalized Jones vector.

class Polarization(jones: tuple[complex, complex]) None

Bases: object

Polarization label represented by a normalized Jones vector.

The Jones vector is stored as a 2-component complex vector:

\[\begin{split}\mathbf{v} = \begin{pmatrix} a \\ b \end{pmatrix},\end{split}\]

normalized such that \(\|\mathbf{v}\|_2 = 1\).

Canonicalization

Jones vectors have a physically irrelevant global phase. This class canonicalizes the input vector by removing an overall phase so that the first non-negligible component is real and non-negative. This makes signatures stable and reduces spurious differences due to global phase.

jones

Tuple \((a, b)\) representing the Jones vector components.

classmethod A() Self

Anti-diagonal linear polarization.

Returns:

\(\frac{1}{\sqrt{2}}(1, -1)\).

Return type:

Polarization

classmethod D() Self

Diagonal linear polarization.

Returns:

\(\frac{1}{\sqrt{2}}(1, 1)\).

Return type:

Polarization

classmethod H() Self

Horizontal linear polarization.

Returns:

\((1, 0)\).

Return type:

Polarization

classmethod L() Self

Left-circular polarization (one common convention).

Returns:

\(\frac{1}{\sqrt{2}}(1, i)\).

Return type:

Polarization

classmethod R() Self

Right-circular polarization (one common convention).

Returns:

\(\frac{1}{\sqrt{2}}(1, -i)\).

Return type:

Polarization

classmethod V() Self

Vertical linear polarization.

Returns:

\((0, 1)\).

Return type:

Polarization

approx_signature(*, decimals: int = 12, ignore_global_phase: bool = False) tuple[object, ...]

Approximate signature with rounded components.

Parameters:
  • decimals (int) – Number of decimals to round to.

  • ignore_global_phase (bool) – If True, component signatures may ignore global phase where applicable.

Returns:

Signature tuple with rounded real/imag parts.

Return type:

Signature

jones: tuple[complex, complex]
classmethod linear(theta: float) Self

Linear polarization at angle \(\theta\).

The Jones vector is:

\[\begin{split}\mathbf{v}(\theta) = \begin{pmatrix}\cos\theta \\ \sin\theta\end{pmatrix}.\end{split}\]
Parameters:

theta (float) – Polarization angle (radians).

Returns:

Linear polarization label at angle \(\theta\).

Return type:

Polarization

overlap(other: Polarization) complex

Compute the polarization overlap.

This is the usual complex inner product of normalized Jones vectors:

\[\langle \mathbf{v}_1, \mathbf{v}_2 \rangle = \mathbf{v}_1^\dagger \mathbf{v}_2.\]
Parameters:

other (Polarization) – Another polarization label.

Returns:

Complex overlap \(\langle \mathbf{v}_1, \mathbf{v}_2 \rangle\).

Return type:

complex

rotated(theta: float) Self

Rotate the polarization by angle \(\theta\).

This applies the real rotation matrix:

\[\begin{split}R(\theta)=\begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}\end{split}\]

to the Jones vector.

Parameters:

theta (float) – Rotation angle (radians).

Returns:

Rotated polarization label.

Return type:

Polarization

property signature: tuple[object, ...]

Stable signature for caching/comparison.

The signature is based on the canonicalized Jones components.

transformed(unitary: ndarray, *, atol: float = 1e-12) Self

Apply a 2x2 unitary Jones transformation.

This method applies a unitary matrix \(U\) to the Jones vector,

\[\mathbf{v}' = U \mathbf{v},\]

where \(U\) must satisfy

\[U^\dagger U = I\]

up to the specified tolerance.

Since Polarization canonicalizes global phase, transformed states that differ only by a global phase compare equal.

Parameters:
  • unitary (ndarray) – Complex 2x2 unitary Jones matrix.

  • atol (float) – Absolute tolerance used when checking unitarity.

Returns:

Transformed polarization label.

Return type:

Polarization

Raises:

ValueError – If unitary does not have shape (2, 2) or is not unitary within the requested tolerance.

Parameters:

jones (tuple[complex, complex])

pol: PolarizationProtocol