1.3. py_pol.jones_matrix module

Jones_matrix objects describe optical polarization elements in the Jones formalism.

Class fields:
  • M: 2x2xN array containing all the Jones matrices.

  • name: Name of the object for print purposes.

  • shape: Shape desired for the outputs.

  • size: Number of stored Jones matrices.

  • ndim: Number of dimensions for representation purposes.

  • no_rotation: If True, rotation method do not act upon the object. Useful for objects that shouldn’t be rotated as mirrors.

  • type: Type of the object (‘Jones_matrix’). This is used for determining the object class as using isinstance may throw unexpected results in .ipynb files.

  • parameters: parameters of the Jones matrices.

  • checks: checks of the Jones matrices.

  • analysis: analysis of the Jones matrices.

Parent methods
  • clear: Removes data and name form Jones vector.

  • copy: Creates a copy of the Jones_vector object.

  • stretch: Stretches a Jones vector of size 1.

  • shape_like: Takes the shape of another object to use as its own.

  • reshape: Changes the shape of the object.

  • flatten: Transforms N-D objects into 1-D objects (0-D if only 1 element).

  • flip: Flips the object along some dimensions.

  • get_list: Creates a list with single elements.

  • from_list: Creates the object from a list of single elements.

  • concatenate: Canocatenates several objects into a single one.

  • draw: Draws the components of the object.

  • clear: Clears the information of the object.

Generation methods
  • from_components: Creates a Jones_matrix object directly from the 4 elements (m00, m01, m10, m11).

  • from_matrix: Creates a Jones_matrix object directly from a 2x2xN numpy arrays.

  • from_list: Creates a Jones_matrix object directly from a list of 2x2 numpy arrays.

  • from_Mueller: Takes a non-depolarizing Mueller Matrix and converts into Jones matrix.

  • vacuum: Creates the matrix for vacuum.

  • mirror: Creates the matrix for a mirror. NOTE: Don’t rotate this matrix.

  • filter_amplifier: Creates the matrix for a neutral filter or amplifier element

  • diattenuator_perfect: Creates a perfect linear diattenuator.

  • diattenuator_linear: Creates a real polarizer with perpendicular axes.

  • diattenuator_retarder_linear: Creates a linear diattenuator retarder with the same axes for diattenuation and retardance.

  • diattenuator_charac_angles: Creates the most general homogeneous diattenuator with orthogonal eigenstates from the characteristic angles of the main eigenstate.

  • diattenuator_azimuth_ellipticity: Creates the general homogeneous diattenuator with orthogonal eigenstates from the characteristic angles of the main eigenstate.

  • quarter_waveplate: Creates a quarter-waveplate.

  • half_waveplate: Creates a half-waveplate.

  • retarder_linear: Creates a retarder using delay.

  • retarder_material: Creates a retarder using physical properties of a anisotropic material.

  • retarder_charac_angles: Creates the most general homogenous retarder with orthogonal eigenstates from the characteristic angles of the main eigenstate.

  • retarder_azimuth_ellipticity: Creates the general homogeneous retarder with orthogonal eigenstates from the characteristic angles of the main eigenstate.

Manipulation methods
  • rotate: Rotates the Jones matrix.

  • sum: Calculates the summatory of the Jones matrices in the object.

  • prod: Calculates the product of the Jones matrices in the object.

  • remove_global_phase: Removes the phase introduced by the optical element (respect to J00).

  • add_global_phase: Increases the phase introduced by the optical element.

  • set_global_phase: Sets the phase introduced by the optical element.

  • reciprocal: The optical element is fliped so the light transverses it in the opposite direction.

  • transpose: Transposes the Jones matrix of the element.

  • hermitan: Calculates the hermitan matrix of the Jones matrix.

  • inverse: Calculates the inverse matrix of the Jones matrix.

Parameters subclass methods
  • matrix: Gets a numpy array with all the matrices.

  • components: Extracts the four components of the Jones matrix.

  • inhomogeneity: Calculates the inhomogeneity parameter.

  • diattenuation / polarizance: Calculates the diattenuation of the matrix.

  • retardance: Calculates the retardance (or delay) introduced between the fast and slow axes.

  • global_phase: Calculates the phase introduced by the optical element (respect to J00).

  • transmissions: Calculates the maximum and minimum field and/or intensity transmissions.

  • mean_transmission: Calculates the mean intensity transmission.

  • eig: Calculates the eigenvalues and eigenstates (eigenvectors) of the Jones matrices.

  • eigenvalues: Calculates the eigenvalues and of the Jones matrices.

  • eigenstates: Calculates the eigenstates (eigenvectors) of the Jones matrices.

  • det: Calculates the determinant and of the Jones matrices.

  • trace: Calculates the trace of the Jones matrices.

  • norm: Calculates the norm of the Jones matrices.

  • get_all: Returns a dictionary with all the parameters of the object.

