solprop.polarisation#

Construct Jones optics and describe transverse polarisation in the optics convention.

Jones vectors are [E_x, E_y]. Stokes vectors are [I, Q, U, V] with V = -2 Im(E_x conj(E_y)), so (x + i y)/sqrt(2) has positive V. A waveplate’s fast axis is x: its retardance delays the vertical component relative to the horizontal one, and in the optics convention a delay is a positive phase (conventions.md §2), so a quarter-wave plate turns light linear at +45° into (x + i y)/sqrt(2). Convert internal FFT-convention fields at the existing Fourier boundary before using these helpers.

The ellipse orientation is atan2(U, Q)/2, which keeps the sign of U. Circular and zero fields use zero orientation by convention; normalised Stokes coordinates require nonzero intensity.

Functions

cartesian(parameters)

Return normalised Stokes coordinates on or inside the Poincare sphere.

ellipse(parameters)

Return ellipse semiaxes, orientation and handedness from Stokes parameters.

ellipticity(parameters)

Return the unsigned minor-to-major semiaxis ratio.

horizontal()

Return the unit Jones vector along x.

linear_polariser()

Return an ideal linear polariser transmitting x.

rotate(matrix, angle)

Rotate a Jones optical element from x towards y.

rotation(angle)

Return a passive rotation of the transverse coordinate axes.

stokes(field, *[, normalise])

Return Stokes parameters for one optics-convention Jones vector.

waveplate(retardance)

Return a waveplate with its fast axis along x in the optics convention.

Classes

PolarisationEllipse(major, minor, angle, ...)

Describe the ellipse associated with a Stokes vector.

class solprop.polarisation.PolarisationEllipse(major, minor, angle, handedness)[source]#

Bases: object

Describe the ellipse associated with a Stokes vector.

Attributes:
majorfloat

Major semiaxis, in the field’s amplitude units, non-negative.

minorfloat

Minor semiaxis in the same units, between zero and major.

anglefloat

Major-axis orientation from x towards y, rad, in [-pi/2, pi/2]. Zero for circular or zero fields, whose orientation is undefined.

handednessint

Sign of Stokes V: -1, 0 or +1. This names the algebraic sign without assuming an observer’s viewing direction.

angle: float#
handedness: int#
major: float#
minor: float#
solprop.polarisation.cartesian(parameters)[source]#

Return normalised Stokes coordinates on or inside the Poincare sphere.

Parameters:
parametersarray_like

Physical Stokes vector, shape (4,), with positive I.

Returns:
numpy.ndarray

Dimensionless [Q, U, V]/I, shape (3,).

Raises:
PolarisationError

If the vector is invalid or I is zero.

solprop.polarisation.ellipse(parameters)[source]#

Return ellipse semiaxes, orientation and handedness from Stokes parameters.

Parameters:
parametersarray_like

Physical Stokes vector [I, Q, U, V], shape (4,).

Returns:
PolarisationEllipse

Semiaxes in field units, orientation in rad, and the sign of V. For a partially polarised Stokes vector this describes its equivalent ellipse.

Raises:
PolarisationError

If the Stokes vector is nonphysical or not finite.

solprop.polarisation.ellipticity(parameters)[source]#

Return the unsigned minor-to-major semiaxis ratio.

Parameters:
parametersarray_like

Physical Stokes vector, shape (4,), with positive intensity.

Returns:
float

Ratio in [0, 1]: zero for linear polarisation, one for circular.

Raises:
PolarisationError

If the vector is invalid or the field has zero intensity.

solprop.polarisation.horizontal()[source]#

Return the unit Jones vector along x.

Returns:
numpy.ndarray

Dimensionless [1, 0], shape (2,), complex128.

solprop.polarisation.linear_polariser()[source]#

Return an ideal linear polariser transmitting x.

Returns:
numpy.ndarray

Dimensionless Jones matrix diag(1, 0), shape (2, 2).

solprop.polarisation.rotate(matrix, angle)[source]#

Rotate a Jones optical element from x towards y.

Parameters:
matrixarray_like

Finite dimensionless Jones matrix, shape (2, 2).

anglefloat

Finite physical rotation angle, rad.

Returns:
numpy.ndarray

rotation(-angle) @ matrix @ rotation(angle).

Raises:
PolarisationError

If the matrix or angle is invalid.

solprop.polarisation.rotation(angle)[source]#

Return a passive rotation of the transverse coordinate axes.

Parameters:
anglefloat

Finite angle from x towards y, rad.

Returns:
numpy.ndarray

Dimensionless matrix [[cos, sin], [-sin, cos]].

Raises:
PolarisationError

If the angle is not finite.

solprop.polarisation.stokes(field, *, normalise=False)[source]#

Return Stokes parameters for one optics-convention Jones vector.

Parameters:
fieldarray_like

Finite Jones vector [E_x, E_y], shape (2,).

normalisebool, optional

Divide by the total intensity; requires a nonzero field.

Returns:
numpy.ndarray

[I, Q, U, V], shape (4,), in squared field units or dimensionless when normalised. Positive V corresponds to (x + i y)/sqrt(2).

Raises:
PolarisationError

If the vector is invalid, squared amplitudes overflow, or normalisation is requested for zero intensity.

Examples

>>> from solprop.polarisation import stokes
>>> stokes([1, 1j], normalise=True).tolist()
[1.0, 0.0, 0.0, 1.0]
solprop.polarisation.waveplate(retardance)[source]#

Return a waveplate with its fast axis along x in the optics convention.

Parameters:
retardancefloat

Finite retardance of the slow y component behind the fast x one, rad. A delay is a positive optics-convention phase, so y gains +retardance relative to x.

Returns:
numpy.ndarray

Unitary Jones matrix diag(exp(-i phase/2), exp(+i phase/2)).

Raises:
PolarisationError

If the retardance is not finite.