Function decompose_gram_schmidt

Source
pub fn decompose_gram_schmidt(
    x_grid: &[f64],
    delta_n: &[f64],
    x_min: f64,
    x_max: f64,
) -> DistortionParams
Expand description

CJ2014 Appendix A: Gram-Schmidt decomposition over a frequency band.

Reference: Chluba & Jeong (2014), arXiv:1306.5751, Appendix A.

Constructs an orthonormal basis (e_y, e_μ, e_T) for the three-dimensional subspace spanned by (Y_SZ, M, G) via Gram-Schmidt in the order

  1. e_y = Y_SZ / |Y_SZ|
  2. e_μ = M⊥ / |M⊥|, with M⊥ = M − (M·e_y) e_y
  3. e_T = G⊥ / |G⊥|, with G⊥ = G − (G·e_y) e_y − (G·e_μ) e_μ under the inner product ⟨a, b⟩ = ∫_{x_min}^{x_max} a(x) b(x) dx (trapezoidal rule on the supplied grid). This generalises CJ2014’s uniform-channel flat sum to our non-uniform x-grid and reduces to it in the continuum limit.

After projection, the coefficients (a_y, a_μ, a_T) = (⟨Δn, e_y⟩, ⟨Δn, e_μ⟩, ⟨Δn, e_T⟩) are mapped back to (μ, y, ΔT/T) via exact back-substitution of Δn ≈ μ M + y Y_SZ + (ΔT/T) G, giving ΔT/T = a_T / |G⊥| μ = (a_μ − ΔT/T · G_μ) / |M⊥| y = (a_y − ΔT/T · G_y − μ · M_y) / |Y_SZ| with M_y = M·e_y·|Y_SZ|, G_y = G·e_y·|Y_SZ|, G_μ = G·e_μ·|M⊥|.