Checks subclass methods
  • is_phisycall: Check if the Jones matrices correspond to physically realizable optical elements.

  • is_homogeneous: Determines if the matrices correspond to homogeneous optical elements.

  • is_retarder: Checks if the Jones matrices correspond to homogeneous retarders.

  • is_diattenuator / is_polarizer: Checks if the Jones matrices correspond to homogeneous diattenuators.

  • is_symmetric: Checks if the Jones matrices are symmetric.

  • is_conjugate_symmetric: Checks if the Jones matrices are conjugate symmetric.

  • is_eigenstate: Checks if a given light state is an eigenstate of the objct.

  • get_all: Returns a dictionary with all the checks of the object.

Analysis subclass methods
  • decompose_pure: Decomposes the Jones matrices in two: an homogeneous retarder and diattenuator.

  • diattenuator / polarizer: Analyzes the Jones matrices as if they were diattenuators.

  • retarder: Analyzes the Jones matrices as if they were retarders.

py_pol.jones_matrix.create_Jones_matrices(name='J', N=1, out_object=True)[source]

Function that creates several Jones_matrix objects at the same time from a list of names or a number.

Parameters:
  • name (string or list) – Name of the object for print purposes. Default: ‘J’.

  • N (int) – Number of created elements. Default: 1.

  • out_object (bool) – If N=1 and out_object is True the output is a Jones_matrix instead of a list. Default: True.

self.parameters

Class containing the measurable parameters of the Jones matrices.

Type:

class

self.checks

Class containing the methods that check something about the Jones matrices.

Type:

class

Returns:

Result.

Return type:

J (list or Jones_matrix)

py_pol.jones_matrix.set_printoptions(N_list=None, list_spaces=None)[source]

Function that modifies the global print options parameters.

Parameters:
  • N_list (int) – Number of matrices that will be printed as a list if the shape of the object is 1D. Default: None

  • list_spaces (int) – Number of spaces between matrices if they are printed as a list. Default: None

class py_pol.jones_matrix.Jones_matrix(name='J')[source]

Bases: Py_pol

Class for Jones matrices.

Parameters:
  • M (np.ndarray) – 2x2xN array containing all the Jones matrices.

  • name (string) – Name of the object for print purposes.

  • shape (tuple or list) – Shape desired for the outputs.

  • size (int) – Number of stored Jones matrices.

  • ndim (int) – Number of dimensions for representation purposes.

  • no_rotation (bool) – If True, rotation method do not act upon the object. Useful for objects that shouldn’t be rotated as mirrors.

  • type (string) – Type of the object (‘Jones_matrix’). This is used for determining the object class as using isinstance may throw unexpected results in .ipynb files.

self.parameters

parameters of the Jones matrices.

Type:

class

self.checks

checks of the Jones matrices.

Type:

class

self.analysis

analysis of the Jones matrices.

Type:

class

rotate(angle=0, keep=False, change_name=True)[source]

Rotates a jones_matrix a certain angle:

M_rotated = R(-angle) * self.M * R(angle)

Parameters:
  • angle (float) – Rotation angle in radians. Default: 0

  • keep (bool) – If True, the original element is not updated. Default: False.

  • change_name (bool) – If True and angle is of size 1, changes the object name adding @ XX deg, being XX the total rotation angle. Default: True.

Returns:

Rotated Jones matrix.

Return type:

(Jones_matrix)

reciprocal(keep=False, global_phase=0, length=1, shape_like=None, shape=None, change_name=True)[source]

Calculates the reciprocal of the optical element, so the light tranverses it in the opposite direction. It is calculated as:

\[J^{r}=\left[egin{array}{cc} 1 & 0\ 0 & -1 \end{array}\]
ight]J^{T}left[egin{array}{cc}

1 & 00 & -1 end{array}

ight]

References:

J.J. Gil, R. Ossikovsky “Polarized light and the Mueller Matrix approach”, CRC Press (2016), pp 106.

Parameters:

keep (bool): If True, the original element is not updated. Default: False. global_phase (float or numpy.ndarray): Global phase introduced by the optical element. Default: 0. length (int): If final object is of size 1, it is stretched to match this size. Default: 1. shape_like (numpy.ndarray or py_pol object): Use the shape of this object. Default: None. shape (tuple or list): If no shape_like array is given, use this shape instead. Default: None. change_name (bool): If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

