Transmission-matrix model, output intensity and its segment terms
DefinitionArxiv2011_11825_BasicObjects of Section 2 and Supplement S1 of Guo, Zhang, Li and Pang (2020), on the transmission matrix (TM) of a scattering medium.
- Transmission model (eq. 1). There are input modes (modulator pixels), with complex input field , and a complex transmission matrix whose rows are indexed by the output modes . The field at output mode is
- Transmitted modes. The contribution of input mode to output mode is .
- Segments. The input modes are divided into disjoint segments covering all modes. This is encoded by a map with .
- Intensity (eq. 2). .
- Terms of eq. (3). For segments and , with the inner product of two phasors :
- the self terms ;
- the interference inside , ;
- the interference between and , ;
- the bracket of segment , .
Formalization Note The paper prints the terms as and and calls them "inner products" of the modulated modes and "intensity contributions" (Sec. 2, pp. 2-3). They are therefore read as inner products of phasors: the square of is and . With this reading the paper's whole printed chain holds. Read instead as complex multiplication, the link would be false and the terms would not be intensity contributions. The paper's sum limits are read as sums over the modes of . The input modes are indexed by and the segments by , so correspond to the indices .
import Mathlib
/-!
Guo, Zhang, Li and Pang, *Sequential Transmission Matrix Evaluation Via Spatiotemporal
Transmitted Modes Decomposition*, arXiv:2011.11825v1 (2020): the transmission-matrix model of
Section 2 (eqs. (1)-(3)) and of Supplement S1 (eq. (S1)). The input plane carries `N` complex
input modes, the medium is a complex transmission matrix `t` (rows: output modes, columns: input
modes), and the input modes are divided into `k` disjoint segments `Q_1, ..., Q_k`, encoded by
the map `seg` sending each input mode to the index of its segment.
-/
noncomputable section
namespace Arxiv2011_11825
variable {M N k : ℕ}
/-- Section 2, eq. (1), PDF p. 2: the field at output mode `m`,
`E_m^out = ∑_{i=1}^N t_{mi} E_i^in`, for a complex transmission matrix `t` and complex input
field `E`. -/
def outField (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) : ℂ :=
∑ i, t m i * E i
/-- Section 2, eq. (2), PDF p. 2: the contribution `t_{mi} E_i^in` of input mode `i` to the field
at output mode `m` (the transmitted mode). -/
def amp (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (i : Fin N) : ℂ :=
t m i * E i
/-- Section 2, eq. (2), PDF p. 2: the intensity `I_m^out = |E_m^out|^2` of output mode `m`. -/
def outIntensity (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) : ℝ :=
Complex.normSq (outField t E m)
/-- Section 2, eq. (3), PDF p. 3, first term of each bracket: `∑_{i ∈ Q_p} (t_{mi} E_i^in)^2`,
the intensity contribution of each mode of segment `Q_p`. The paper calls these terms "inner
products of the modulated input modes themselves" (p. 2), so the square of the phasor `a_i` is
read as its squared modulus `|a_i|^2`. -/
def selfTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
(p : Fin k) : ℝ :=
∑ i ∈ Finset.univ.filter (fun i => seg i = p), Complex.normSq (amp t E m i)
/-- Section 2, eq. (3), PDF p. 3, second term of each bracket:
`∑_{i ∈ Q_p} ∑_{j ∈ Q_p, j ≠ i} t_{mi} E_i^in · t_{mj} E_j^in`, the interference between distinct
modes inside segment `Q_p`. The product `a_i · a_j` of two phasors is read as their inner product
in `ℝ^2`, `Re (a_i * conj a_j)`. -/
def intraTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
(p : Fin k) : ℝ :=
∑ i ∈ Finset.univ.filter (fun i => seg i = p),
∑ j ∈ Finset.univ.filter (fun j => seg j = p ∧ j ≠ i),
(amp t E m i * (starRingEnd ℂ) (amp t E m j)).re
/-- Section 2, eq. (3), PDF p. 3, remaining terms of each bracket:
`∑_{i ∈ Q_p} ∑_{j ∈ Q_q} t_{mi} E_i^in · t_{mj} E_j^in`, the interference between the modes of
segment `Q_p` and those of segment `Q_q`, with `a_i · a_j` the phasor inner product
`Re (a_i * conj a_j)`. -/
def crossTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
(p q : Fin k) : ℝ :=
∑ i ∈ Finset.univ.filter (fun i => seg i = p),
∑ j ∈ Finset.univ.filter (fun j => seg j = q),
(amp t E m i * (starRingEnd ℂ) (amp t E m j)).re
/-- Section 2, eq. (3.p), PDF p. 3: the square bracket of segment `Q_p`, i.e. the self terms of
`Q_p`, the interference inside `Q_p`, and the interference of `Q_p` with every other segment
`Q_q`, `q ≠ p`. -/
def segBracket (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
(p : Fin k) : ℝ :=
selfTerm t E m seg p + intraTerm t E m seg p +
∑ q ∈ Finset.univ.filter (fun q => q ≠ p), crossTerm t E m seg p q
end Arxiv2011_11825
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Throughout, , , are arbitrary natural numbers, and any of them may be . Output modes are indexed by and input modes by . The transmission matrix is an arbitrary matrix with complex entries . The input field is an arbitrary function assigning a complex number to each input mode. The segment map is an arbitrary function from input modes to segment labels .
For a label , write
No condition is placed on . A segment may be empty, and nothing forces the segments to be nonempty or of any particular size. The sets are automatically pairwise disjoint and cover all input modes, since is a function. If , such a map exists only when , and then no label exists at all.
Output field . For an output mode , this is the complex number
When the sum is empty and the value is .
Amplitude . For an output mode and an input mode , this is the complex number
the plain product of the matrix entry and the input value. Its modulus is not taken.
Output intensity . This is the real number
the squared complex modulus of the output field. It equals when .
Self term . For an output mode and a segment label , this is the real number
This is a sum of squared moduli, not of complex squares . It equals when is empty.
Intra-segment term . This is the real number
Here is complex conjugation and is the real part. The sum runs over ordered pairs of distinct modes in , so each unordered pair contributes twice, once as and once as . The sum is when has fewer than two elements.
Cross term . For two segment labels and , this is the real number
The sum runs over all ordered pairs with and . The definition does not require . If , the diagonal pairs are included and contribute . The value is if either segment is empty.
Segment bracket . For an output mode and a segment label , this is the real number
Written out in full, it is
Only cross terms with as the first index appear, ranging over every other label , including labels whose segment is empty. If is empty, then . These definitions only assign values. No relation between and , such as a sum over , is stated.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.