dtmm.jones¶
Jones calculus functions. You can use this module for simple normal incidence jones calculus.
2x2 matrices¶
jonesvec(): jones vectormirror(): mirror matrixpolarizer(): polarizer matrixretarder(): retarder matrixquarter_waveplate(): quarter-wave plate matrixhalf_waveplate(): half-wave plate matrixcircular_polarizer(): circular polarizer matrixlinear_polarizer(): linear polarizer matrix
Conversion functions¶
as4x4(): convert to 4x4 matrix for (…,4) field vector.rotated_matrix(): to view the matrix in rotated frame.
Examples
>>> j_in = jonesvec((1,1)) #input light polarized at 45
>>> r = retarder(0.2,0.4)
>>> p = linear_polarizer((1,0)) # x polarization
>>> c = circular_polarizer(+1) # left handed
>>> m = multi_dot([r,p,c])
>>> j_out = dotmv(m,j_in) #output light E field
>>> i = jones_intensity(j_out) #intensity
Module Contents¶
-
dtmm.jones.jones_intensity(jones)¶ Computes intensity of the jones vector
- Parameters
jones ((..,2) array) – Jones vector.
- Returns
intensity – Computed intensity.
- Return type
(..) float array
-
dtmm.jones.jonesvec(pol, phi=0.0, out=None)¶ Returns a normalized jones vector from an input length 2 vector., Additionaly, you can use this function to view the jones vector in rotated coordinate frame, defined with a rotation angle phi.
Numpy broadcasting rules apply.
- Parameters
pol ((..,2) array) – Input jones vector. Does not need to be normalized.
phi (float or (..,1) array) – If jones vector must be view in the rotated frame, this parameter defines the rotation angle.
out (ndarray) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
vec – Normalized jones vector
- Return type
ndarray
Example
>>> jonesvec((1,1j)) #left-handed circuar polarization array([0.70710678+0.j , 0. +0.70710678j])
In rotated frame
>>> j1,j2 = jonesvec((1,1j), (np.pi/2,np.pi/4)) >>> np.allclose(j1, (0.70710678j,-0.70710678)) True >>> np.allclose(j2, (0.5+0.5j,-0.5+0.5j)) True
-
dtmm.jones.mirror(out=None)¶ Returns jones mirror matrix.
- Parameters
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.retarder(phase, phi=0.0, out=None)¶ Returns jones matrix of general phase retarder
Numpy broadcasting rules apply.
- Parameters
phase (float or array) – Phase difference between the fast and slow axis of the retarder.
phi (float or array) – Fast axis orientation
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.quarter_waveplate(phi=0.0, out=None)¶ Returns jones quarter-wave plate matrix.
Numpy broadcasting rules apply.
- Parameters
phi (float or array) – Fast axis orientation
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.half_waveplate(phi=0.0, out=None)¶ Returns jones half-wave plate matrix.
Numpy broadcasting rules apply.
- Parameters
phi (float or array) – Fast axis orientation
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.polarizer(jones, out=None)¶ Returns jones polarizer matrix.
Numpy broadcasting rules apply.
- Parameters
jones ((..,2) array) – Input normalized jones vector. Use
jonesvec()to generate jones vectorout (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
Examples
>>> pmat = polarizer(jonesvec((1,1))) #45 degree linear polarizer >>> np.allclose(pmat, linear_polarizer(np.pi/4)+0j ) True >>> pmat = polarizer(jonesvec((1,-1))) #-45 degree linear polarizer >>> np.allclose(pmat, linear_polarizer(-np.pi/4)+0j ) True >>> pmat = polarizer(jonesvec((1,1j))) #left handed circular polarizer >>> np.allclose(pmat, circular_polarizer(1) ) True
-
dtmm.jones.linear_polarizer(angle, out=None)¶ Return jones matrix for a polarizer.
Numpy broadcasting rules apply.
- Parameters
angle (float or array) – Orientation of the polarizer.
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.circular_polarizer(hand, out=None)¶ Returns circular polarizer matrix.
Numpy broadcasting rules apply.
- Parameters
hand (int or (..,1) array) – Handedness +1 (left-hand) or -1 (right-hand).
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
ndarray
-
dtmm.jones.rotated_matrix(jmat, phi)¶ jones matrix viewed in the rotated frame, where phi is the rotation angle
Performs (R.T).jmat.R where R is the rotation matrix.
Numpy broadcasting rules apply.
- Parameters
jmat ((..,2,2) array) – Jones matrix
phi (float) – Rotation angle.
- Returns
out – Rotated jones matrix.
- Return type
(..,2,2) array
-
dtmm.jones.as4x4(jmat, out=None)¶ Converts jones 2x2 matrix to eigenfield 4x4 matrix.
- Parameters
jmat ((..,2,2) array) – Jones matrix
out (ndarray, optional) – Output array in which to put the result; if provided, it must have a shape that the inputs broadcast to.
- Returns
mat – Output jones matrix.
- Return type
(..,4,4) ndarray