(Jones_matrix): Result.

transpose(keep=False, global_phase=0, length=1, shape_like=None, shape=None, change_name=True)[source]

Calculates the transposed matrices of the Jones matrices.

Parameters:
  • keep (bool) – if True, the original element is not updated. Default: False.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • change_name (bool) – If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

Modified object.

Return type:

(Jones_matrix)

hermitian(keep=False, global_phase=0, length=1, shape_like=None, shape=None, change_name=True)[source]

Calculates the hermitian conjugate matrix of the Mueller matrix.

Parameters:
  • keep (bool) – if True, the original element is not updated. Default: False.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • change_name (bool) – If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

Modified object.

Return type:

(Jones_matrix)

inverse(keep=False, global_phase=0, length=1, shape_like=None, shape=None, change_name=True)[source]

Calculates the inverse matrix of the Jones matrix.

Parameters:
  • keep (bool) – if True, the original element is not updated. Default: False.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • change_name (bool) – If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

Modified object.

Return type:

(Jones_matrix)

sum(axis=None, keep=False, change_name=True)[source]

Calculates the sum of Jones matrices stored in the object.

Parameters:
  • axis (int, list or tuple) – Axes along which the summatory is performed. If None, all matrices are summed.

  • keep (bool) – If True, the original element is not updated. Default: False.

  • change_name (bool) – If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

Modified object.

Return type:

(Jones_matrix)

prod(axis=None, keep=False, change_name=True)[source]

Calculates the product of Jones matrices stored in the object.

Parameters:
  • axis (int, list or tuple) – Axes along which the product is performed. If None, all matrices are multiplied.

  • keep (bool) – if True, the original element is not updated. Default: False.

  • change_name (bool) – If True, changes the object name adding Recip. of at the beggining of the name. Default: True.

Returns:

Modified object.

Return type:

(Jones_matrix)

remove_global_phase(keep=False, length=1, shape_like=None, shape=None)[source]

Function that transforms the Jones vector removing the global phase, so J00 is real and positive.

Parameters:
  • keep (bool) – If True, self is not updated. Default: False.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Simplified Jones matrix.

Return type:

(Jones_matrix)

add_global_phase(global_phase=0, keep=False, length=1, shape_like=None, shape=None)[source]

Function that adds a phase to the Jones matrix.

Parameters:
  • global_phase (float or np.ndarray) – Phase to be added to the Jones matrix. Default: 0.

  • keep (bool) – If True, self is not updated. Default: False.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Recalculated Jones matrix.

Return type:

(Jones_matrix)

set_global_phase(global_phase=0, keep=False, length=1, shape_like=None, shape=None)[source]

Function that sets the phase of the Jones matrix.

Parameters:
  • global_phase (float or np.ndarray) – Phase to be added to the Jones matrix. Default: 0.

  • keep (bool) – If True, self is not updated. Default: False.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Recalculated Jones matrix.

Return type:

(Jones_matrix)

