dtmm.jones4

Field vector and field data polarization and phase retardation matrix functions and handling.

Polarization and retardation handling

Convenience functions

  • apply_mode_jonesmat4x4() to apply the matrix to field data in fft space

  • apply_ray_jonesmat4x4() to apply the matrix to field data in real space

  • apply_jonesmat() to apply the matrix to field vector (1D).

Module Contents

dtmm.jones4.as2x2(pmat, fmat, mode=+ 1, out=None)

Converts jones 4x4 matrix to 2x2 E-field matrix

dtmm.jones4.polarizer4x4(jones, fmat, out=None)

Returns a 4x4 polarizer matrix for applying in eigenframe.

Numpy broadcasting rules apply.

Parameters
  • jones ((..,2) array) – A length two array describing the jones vector in the eigenframe. Jones vector should be normalized.

  • fmat ((..,4,4) array) – A field matrix array of the isotropic medium.

  • out (ndarray, optional) – Output array.

Returns

jmat – A 4x4 matrix for field vector manipulation in the eigenframe.

Return type

(..,4,4) array

See also

ray_jonesmat4x4

for applying a general matrix in the laboratory frame.

Examples

>>> f = dtmm.tmm.f_iso(n = 1.)
>>> jones = dtmm.jones.jonesvec((1,0))
>>> pol_mat = polarizer4x4(jones, f) #x polarizer matrix
dtmm.jones4.jonesmat4x4(jmat, fmat, out=None)

Returns a 4x4 jones matrix for applying in eigenframe.

Numpy broadcasting rules apply.

Parameters
  • jmat ((..,2,2) array) – A 2x2 jones matrix in the eigenframe. Any of matrices in dtmm.jones can be used.

  • fmat ((..,4,4) array) – A field matrix array of the isotropic medium.

  • out (ndarray, optional) – Output array

Returns

jmat – A 4x4 matrix for field vector manipulation in the eigenframe.

Return type

(..,4,4) array

See also

ray_jonesmat4x4

for applying the jones matrix in the laboratory frame.

dtmm.jones4.mode_jonesmat4x4(shape, k, jmat, epsv=(1.0, 1.0, 1.0), epsa=(0.0, 0.0, 0.0), betamax=BETAMAX)

Returns a mode polarizer for fft of the field data in the laboratory frame.

This is the most general set of jones matrices for field data. It is meant to be used in FFT space.

Parameters
  • shape ((int,int)) – Shape of the 2D crossection of the field data.

  • k (float or array of floats) – Wavenumber at which to compute the mode matrices.

  • jmat ((2,2) array) – A 2x2 jones matrix that needs to be converted to 4x4 mode matrices.

  • epsv (array) – Medium epsilon eigenvalues

  • epsa (array) – Medium epsilon euler angles

  • betamax (float) – The betamax parameter

Returns

pmat – Output matrix. Shape of the matirx is shape + (4,4) or len(ks) + shape + (4,4) if k is an array.

Return type

(:,:,4,4) array

See also

ray_jonesmat4x4

for applying the jones matrix in the real space.

jonesmat4x4

for applying the jones matrix in the eigenframe.

dtmm.jones4.mode_jonesmat2x2(shape, k, jmat, epsv=(1.0, 1.0, 1.0), epsa=(0.0, 0.0, 0.0), mode=+ 1, betamax=BETAMAX)

Returns a mode polarizer for fft of the field data in the laboratory frame.

This is the most general set of jones matrices for E-field data. It is meant to be used in FFT space.

Parameters
  • shape ((int,int)) – Shape of the 2D crossection of the field data.

  • k (float or array of floats) – Wavenumber at which to compute the mode matrices.

  • jmat ((2,2) array) – A 2x2 jones matrix that needs to be converted to 4x4 mode matrices.

  • epsv (array) – Medium epsilon eigenvalues

  • epsa (array) – Medium epsilon euler angles

  • mode (int) – PRopagatin mode, either +1 or -1

  • betamax (float) – The betamax parameter

Returns

pmat – Output matrix. Shape of the matirx is shape + (2,2) or len(ks) + shape + (2,2) if k is an array.

Return type

(:,:,2,2) array

See also

ray_jonesmat2x2

for applying the jones matrix in the real space.

dtmm.jones4.ray_jonesmat4x4(jmat, beta=0, phi=0, epsv=(1.0, 1.0, 1.0), epsa=(0.0, 0.0, 0.0))

Returns a ray polarizer for field data in the laboratory frame.

Numpy broadcasting rules apply.

Parameters
  • jmat ((..,2,2) array) – A 2x2 jones matrix that needs to be converted to 4x4 mode matrices.

  • beta (float) – The beta parameter of the beam.

  • phi (float) – The phi parameter of the beam.

  • epsv ((..,3) array) – Medium epsilon eigenvalues

  • epsa ((..,3) array) – Medium epsilon euler angles

  • betamax (float) – The betamax parameter

Returns

pmat – Output matrix.

Return type

(..,4,4) array

See also

mode_jonesmat4x4

for applying the jones matrix in the fft space.

jonesmat4x4

for applying the jones matrix in the eigenframe.

dtmm.jones4.ray_jonesmat2x2(jmat, beta=0, phi=0, epsv=(1.0, 1.0, 1.0), epsa=(0.0, 0.0, 0.0), mode=+ 1)

Returns a ray polarizer for E-field data in the laboratory frame.

Numpy broadcasting rules apply.

Parameters
  • jmat ((..,2,2) array) – A 2x2 jones matrix that needs to be converted to 2x2 mode matrices.

  • beta (float) – The beta parameter of the beam.

  • phi (float) – The phi parameter of the beam.

  • epsv ((..,3) array) – Medium epsilon eigenvalues

  • epsa ((..,3) array) – Medium epsilon euler angles

  • betamax (float) – The betamax parameter

Returns

pmat – Output matrix.

Return type

(..,2,2) array

See also

mode_jonesmat2x2

for applying the jones matrix in the fft space.

jonesmat2x2

for applying the jones matrix in the eigenframe.

dtmm.jones4.apply_mode_jonesmat(pmat, field, out=None)

Multiplies matrix with field data in fft space.

Parameters
  • pmat (array) – A 4x4 jones matrix of shape (…,:,:,4,4) for field data or 2x2 jones matrix of shape (…,:,:,2,2) for E-field data or

  • field (array) – Field data array of shape (…,4,:,:) or (…,2,:,:).

  • out (ndarray, optional) – If specified, the results are written here.

Returns

out – Computed field array of shape (…,4,:,:) or (…,2,:,:).

Return type

array

dtmm.jones4.apply_ray_jonesmat(pmat, field, out=None)

Multiplies matrix with field data in real space.

Parameters
  • pmat (array) – A 4x4 jones matrix of shape (…,4,4) for field data or 2x2 jones matrix of shape (…,2,2) for E-field data or

  • field (array) – Field data array of shape (…,4,:,:) or (…,2,:,:).

  • out (array, optional) – If specified, the results are written here.

Returns

out – Computed field array of shape (…,4,:,:) or (…,2,:,:).

Return type

ndarray

dtmm.jones4.apply_jonesmat(pmat, field, out=None)

Multiplies a (2x2) or (4x4) jones matrix with field vector

Parameters
  • pmat (ndarray) – A 4x4 jones matrix of shape (…,4,4) for field data or 2x2 jones matrix of shape (…,2,2) for E-field data or

  • field (array) – Field vector array of shape (…,4) or (…,2).

  • out (array, optional) – If specified, the results are written here.

Returns

out – Computed field array of shape (…,4).

Return type

ndarray