paralleltransport_matrix

marxs.math.polarization.paralleltransport_matrix(dir1, dir2, jones=array([[1., 0.], [0., 1.]]), replace_nans=True)[source] [edit on github]

Calculate parallel transport ray tracing matrix.

Parallel transport for a vector implies that the component s (perpendicular, from German senkrecht) to the planes spanned by dir1 and dir2 stays the same. If dir1 is parallel to dir2 this plane is not well defined and the resulting matrix elements will be set to np.nan, unless replace_nans is set.

Note that the ray matrix returned works on an eukledian 3d vector, not a homogeneous vector. (Polarization is a vector, thus the forth element of the homogeneous vector is always 0 and returning (4,4) matrices is just a waste of space.)

Parameters:
dir1, dir2np.array of shape (n, 3)

Direction before and after the interaction.

jonesnp.array of shape (2,2)

Jones matrix in the local s,p system of the optical element.

replace_nansbool

If True return an identity matrix for those rays with dir1=dir2. In those cases, the local coordinate system is not well defined and thus no Jones matrix can be applied. In MARXS dir1=dir2 often happens if some photons in a list miss the optical element in question - these photons just pass through and their polarization vector should be unchanged.

Returns:
p_matnp.array of shape(n, 3, 3)