Transmission matrix, observed transmission matrix and reference-amplitude estimate
DefinitionArxiv1904_10695_BasicObjects of Section 1 (pp. 2-3) of Hofer and Brasselet (2019).
- Transmission matrix. A transmission matrix is a complex array , where indexes the SLM input pixels (or input bases) and the camera output pixels, so that .
- Observed transmission matrix. For an output reference field , the measured elements are .
- Average over inputs. For real numbers , . For a matrix , the amplitude average at output pixel is .
- Normalisation by the maximum. For real numbers , the normalised profile is .
Formalization Note Indices run over and . The maximum is written as a supremum over the finite set of output pixels. Lean defines division by zero as . Where the statement normalises by a maximum, its hypotheses ( and ) make that maximum positive, so no conclusion rests on dividing by zero.
import Mathlib
/-!
Hofer and Brasselet, *Manipulating the transmission matrix of scattering media for nonlinear
imaging beyond the memory effect*, arXiv:1904.10695v1 (2019), Section 1 ("Introduction"),
pp. 2-3: the transmission matrix, the observed (reference-weighted) transmission matrix, the
average over input modes and the reference-amplitude estimate of eq. (2) with its normalisation
by the maximum.
-/
noncomputable section
namespace Arxiv1904_10695
/-- Section 1, p. 2: a transmission matrix `t_{mn}` from SLM input pixel (or basis element)
`m ∈ {1,…,M}` to camera output pixel `n ∈ {1,…,N}`, with complex entries, so that
`E_{out,n} = ∑_m t_{mn} E_{in,m}`. -/
abbrev TransmissionMatrix (M N : ℕ) : Type := Fin M → Fin N → ℂ
/-- Section 1, p. 3 (text before eq. (2)): the measured transmission-matrix elements
`t_{obs,mn} = t_{mn} E_{ref,n}`, the true elements weighted by the output reference field
`E_{ref,n}` at camera pixel `n`. -/
def obsTM {M N : ℕ} (t : TransmissionMatrix M N) (Eref : Fin N → ℂ) : TransmissionMatrix M N :=
fun m n => t m n * Eref n
/-- Section 1, eq. (2), p. 3: the average `⟨a_m⟩_m = (1/M) ∑_{m=1}^M a_m` over the `M` input
pixels or bases. -/
def inputAvg {M : ℕ} (a : Fin M → ℝ) : ℝ := (∑ m, a m) / M
/-- Section 1, eq. (2), p. 3: the amplitude average `⟨|T_{mn}|⟩_m` over input modes of a
(transmission) matrix `T`, as a function of the output pixel `n`; applied to `T = t_obs` it is
the left-hand side of eq. (2). -/
def ampAvg {M N : ℕ} (T : TransmissionMatrix M N) (n : Fin N) : ℝ :=
inputAvg (fun m => ‖T m n‖)
/-- Section 1, p. 3 (sentence after eq. (2)): "a normalization with its maximum value", i.e. the
profile `a_n / max_{n'} a_{n'}` of a nonnegative quantity `a` over the camera pixels. -/
def normalizeByMax {N : ℕ} (a : Fin N → ℝ) (n : Fin N) : ℝ := a n / ⨆ n', a n'
end Arxiv1904_10695
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Transmission matrix type. For natural numbers and , a transmission matrix of size is any function assigning a complex number to each pair , where ranges over (input indices) and ranges over (output indices). No other structure is imposed: there is no linearity, unitarity, normalisation or bound on the entries, and no relation between input and output fields is encoded in the type. and may be , in which case there are no entries.
Observed transmission matrix. Given , a transmission matrix of size , and an arbitrary complex vector , the observed matrix is the complex matrix with entries
Each column is multiplied by the same complex number . The vector is unconstrained, so it may contain zeros, which zero out the corresponding columns.
Input average. For and any real vector , the input average is
computed in the real numbers. When the sum is empty and the division is by zero, which under the convention gives the value .
Amplitude average. For , an complex matrix , and an output index , the amplitude average at is the input average of the complex moduli of column :
where is the usual complex absolute value. This value is always . When it equals for every by the division-by-zero convention. The definition applies to any matrix , and nothing in it specialises to an observed matrix.
Normalisation by the maximum. For , a real vector and an index , the normalised value is
Here is the supremum in of the finitely many values , which equals their maximum when . No nonnegativity or other hypothesis on is imposed, and the following cases are included:
- If , for example when all with at least one equal to , then every by the convention .
- If all are negative, then and the quotients may exceed or change sign relative to .
- When there are no indices, so the function has no values.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.