permutation_pair

Function permutation_pair 

Source
fn permutation_pair<const N: usize>(
    vector: [Complex; 3],
    turns: usize,
) -> Result<[Jet<N>; 2]>
Expand description

The parity coefficients [same, cross] of the plane wave vector under turns cyclic turns of the axes, as jets in the wavevector components.

After one turn the permuted wavevector is (kz, kx, ky), after two (ky, kz, kx). same maps a parity polarization to itself, cross to the other one (upstream polout == polin and polout != polin). Zero turns give [1, 0].

Three branches compute the pair:

  1. The closed form of upstream, [-y z, -i x k] / (sqrt(x^2 + y^2) sqrt(z^2 + x^2)) for one turn and its twin for two, when the largest component lies within 1e±70 and the squared modulus of the denominator within 1e±140. The first bound keeps the squares of the components finite; the second keeps the direction away from an axis and the derivative jets, which divide by the denominator squared, finite.
  2. The Direction frames of the original and the permuted wavevector, which scale extreme magnitudes, when both have a nonzero transverse part.
  3. On the axis of either frame, the products of the polarization vectors in the axis gauge of polarization_jet.