Tetrahedral POVM, Stokes vectors, instrumentation matrix, pseudo-inverse, retarders and Laguerre-Gaussian Poincaré beam
DefinitionArxiv2405_00432_BasicObjects of Sections 2-4 of McWilliam, Al Khafaji, Svensson, Pádua and Franke-Arnold (2024).
- Polarization states and Stokes vectors (Section 2.1). A polarization state is with . Its Stokes vector is , , , , and the normalized Stokes vector is .
- Tetrahedral POVM (eqs. 1-2). With and , the POVM states are , , , . The POVM operators are , the outcome probabilities are , and the normalized intensity vector is .
- Ideal instrumentation matrix (eq. 4). .
- Calibration states (eq. 8). , , , .
- Pseudo-inverse (eq. 6). For a real matrix whose columns are the Stokes vectors measured at pixels, . The beam profile contains four linearly independent polarization states if four columns of are linearly independent.
- Retarders (eqs. 11, 14, 15). is the Mueller matrix of eq. (11) of a retarder of retardance with fast axis at angle . For a matrix (indices -), , , , , with the real arctangent with values in . The theoretical retardance of a waveplate of thickness at wavelength is
- Laguerre-Gaussian modes and the Poincaré beam (eq. 10). For a Gaussian beam with waist at and wavelength : , , . The mode at polar coordinates in the plane is
with , the generalized Laguerre polynomial , and mode order ; is the Gouy phase. The Poincaré beam is , both modes with the same and .
Formalization Note The paper does not state the sign convention of . The one used, , is the unique sign for which the rows of eq. (4) are the Stokes vectors of the states of eq. (1), which the paper asserts. The paper does not write out the Laguerre-Gaussian modes; the standard paraxial form is used, with the factor that is common to all modes omitted, and with both modes sharing waist and waist position. is taken as the real part of , which is real.
import Mathlib
/-!
McWilliam, Al Khafaji, Svensson, Pádua and Franke-Arnold, *Dynamic Mueller matrix polarimetry
using generalized measurements*, arXiv:2405.00432v1 (2024): the tetrahedral POVM states and the
ideal instrumentation matrix of Section 2.1, the pseudo-inverse reconstruction of Section 2.2, the
orthogonal calibration states of Section 3.2, the Laguerre-Gaussian Poincaré beam of Section 4, the
retarder Mueller matrices and retardance formulae of Sections 4.1 and 4.2.
-/
open Matrix
noncomputable section
namespace Arxiv2405_00432
/-- Eq. (2), Section 2.1: the coefficient `a = √(1/2 + 1/(2√3))`. -/
def coefA : ℝ := Real.sqrt (1 / 2 + 1 / (2 * Real.sqrt 3))
/-- Eq. (2), Section 2.1: the coefficient `b = √(1/2 - 1/(2√3))`. -/
def coefB : ℝ := Real.sqrt (1 / 2 - 1 / (2 * Real.sqrt 3))
/-- Section 2.1: a polarization state `E_h |h⟩ + E_v |v⟩`, stored as its coordinates
`(E_h, E_v)` in the horizontal/vertical basis. -/
abbrev Jones := Fin 2 → ℂ
/-- Eq. (1), Section 2.1: the four tetrahedral POVM states
`|φ₁⟩ = a|h⟩ + b|v⟩`, `|φ₂⟩ = a|h⟩ - b|v⟩`, `|φ₃⟩ = b|h⟩ + i a|v⟩`, `|φ₄⟩ = b|h⟩ - i a|v⟩`
(index `i : Fin 4` is the paper's `i + 1`). -/
def povmState : Fin 4 → Jones :=
![![(coefA : ℂ), (coefB : ℂ)], ![(coefA : ℂ), -(coefB : ℂ)],
![(coefB : ℂ), Complex.I * (coefA : ℂ)], ![(coefB : ℂ), -(Complex.I * (coefA : ℂ))]]
/-- Eq. (8), Section 3.2: the calibration states orthogonal to the POVM states,
`|φ̄₁⟩ = b|h⟩ - a|v⟩`, `|φ̄₂⟩ = b|h⟩ + a|v⟩`, `|φ̄₃⟩ = a|h⟩ - i b|v⟩`, `|φ̄₄⟩ = a|h⟩ + i b|v⟩`. -/
def orthState : Fin 4 → Jones :=
![![(coefB : ℂ), -(coefA : ℂ)], ![(coefB : ℂ), (coefA : ℂ)],
![(coefA : ℂ), -(Complex.I * (coefB : ℂ))], ![(coefA : ℂ), Complex.I * (coefB : ℂ)]]
/-- Section 2.1: the POVM operator `π̂_i = (1/d)|φ_i⟩⟨φ_i|` with `d = 2`. -/
def povmOp (i : Fin 4) : Matrix (Fin 2) (Fin 2) ℂ :=
(1 / 2 : ℂ) • Matrix.vecMulVec (povmState i) (star (povmState i))
/-- Section 2.1: the outcome probability (intensity) `P_i = ⟨ψ|π̂_i|ψ⟩` for a probe state `ψ`
(a real number; its real part is taken). -/
def outcomeProb (i : Fin 4) (ψ : Jones) : ℝ :=
(star ψ ⬝ᵥ (povmOp i *ᵥ ψ)).re
/-- Section 2.1: the Stokes vector `(S₀, S₁, S₂, S₃)` of `E_h|h⟩ + E_v|v⟩`:
`S₀ = |E_h|² + |E_v|²`, `S₁ = |E_h|² - |E_v|²`, `S₂ = 2 Re(E_h* E_v)`, `S₃ = 2 Im(E_h E_v*)`.
The sign of `S₃` is not stated in the paper; it is the one for which the rows of eq. (4) are the
Stokes vectors of the states of eq. (1), as the paper says they are. -/
def stokes (ψ : Jones) : Fin 4 → ℝ :=
![Complex.normSq (ψ 0) + Complex.normSq (ψ 1), Complex.normSq (ψ 0) - Complex.normSq (ψ 1),
2 * (starRingEnd ℂ (ψ 0) * ψ 1).re, 2 * (ψ 0 * starRingEnd ℂ (ψ 1)).im]
/-- Section 2.1: the normalized Stokes vector `S^(N) = (S₀, S₁, S₂, S₃) / S₀`. -/
def normStokes (ψ : Jones) : Fin 4 → ℝ :=
fun j => stokes ψ j / stokes ψ 0
/-- Section 2.1: the normalized intensity four-vector `I^(N) = (I₁, I₂, I₃, I₄) / ∑ᵢ Iᵢ`, with
the intensity `I_i` of outcome `i` equal to `P_i`. -/
def normIntensity (ψ : Jones) : Fin 4 → ℝ :=
fun i => outcomeProb i ψ / ∑ j, outcomeProb j ψ
/-- Eq. (4), Section 2.1: the instrumentation matrix of an ideal setup. -/
def instrMatrix : Matrix (Fin 4) (Fin 4) ℝ :=
(1 / 4 : ℝ) • !![1, Real.sqrt (1 / 3), Real.sqrt (2 / 3), 0;
1, Real.sqrt (1 / 3), -Real.sqrt (2 / 3), 0;
1, -Real.sqrt (1 / 3), 0, -Real.sqrt (2 / 3);
1, -Real.sqrt (1 / 3), 0, Real.sqrt (2 / 3)]
/-- Eq. (6), Section 2.2: the right Moore-Penrose pseudo-inverse
`(𝒮_in)† = 𝒮_inᵀ [𝒮_in 𝒮_inᵀ]⁻¹` of a `4 × N` matrix of Stokes vectors (one column per pixel).
Statements use it only where `𝒮_in 𝒮_inᵀ` is invertible. -/
def rightPseudoInv {N : ℕ} (S : Matrix (Fin 4) (Fin N) ℝ) : Matrix (Fin N) (Fin 4) ℝ :=
Sᵀ * (S * Sᵀ)⁻¹
/-- Section 2.2, last sentence: the beam profile (the columns of the `4 × N` Stokes matrix `S`)
contains 4 linearly independent polarization states. -/
def HasFourIndependentStates {N : ℕ} (S : Matrix (Fin 4) (Fin N) ℝ) : Prop :=
∃ c : Fin 4 → Fin N, LinearIndependent ℝ (fun k : Fin 4 => fun i : Fin 4 => S i (c k))
/-- Eq. (11), Section 4.1: the Mueller matrix `M_T(δ, θ)` of a retarder with retardance `δ` and
fast axis at angle `θ` to the horizontal. -/
def retarderMueller (δ θ : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
!![1, 0, 0, 0;
0, Real.cos (2 * θ) ^ 2 + Real.sin (2 * θ) ^ 2 * Real.cos δ,
Real.cos (2 * θ) * Real.sin (2 * θ) * (1 - Real.cos δ), Real.sin (2 * θ) * Real.sin δ;
0, Real.cos (2 * θ) * Real.sin (2 * θ) * (1 - Real.cos δ),
Real.cos (2 * θ) ^ 2 * Real.cos δ + Real.sin (2 * θ) ^ 2, -(Real.cos (2 * θ) * Real.sin δ);
0, -(Real.sin (2 * θ) * Real.sin δ), Real.cos (2 * θ) * Real.sin δ, Real.cos δ]
/-- Eq. (14), Section 4.2: the four retardance values computed from a Mueller matrix `m`,
`δ₁ = tan⁻¹(-m₃₄/m₃₃)`, `δ₂ = tan⁻¹(-m₃₄/m₄₄)`, `δ₃ = tan⁻¹(m₄₃/m₃₃)`, `δ₄ = tan⁻¹(m₄₃/m₄₄)`,
with `tan⁻¹` the real arctangent and the paper's 1-based indices (Lean index `k` is `δ_{k+1}`). -/
def retardanceEst (m : Matrix (Fin 4) (Fin 4) ℝ) : Fin 4 → ℝ :=
![Real.arctan (-(m 2 3) / m 2 2), Real.arctan (-(m 2 3) / m 3 3),
Real.arctan (m 3 2 / m 2 2), Real.arctan (m 3 2 / m 3 3)]
/-- Eq. (15), Section 4.2: the theoretical retardance `δ_T(θ, α)` of a multi-order waveplate of
thickness `T` at vacuum wavelength `λ` (`lam`), with ordinary and extraordinary indices `n_o`,
`n_e`, fast axis at angle `θ` and angle of incidence `α`. -/
def theoryRetardance (T lam no ne θ α : ℝ) : ℝ :=
2 * Real.pi * T / lam *
(Real.sqrt (ne ^ 2 - (ne ^ 2 * Real.cos θ ^ 2 + no ^ 2 * Real.sin θ ^ 2) / no ^ 2 *
Real.sin α ^ 2) -
Real.sqrt (no ^ 2 - Real.sin α ^ 2))
/-- Section 4, eq. (10): the generalized Laguerre polynomial
`L_p^α(x) = ∑_{i=0}^{p} (-1)^i C(p+α, p-i) xⁱ / i!` that enters the mode `LG_p^ℓ` (with `α = |ℓ|`). -/
def genLaguerre (p α : ℕ) (x : ℝ) : ℝ :=
∑ i ∈ Finset.range (p + 1),
(-1 : ℝ) ^ i * ((p + α).choose (p - i) : ℝ) * x ^ i / (i.factorial : ℝ)
/-- Section 4: the mode order `N = 2p + |ℓ|` of `LG_p^ℓ`. -/
def modeOrder (p : ℕ) (ℓ : ℤ) : ℕ := 2 * p + ℓ.natAbs
/-- Section 4: the Rayleigh range `z_R = π w₀² / λ` of a Gaussian beam of waist `w₀` (waist at
`z = 0`) and wavelength `λ`. -/
def rayleighRange (w0 lam : ℝ) : ℝ := Real.pi * w0 ^ 2 / lam
/-- Section 4: the beam radius `w(z) = w₀ √(1 + (z/z_R)²)`. -/
def beamWidth (w0 lam z : ℝ) : ℝ := w0 * Real.sqrt (1 + (z / rayleighRange w0 lam) ^ 2)
/-- Section 4, after eq. (10): the Gouy phase `(N + 1) arctan(z / z_R)` of `LG_p^ℓ`. -/
def gouyPhase (p : ℕ) (ℓ : ℤ) (w0 lam z : ℝ) : ℝ :=
((modeOrder p ℓ : ℝ) + 1) * Real.arctan (z / rayleighRange w0 lam)
/-- Section 4, eq. (10): the paraxial Laguerre-Gaussian mode `LG_p^ℓ` with waist `w₀` at `z = 0`
and wavelength `λ`, at polar coordinates `(r, φ)` in the plane `z`:
`C/w (√2 r/w)^{|ℓ|} L_p^{|ℓ|}(2r²/w²) e^{-r²/w²} e^{-i k r² z/(2(z² + z_R²))} e^{iℓφ} e^{i(N+1)ζ(z)}`,
with `k = 2π/λ`, `C = √(2 p! / (π (p+|ℓ|)!))`, `ζ(z) = arctan(z/z_R)` and the common factor `e^{-ikz}`
omitted. -/
def lgMode (p : ℕ) (ℓ : ℤ) (w0 lam r φ z : ℝ) : ℂ :=
((Real.sqrt (2 * (p.factorial : ℝ) / (Real.pi * ((p + ℓ.natAbs).factorial : ℝ))) /
beamWidth w0 lam z *
(Real.sqrt 2 * r / beamWidth w0 lam z) ^ ℓ.natAbs *
genLaguerre p ℓ.natAbs (2 * r ^ 2 / beamWidth w0 lam z ^ 2) *
Real.exp (-(r ^ 2 / beamWidth w0 lam z ^ 2)) : ℝ) : ℂ) *
Complex.exp (-(Complex.I * ((2 * Real.pi / lam * r ^ 2 * z /
(2 * (z ^ 2 + rayleighRange w0 lam ^ 2)) : ℝ) : ℂ))) *
Complex.exp (Complex.I * ((ℓ * φ : ℝ) : ℂ)) *
Complex.exp (Complex.I * ((gouyPhase p ℓ w0 lam z : ℝ) : ℂ))
/-- Eq. (10), Section 4: the Poincaré probe beam `|Ψ⟩ = LG₁⁰|h⟩ + LG₀²|v⟩` at `(r, φ, z)`, both
modes having the same waist `w₀` at `z = 0` and the same wavelength `λ`. -/
def poincareBeam (w0 lam r φ z : ℝ) : Jones :=
![lgMode 1 0 w0 lam r φ z, lgMode 0 2 w0 lam r φ z]
end Arxiv2405_00432
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
coefA: the real number
The radicand is positive, so this is the ordinary positive square root.
coefB: the real number
Since , the radicand is positive. No truncation to occurs.
Jones: a "polarization state" is simply an arbitrary pair , indexed by (horizontal) and (vertical). No normalization is imposed, and the zero vector is allowed.
povmState: four fixed vectors in , indexed by , with as above:
orthState: four fixed vectors in , indexed by :
The definition itself asserts no orthogonality property.
povmOp: for , the complex matrix
outcomeProb: for and any (not necessarily normalized, possibly zero), the real number
The real part is taken explicitly. No normalization by is applied.
stokes: for any , the real 4-vector , indexed –, with
Note that the conjugate sits on in but on in . Thus .
normStokes: for , the real 4-vector with entries
- If , the first entry is .
- If (i.e. ), division by zero is taken to give , so every entry is .
normIntensity: for , the real 4-vector with entries
where is as in outcomeProb. If the denominator is (e.g. ), every entry is by the division-by-zero convention.
instrMatrix: the fixed real matrix
It is given by explicit numerical entries, not computed from the states or from stokes.
rightPseudoInv: for any natural number and any real matrix , the real matrix
Here is a total matrix inverse: if is singular, its "inverse" is the zero matrix, and then is the zero matrix. This happens in particular whenever , including . No invertibility hypothesis is part of the definition.
HasFourIndependentStates: for and a real matrix , this is the proposition that there exist column indices such that the four columns are linearly independent in .
- The indices are not required to be distinct a priori, though linear independence forces them to be.
- The condition is equivalent to having rank , and it is false whenever .
- Nothing requires the columns to be Stokes vectors of actual states.
retarderMueller: for arbitrary real , writing and , the real matrix
retardanceEst: for any real matrix , using 1-based entries with , the real 4-vector (indexed –)
- is the one-argument real arctangent, with values in , not a two-argument quadrant-aware version.
- If a denominator is , the quotient is and the corresponding value is .
theoryRetardance: for arbitrary real (no positivity or other hypotheses), the real number
Here enters as , not . Junk-value conventions apply:
- the square root of a negative number is ;
- gives ;
- makes the fraction , so the first root becomes .
genLaguerre: for natural numbers and real ,
Here ranges only over natural numbers, and throughout the sum.
modeOrder: for and , the natural number
rayleighRange: for real ,
If , then .
beamWidth: for real ,
with as above.
- If , then is and .
- No sign condition is placed on , so may be negative or zero.
gouyPhase: for , and real , the real number
with when .
lgMode: for , and arbitrary real (with not required to be nonnegative), the complex number
where:
- ;
- is
beamWidth; - is
rayleighRange.
The real prefactor may be negative, and no factor is included. Junk-value conventions apply:
- if , all divisions by give , so the mode is (for , the power , but the factor is still );
- if , the curvature phase is .
poincareBeam: for real , the pair
both modes evaluated at the same . Unfolding, with , and :
Both components have mode order , so they share the same Gouy factor . The pair is not normalized.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.