paralleltransport_matrix¶
- marxs.math.polarization.paralleltransport_matrix(dir1, dir2, jones=array([[1., 0.], [0., 1.]]), replace_nans=True)[source]¶
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
dir1anddir2stays the same. Ifdir1is parallel todir2this plane is not well defined and the resulting matrix elements will be set tonp.nan, unlessreplace_nansis 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
Truereturn an identity matrix for those rays withdir1=dir2. In those cases, the local coordinate system is not well defined and thus no Jones matrix can be applied. In MARXSdir1=dir2often 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_mat : np.array of shape(n, 3, 3)