Skip to main content

Module kernel

Module kernel 

Source
Expand description

Backend-agnostic uniaxial transfer-matrix core.

This module owns the per-(q, stack) inner loop of the uniaxial-z 4x4 solver in a form that is portable to accelerator backends: no heap allocation, no nalgebra, plain [..; 4] arrays, and a flat plain-old-data layer description (LayerCoeffs). Arithmetic is generic over Real so the identical code path can be evaluated in f32 to quantify single-precision error before committing to GPU precision modes.

The per-point solvers do no threading; only the solve_flat* drivers distribute q-points over rayon. It does not validate shapes or energies or build dielectric tensors; those live in crate::uniaxial. Callers must pass at least two layers (fronting and backing) and a strictly positive k0.

Structs§

GeneralLayer
One layer of a general anisotropic stack.
LayerCoeffs
Per-slab coefficients consumed by the uniaxial kernel.

Traits§

Real
Floating-point scalar accepted by the kernel (f32 or f64).

Functions§

solve_flat
Solves many stacks of equal depth against a shared q-grid.
solve_flat_recursive
Batched solve_point_recursive over equal-depth stacks and a shared q-grid.
solve_flat_rmatrix
Batched solve_point_rmatrix over equal-depth stacks and a shared q-grid.
solve_point
Solves the uniaxial transfer chain for one scattering vector.
solve_point_general
Polarized reflectance at one q-point for a general anisotropic stack.
solve_point_recursive
Polarized power reflectance at one q-point via decoupled Parratt recursion.
solve_point_recursive_jvp
Reflectance and its directional derivative at one q-point.
solve_point_rmatrix
Polarized reflectance at one q-point from the 4x4 reflection-matrix recursion.

Type Aliases§

PointResult
Polarized power reflectance and amplitude transmission at one q-point.