from_components(components, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the Jones matrix object form the arrays of electric field components.

Parameters:
  • components (tuple or list) – A 4 element tuple containing the 4 components of the Jones matrices (J00, J01, J10, J11).

  • global_phase (float or numpy.ndarray) – Adds a global phase to the Jones matrix. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

from_matrix(M, global_phase=0, length=1, shape_like=None, shape=None)[source]

Create a Jones_matrix object from an external array.

Parameters:
  • M (numpy.ndarray) – New matrix. At least two dimensions must be of size 2.

  • global_phase (float or numpy.ndarray) – Adds a global phase to the Jones matrix. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

from_Mueller(M, length=1, shape_like=None, shape=None)[source]

Converts a pure Mueller matrix into Jones matrix object. Elements of Mueller object which are not pure are converted into NaN values. The values are found inverting the equation:

\[M(J)=\left[egin{array}{cccc} 1 & 0 & 0 & 1\ 1 & 0 & 0 & -1\ 0 & 1 & 1 & 0\ 0 & i & -i & 0 \end{array}\]

ight]left(Jotimes J^{*} ight)left[egin{array}{cccc}

1 & 0 & 0 & 11 & 0 & 0 & -10 & 1 & 1 & 00 & i & -i & 0 end{array}

ight]^{-1}

References:

Handbook of Optics vol 2. 22.36 (52-54) Polarized Light and the Mueller matrix approach, J. J. Gil, pp 109.

Parameters:

M (Mueller): Mueller object. length (int): If final object is of size 1, it is stretched to match this size. Default: 1. shape_like (float or numpy.ndarray): Use the shape of this array. Default: None. shape (tuple or list): If no shape_like array is given, use this shape instead. Default: None.

Returns:

(Jones_matrix): Created object.

vacuum(global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the matrix for vacuum i.e., an optically neutral element.

Parameters:
  • global_phase (float or numpy.ndarray) – Adds a global phase to the Jones matrix. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

filter_amplifier(D=1, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the Jones matrix of neutral filters or amplifiers.

Parameters:
  • D (float or numpy.ndarray) – Attenuation (gain if > 1). Default: 1.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

mirror(ref=1, ref_field=None, global_phase=0, length=1, shape_like=None, shape=None)[source]

Jones matrix of a mirror.

Parameters:
  • ref (float or numpy.ndarray) – Intensity reflectivity of the mirror. Default: 1.

  • ref_field (float or numpy.ndarray) – Electric field reflectivity coefficient. If not None, it overrides REF. Default: None.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

diattenuator_perfect(azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates a perfect diattenuator (polarizer).

Parameters:
  • azimuth (float or numpy.ndarray) – rotation angle of the high transmission polarizer axis. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

diattenuator_linear(p1=1, p2=0, Tmax=None, Tmin=None, azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates a real polarizer with perpendicular axes:

\[J\left( heta=0\]
ight)=left[egin{array}{cc}

p_{1} & 00 & p_{2} end{array}

ight]’.

Parameters:

p1 (float or numpy.ndarray): Electric field transmission coefficient of the transmission eigenstate. Default: 1. p2 (float or numpy.ndarray): Electric field transmission coefficient of the extinction eigenstate. Default: 0. Tmax (float or numpy.ndarray): Maximum transmission. If not None, overrides p1. Default: None. Tmin (float or numpy.ndarray): Minimum transmission. If not None, overrides p2. Default: None. azimuth (float or numpy.ndarray): rotation angle of the high transmission polarizer axis. Default: 0. global_phase (float or numpy.ndarray): Global phase introduced by the optical element. Default: 0. length (int): If final object is of size 1, it is stretched to match this size. Default: 1. shape_like (numpy.ndarray or py_pol object): Use the shape of this object. Default: None. shape (tuple or list): If no shape_like array is given, use this shape instead. Default: None.

Returns:

(Jones_matrix): Created object.

diattenuator_charac_angles(p1=1, p2=0, Tmax=None, Tmin=None, alpha=0, delay=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the most general homogenous diattenuator with orthogonal eigenstates from the characteristic angles of the main eigenstate.

References

J.J. Gil, R. Ossikovsky “Polarized light and the Mueller Matrix approach”, CRC Press (2016) pp 137.

Parameters:
  • p1 (float or numpy.ndarray) – Electric field transmission coefficient of the transmission eigenstate. Default: 1.

  • p2 (float or numpy.ndarray) – [0, 1] Square root of the lower transmission for the other eigenstate. Default: 0.

  • Tmax (float or numpy.ndarray) – Maximum transmission. If not None, overrides p1. Default: None.

  • Tmin (float or numpy.ndarray) – Minimum transmission. If not None, overrides p2. Default: None.

  • alpha (float or numpy.ndarray) – [0, pi/2]: tan(alpha) is the ratio between field amplitudes of X and Y components. Default: 0.

  • delay (float or numpy.ndarray) – [0, 2*pi]: phase difference between X and Y field components. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

diattenuator_azimuth_ellipticity(p1=1, p2=0, Tmax=None, Tmin=None, azimuth=0, ellipticity=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the general diattenuator with orthogonal eigenstates from the characteristic angles of the main eigenstate.

References

J.J. Gil, R. Ossikovsky “Polarized light and the Mueller Matrix approach”, CRC Press (2016) pp 137.

Parameters:
  • p1 (float or numpy.ndarray) – [0, 1] Square root of the higher transmission for one eigenstate. Default: 1.

  • p2 (float or numpy.ndarray) – [0, 1] Square root of the lower transmission for the other eigenstate. Default: 0.

  • Tmax (float or numpy.ndarray) – Maximum transmission. If not None, overrides p1. Default: None.

  • Tmin (float or numpy.ndarray) – Minimum transmission. If not None, overrides p2. Default: None.

  • azimuth (float) – [0, pi]: Azimuth. Default: 0.

  • ellipticity (float) – [-pi/4, pi/]: Ellipticity angle. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

quarter_waveplate(azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Jones matrix of an ideal quarter-waveplate \(\lambda/4\).

Parameters:
  • azimuth (float or numpy.ndarray) – rotation angle of the fast state axis. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

half_waveplate(azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Jones matrix of an ideal half-waveplate \(\lambda/2\).

Parameters:
  • azimuth (float or numpy.ndarray) – Rotation angle of the fast state axis. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

retarder_linear(R=1.5707963267948966, azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates a linear retarder.

Parameters:
  • R (float) – [0, pi] Retardance (delay between components). Default: 90 degrees.

  • azimuth (float or numpy.ndarray) – Rotation angle of the fast state axis. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

retarder_material(ne=1, no=1, d=1.0, wavelength=0.6328, azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates a retarder using the physical properties of an anisotropic material.

\[\phi = 2 \pi (n_e-n_o) d / \lambda.\]
Parameters:
  • ne (float or numpy.ndarray) – Extraordinary index. Default: 1.

  • n0 (float or numpy.ndarray) – Ordinary index. Default: 1.

  • d (float or numpy.ndarray) – Thickness of the sheet in microns. Default: 1 um.

  • wavelength (float or numpy.ndarray) – Wavelength of the illumination. Default: 0.6328 um.

  • azimuth (float or numpy.ndarray) – Rotation angle of the fast state axis. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

retarder_charac_angles(R=1.5707963267948966, alpha=0, delay=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Function that calculates the most general homogeneous diattenuator from the characteristic angles of the fast eigenstate.

References

“Polarized light and the Mueller Matrix approach”, J. J. Gil, pp 125.

Parameters:
  • R (float) – [0, pi] Retardance (delay between components). Default: 90 degrees.

  • alpha (float) – [0, pi/2]: tan(alpha) is the ratio between amplitudes of the eigenstates in Jones formalism. Default: 0.

  • delay (float) – [0, 2*pi]: phase difference between both components of the eigenstates in Jones formalism. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

retarder_azimuth_ellipticity(R=1.5707963267948966, azimuth=0, ellipticity=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Function that calculates the most general homogeneous diattenuator from the characteristic angles of the fast eigenstate.

References

“Polarized light and the Mueller Matrix approach”, J. J. Gil, pp 125.

Parameters:
  • R (float) – [0, pi] Retardance (delay between components). Default: 90 degrees.

  • azimuth (float) – [0, pi]: Azimuth. Default: 0.

  • ellipticity (float) – [-pi/4, pi/4]: Ellipticity. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

diattenuator_retarder_linear(p1=1, p2=0, Tmax=None, Tmin=None, R=0, azimuth=0, global_phase=0, length=1, shape_like=None, shape=None)[source]
Creates a linear diattenuator retarder with the same

axes for diattenuation and retardance. At 0 degrees, the matrix is of the form:

\[J\left( heta=0\]
ight)=left[egin{array}{cc}

p_{1} & 00 & p_{2}e^{i R} end{array}

ight]’.

Parameters:

p1 (float or numpy.ndarray): Field transmission of the fast axis. Default: 1. p2 (float or numpy.ndarray): Electric field transmission coefficient of the extinction eigenstate. Default: 0. Tmax (float or numpy.ndarray): Maximum transmission. If not None, overrides p1. Default: None. Tin (float or numpy.ndarray): Minimum transmission. If not None, overrides p2. Default: None. R (float or numpy.ndarray): Retardance. Default: 0. azimuth (float or numpy.ndarray): Rotation angle of the high transmission polarizer axis. Default: 0. global_phase (float or numpy.ndarray): Global phase introduced by the optical element. Default: 0. length (int): If final object is of size 1, it is stretched to match this size. Default: 1. shape_like (numpy.ndarray or py_pol object): Use the shape of this object. Default: None. shape (tuple or list): If no shape_like array is given, use this shape instead. Default: None.

Returns:

(Jones_matrix): Created object.

diattenuator_retarder_azimuth_ellipticity(p1=1, p2=0, Tmax=None, Tmin=None, R=0, azimuth=0, ellipticity=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the most general homogenous diattenuator retarder from the azimuth and ellipticity of the fast eigenstate.

Parameters:
  • p1 (float or numpy.ndarray) – Field transmission of the fast axis. Default: 1.

  • p2 (float or numpy.ndarray) – Electric field transmission coefficient of the extinction eigenstate. Default: 0.

  • Tmax (float or numpy.ndarray) – Maximum transmission. If not None, overrides p1. Default: None.

  • Tmin (float or numpy.ndarray) – Minimum transmission. If not None, overrides p2. Default: None.

  • R (float or numpy.ndarray) – Retardance. Default: 0.

  • azimuth (float or numpy.ndarray) – rotation angle of the high transmission polarizer axis. Default: 0.

  • ellipticity (float) – [-pi/4, pi/]: Ellipticity angle. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

diattenuator_retarder_charac_angles(p1=1, p2=0, Tmax=None, Tmin=None, R=0, alpha=0, delay=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the most general homogenous diattenuator retarder from the characteristic angles of the fast eigenstate.

Parameters:
  • p1 (float or numpy.ndarray) – Field transmission of the fast axis. Default: 1.

  • p2 (float or numpy.ndarray) – Electric field transmission coefficient of the extinction eigenstate. Default: 0.

  • Tmax (float or numpy.ndarray) – Maximum transmission. If not None, overrides p1. Default: None.

  • Tmin (float or numpy.ndarray) – Minimum transmission. If not None, overrides p2. Default: None.

  • R (float or numpy.ndarray) – Retardance. Default: 0.

  • alpha (float or numpy.ndarray) – [0, pi/2]: tan(alpha) is the ratio between field amplitudes of X and Y components. Default: 0.

  • delay (float or numpy.ndarray) – [0, 2*pi]: Phase difference between X and Y field components. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

general_eigenstates(E1, E2=None, p1=1, p2=0, Tmax=None, Tmin=None, R=0, global_phase=0, length=1, shape_like=None, shape=None)[source]

Creates the most general optical element from its eigenstates.

Parameters:
  • E1 (Jones_vector) – First eigenstate.

  • E2 (Jones_vector) – Second eigenstate. If None, E2 is taken as the perpendicular state to E1, so the optical object is homogenous. Default: None

  • p1 (float or numpy.ndarray) – Field transmission of the fast axis. Default: 1.

  • p2 (float or numpy.ndarray) – Electric field transmission coefficient of the extinction eigenstate. Default: 0.

  • Tmax (float or numpy.ndarray) – Maximum transmission. If not None, overrides p1. Default: None.

  • Tmin (float or numpy.ndarray) – Minimum transmission. If not None, overrides p2. Default: None.

  • R (float or numpy.ndarray) – Retardance. Default: 0.

  • global_phase (float or numpy.ndarray) – Global phase introduced by the optical element. Default: 0.

  • length (int) – If final object is of size 1, it is stretched to match this size. Default: 1.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

Returns:

Created object.

Return type:

(Jones_matrix)

class py_pol.jones_matrix.Parameters_Jones_Matrix(Jones_matrix)[source]

Bases: object

Class for Jones Matrix Parameters.

Parameters:

self.parent (Jones_matrix) – Parent object.

get_all(verbose=False, draw=False)[source]

Creates a dictionary with all the parameters of Jones Matrix.

Parameters:
  • verbose (bool) – If True, print all parameters. Default: False.

  • draw (bool) – If True, draw all plots/images of the parameters. Default: False.

Returns:

Dictionary with parameters of Jones Matrix.

Return type:

(dict)

matrix(shape=None, shape_like=None)[source]

Returns the numpy array of Jones matrices.

Parameters:
  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

Returns:

(numpy.ndarray) 2x2xN numpy array.

components(out_number=True, shape_like=None, shape=None, verbose=False, draw=False, kind='jones')[source]

Extracts the matrix components of the Jones matrix.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – if True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

array of the 0, 0 element of the matrix. J01 (numpy.ndarray): array of the 0, 1 element of the matrix. J10 (numpy.ndarray): array of the 1, 0 element of the matrix. J11 (numpy.ndarray): array of the 1, 1 element of the matrix.

Return type:

J00 (numpy.ndarray)

inhomogeneity(method='val', out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the inhomogeneity parameter.

References

Method EIG: J.J. Gil, R. Ossikovsky “Polarized light and the Mueller Matrix approach”, CRC Press (2016), pp 119. Method VAL: “Homogeneous and inhomogeneous Jones matrices”, S.Y. Lu and R.A. Chipman, J. Opt. Soc. Am. A/Vol. 11, No. 2 pp. 766 (1994)

Parameters:
  • method (string) – Method used for the calculation of the inhomogeneity parameter: EIG uses the eigenstates and VAL uses determinant, norm and trace.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Inhomogeneity parameter.

Return type:

eta (numpy.ndarray or float)

diattenuation(remove_nan=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculation of the diattenuation of a Jones Matrix.

References

“Homogeneous and inhomogeneous Jones matrices”, S.Y. Lu and R.A. Chipman, J. Opt. Soc. Am. A/Vol. 11, No. 2 pp. 766 (1994)

Parameters:
  • remove_nan (bool) – If True, np.nan values are substitued by 0. Default: False.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Diattenuation.

Return type:

D (numpy.ndarray or float)

polarizance(remove_nan=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculation of the polarizance of the Jones matrices. In Jones formalism, this is the same as diattenuation.

Parameters:
  • remove_nan (bool) – If True, np.nan values are substitued by 0. Default: False.

  • out_number (bool) – # IDEA: f True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – if True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Polarizance.

Return type:

P (numpy.ndarray or float)

retardance(remove_nan=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculation of the retardance (delay between eigenstates) of a Jones optical element.

References

“Homogeneous and inhomogeneous Jones matrices”, Shih-Yau Lu and Russell A. Chipman, J. Opt. Soc. Am. A/Vol. 11, No. 2 pp. 766 (1994)

Parameters:
  • remove_nan (bool) – If True, np.nan values are substitued by 0. Default: False.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Retardance.

Return type:

R (numpy.ndarray or float)

global_phase(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the phase of J00 (which is the reference for global phase in py_pol model).

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Global phase.

Return type:

(numpy.ndarray) [0, 2*pi]

transmissions(kind='INTENSITY', out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculate the maximum and minimum transmitance of an optical element.

References

Handbook of Optics vol 2. 22.32 (eq.38)

Parameters:
  • kind (str) – There are three options, FIELD, INTENSITY or ALL. Defaut: ‘INTENSITY’

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Maximum intensity transmission. T_min (numpy.ndarray): Minimum intensity transmission. p1 (numpy.ndarray): Maximum field transmission. p2 (numpy.ndarray): Minimum field transmission.

Return type:

T_max (numpy.ndarray)

mean_transmission(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculate the mean intensity transmitance of an optical element.

References

Handbook of Optics vol 2. 22.32 (eq.38)

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result

Return type:

(numpy.ndarray) [0, 1]

eig(as_objects=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the eigenvalues and eigenstates of the Jones object.

Parameters:
  • as_objects (bool) – If True, the eigenvectors are extracted as py_pol objects. Default: False.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – if True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

First eigenvalue. v2 (numpy.ndarray or float): Second eigenvalue. e1 (numpy.ndarray or Jones_vector): First eigenstate. e2 (numpy.ndarray or Jones_vector): Second eigenstate.

Return type:

v1 (numpy.ndarray or float)

TODO: Maybe give values and states together as a matrix

eigenvectors(shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the eigenvectors of the Jones object.

Parameters:
  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

2xN first eigenvectors matrix. e2 (numpy.ndarray): 2xN second eigenvectors matrix.

Return type:

e1 (numpy.ndarray)

eigenstates(shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the eigenstates of the Jones object. Very similar to eigenvectors, but the output are Jones_vector objects.

Parameters:
  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – if True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

First eigenstate. e2 (Jones_vector): Second eigenstate.

Return type:

e1 (Jones_vector)

eigenvalues(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the eigenvalues and eigenstates of the Jones object.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

First eigenvalue. v2 (numpy.ndarray or float): Second eigenvalue.

Return type:

v1 (numpy.ndarray or float)

det(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the determinants of the Jones matrices.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray, float or complex)

trace(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the trace of the Jones matrices.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray, float or complex)

norm(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Calculates the Frobenius norm of the Jones matrices.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray, float or complex)

class py_pol.jones_matrix.Checks_Jones_Matrix(Jones_matrix)[source]

Bases: object

Class for Jones matrix checks.

Parameters:

self.parent (Jones_matrix) – Parent object.

get_all(verbose=False, draw=False)[source]

Creates a dictionary with all the parameters of Jones Matrix.

Parameters:
  • verbose (bool) – If True, print all parameters. Default: False.

  • draw (bool) – If True, draw all plots/images of the parameters. Default: False.

Returns:

Dictionary with parameters of Jones Matrix.

Return type:

(dict)

is_physical(all_info=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Verifies that a Jones matrix is physically realizable. Take into account that amplifiers are not included in this category.

References

  1. Martinez-Herrero, P.M. Mejias, G.Piquero “Characterization of partially polarized light fields” Springer series in Optical sciences (2009) ISBN 978-3-642-01326-3, page 3, eqs. 1.4a and 1.4b.

Parameters:
  • all_info (bool) – If True, the method returns the information regarding each condition separately. Default: False.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_homogeneous(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if matrix is homogeneous (the two eigenstates are orthogonal) or not.

References

“Homogeneous and inhomogeneous Jones matrices”, S.Y. Lu and R.A. Chipman, J. Opt. Soc. Am. A/Vol. 11, No. 2 pp. 766 (1994)

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_retarder(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if matrix is an homogeneous retarder. The condition is that the Jones matrix must be unitary ($$J^{dagger}=J^{-1}$$).

References

“Polarized light and the Mueller Matrix approach”, J. J. Gil, pp 123.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_diattenuator(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if matrix is an homogeneous diattenuator. The condition is that the Jones matrix must be hermitian ($$J^{dagger}=J$$).

References

“Polarized light and the Mueller Matrix approach”, J. J. Gil, pp 123.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_polarizer(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if matrix is an homogeneous polarizer. In Jones formalism, there is no difference between homogeneous diattenuators and polarizers.

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_symmetric(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if the object matrix is symmetric (i.e. $$J = J^T$$).

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_conjugate_symmetric(out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if the object matrix is conjugate symmetric (i.e. $$J = J^{dagger}$$).

Parameters:
  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

is_eigenstate(S, out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Determines if the vector S is an eigenstate of the object.

Parameters:
  • S (Stokes or Jones_vector) – State to test.

  • out_number (bool) – if True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – if True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

Result.

Return type:

(numpy.ndarray or bool)

class py_pol.jones_matrix.Analysis_Jones_Matrix(Jones_matrix)[source]

Bases: object

Class for Jones matrix analysis.

Parameters:

self.parent (Jones_matrix) – Parent object.

decompose_pure(decomposition='RP', all_info=False, out_number=True, shape_like=None, shape=None, verbose=False, draw=False, transmissions='ALL', angles='ALL')[source]

Polar decomposition of a pure Mueller matrix in a retarder and a diattenuator.

References

“Homogeneous and inhomogeneous Jones matrices”, S.Y. Lu and R.A. Chipman, J. Opt. Soc. Am. A/Vol. 11, No. 2 pp. 766 (1994)

Parameters:
  • decomposition (string) – string with the order of the elements: retarder (R) or diattenuator/polarizer (D or P).

  • all_info (bool) – If True, the method returns the information regarding each condition separately. Default: False.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

  • transmissions (string) – Determines the type of transmission output, FIELD, INTENSITY or ALL. Default: ALL.

  • angles (string) – Determines the type of angles output, CHARAC (characteristic angles), AZIMUTH (azimuth and ellipticity) or ALL. Default: ALL.

Returns:

Jones matrix object of the retarder. Jd (Jones_matrix): Jones matrix object of the diattenuator. dict_param (dictionary): Dictionary with the 9 parameters (7 independent) of both the retarder and the diattenuator (only if all_info = True).

Return type:

Jr (Jones_matrix)

diattenuator(transmissions='ALL', angles='ALL', out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Analyzes the properties of the optical objects as a diattenuator.

Parameters:
  • transmissions (string) – Determines the type of transmission output, FIELD, INTENSITY or ALL. Default: ALL.

  • angles (string) – Determines the type of angles output, CHARAC (characteristic angles), AZIMUTH (azimuth and ellipticity) or ALL. Default: ALL.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

List including Tmax, Tmin, p1 and p2 (wich appear only if requested). state (list): List with alpha, delay, azimuth and ellipticity of the transmission state (wich appear only if requested).

Return type:

trans (list)

polarizer(transmissions='ALL', angles='ALL', out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Analyzes the properties of the optical objects as a polarizer. In Jones formalism, this is the same as analyzing the element as a diattenuator.

Parameters:
  • transmissions (string) – Determines the type of transmission output, FIELD, INTENSITY or ALL. Default: ALL.

  • angles (string) – Determines the type of angles output, CHARAC (characteristic angles), AZIMUTH (azimuth and ellipticity) or ALL. Default: ALL.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

List including Tmax, Tmin, p1 and p2 (wich appear only if requested). state (list): List with alpha, delay, azimuth and ellipticity of the transmission state (wich appear only if requested).

Return type:

trans (list)

retarder(angles='ALL', out_number=True, shape_like=None, shape=None, verbose=False, draw=False)[source]

Analyzes the properties of the optical objects as a retarder.

Parameters:
  • angles (string) – Determines the type of angles output, CHARAC (characteristic angles), AZIMUTH (azimuth and ellipticity) or ALL. Default: ALL.

  • out_number (bool) – If True and the result is a 1x1 array, return a number instead. Default: True.

  • shape_like (numpy.ndarray or py_pol object) – Use the shape of this object. Default: None.

  • shape (tuple or list) – If no shape_like array is given, use this shape instead. Default: None.

  • verbose (bool) – If True prints the parameter. Default: False.

  • draw (bool) – If True and the object is a 1D or 2D, plot it. Default: False.

Returns:

List including Tmax, Tmin, p1 and p2 (wich appear only if requested). state (list): List with alpha, delay, azimuth and ellipticity of the transmission state (wich appear only if requested).

Return type:

trans (list)