pub fn layer_stack(
ks: Vec<[Complex; 2]>,
zs: &[Complex],
q: Vec<[f64; 2]>,
thickness: &[f64],
axis: usize,
fixed_q: bool,
) -> Result<(Vec<Blocks>, LayerStackResidual)>Expand description
Stack layers independently for each transverse wavevector; the output is one S-matrix of four 2-by-2 blocks per wavevector.
ks holds the wavenumbers of polarizations 0 and 1 and zs the impedance of every
medium, from the negative side (below) to the positive side (above); thickness
holds the interior layers in the same order. axis is the Cartesian normal of the
layers, and each q holds the two transverse components after it in cyclic order.
With fixed_q, the pullback holds the transverse components fixed and returns
zero q gradients.
Upstream: treams.SMatrices.stack of alternating SMatrices.interface and
SMatrices.propagation, here for each transverse wavevector separately.