Feature fields, kernel constraints, nonlinearities and SO(2)/O(2) kernel bases of E(2)-steerable CNNs
DefinitionSteerableE2CNN_BasicObjects of Sections 2.1-2.6 and Appendices B, D and F of Weiler and Cesa (2019).
- Plane and symmetry groups. The plane is with Lebesgue measure. , and is any subgroup, acting on by matrix multiplication.
- Representations. A representation of a group on is a homomorphism . It is irreducible if and the only -invariant subspaces are and .
- Feature fields (eq. 1). A field of type transforms under by .
- Kernel constraint (eqs. 2, 3). A kernel satisfies the constraint for output and input matrices , if for all group elements and all . It is -steerable when ranges over and are representations of .
- Convolution (Appendix D.1). .
- Irrep blocks (Section 2.4). For irreps () of dimensions , a matrix indexed by and has blocks . The direct sum is the block-diagonal matrix.
- Nonlinearities (Section 2.6, Appendix D.2). . The norm nonlinearity is . The quotient representation of a finite group with subgroup acts on by . The regular representation of acts on by . The vector field nonlinearity is with .
- Rotations, reflections, polar coordinates (Appendix F.1). is the rotation matrix by and for . The element is the matrix , and .
- Irreps of SO(2) and O(2) (Appendix F.2). and for . for , and for .
- Angular kernel bases (Tables 8 and 2, Appendix F.4). For each pair of irreps there is a finite list of angular functions , each of one integer angular frequency :
- , : if ; if ; if ; if . Here and .
- , : if and , and nothing if and ; if ; if ; and if .
Formalization Note Points of the plane are vectors , and feature vectors are functions on a finite index type. The kernel constraint is one definition, parametrised by an index set of group elements and by the matrices of the action and of the two representations. For the group elements are the angles , and for they are the pairs . A label of an irrep carries the condition or . The basis for one-dimensional/two-dimensional pairs is the one derived in Appendix F.4.3, eqs. (37) and (38). In Tables 2 and 9 the trivial and sign-flip rows and columns of these cells are interchanged. At the norm nonlinearity takes the value , because Lean sets . argmax is a fixed choice among the maximisers.
import Mathlib
/-!
Weiler and Cesa, *General E(2)-Equivariant Steerable CNNs*, arXiv:1911.08251v2 (NeurIPS 2019):
feature fields and their induced transformation law (Section 2.2, eq. (1)), the kernel constraint
(Section 2.3, eq. (2)) and its irrep blocks (Section 2.4, eq. (3)), steerable convolutions
(Appendix D.1), the nonlinearities of Section 2.6 and Appendix D.2 (norm, pointwise on quotient
representations, vector field), and the real irreducible representations of SO(2) and O(2) with
the angular kernel bases derived in Appendix F (Section 2.5, Tables 2, 8, 9; eqs. (24)-(38)).
-/
open Matrix MeasureTheory
noncomputable section
namespace SteerableE2CNN
/-- Section 2.1: the plane `ℝ²`, written as coordinate vectors `Fin 2 → ℝ`, with Lebesgue
measure. -/
abbrev Plane : Type := Fin 2 → ℝ
/-- Section 2.1: the orthogonal group `O(2) = {O ∈ ℝ^{2×2} | OᵀO = id}`. -/
abbrev O2 : Type := ↥(Matrix.orthogonalGroup (Fin 2) ℝ)
/-- Section 2.1: the `2 × 2` matrix of an element `g` of a subgroup `G ≤ O(2)`, acting on the
plane by `x ↦ g x`. -/
def gMat {G : Subgroup O2} (g : G) : Matrix (Fin 2) (Fin 2) ℝ :=
((g : O2) : Matrix (Fin 2) (Fin 2) ℝ)
/-- Section 2.2 and Appendix B: a (real, finite-dimensional) group representation
`ρ : G → GL(ℝⁿ)`, a homomorphism into invertible matrices indexed by `n`. -/
abbrev MatRep (G : Type*) [Group G] (n : Type*) [Fintype n] [DecidableEq n] : Type _ :=
G →* Matrix.GeneralLinearGroup n ℝ
/-- The matrix `ρ(g)` of a representation. -/
def repMat {G : Type*} [Group G] {n : Type*} [Fintype n] [DecidableEq n] (ρ : MatRep G n)
(g : G) : Matrix n n ℝ :=
((ρ g : Matrix.GeneralLinearGroup n ℝ) : Matrix n n ℝ)
/-- Appendix B ("Irreducible representations"): `ρ` is irreducible if its representation space
is nonzero and has no invariant subspace other than `0` and the whole space. -/
def IsIrrep {G : Type*} [Group G] {n : Type*} [Fintype n] [DecidableEq n] (ρ : MatRep G n) :
Prop :=
Nonempty n ∧ ∀ W : Submodule ℝ (n → ℝ), (∀ g : G, ∀ v ∈ W, repMat ρ g *ᵥ v ∈ W) →
W = ⊥ ∨ W = ⊤
/-- Eqs. (2) and (3): the kernel constraint `κ(g x) = ρ_out(g) κ(x) ρ_in(g)⁻¹` for all group
elements `g` and all `x ∈ ℝ²`. The group elements are indexed by `Idx`, `act g` is the matrix by
which `g` acts on the plane, and `ρout g`, `ρin g` are the matrices of the output and input
representations. -/
def KernelConstraint {Idx : Type*} {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n]
[DecidableEq n] (act : Idx → Matrix (Fin 2) (Fin 2) ℝ) (ρout : Idx → Matrix m m ℝ)
(ρin : Idx → Matrix n n ℝ) (κ : Plane → Matrix m n ℝ) : Prop :=
∀ (g : Idx) (x : Plane), κ (act g *ᵥ x) = ρout g * κ x * (ρin g)⁻¹
/-- Section 2.3, eq. (2): `k : ℝ² → ℝ^{c_out × c_in}` is a `G`-steerable kernel for the input and
output field types `ρin`, `ρout` of a subgroup `G ≤ O(2)`. -/
def IsSteerable (G : Subgroup O2) {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n]
[DecidableEq n] (ρin : MatRep G n) (ρout : MatRep G m) (k : Plane → Matrix m n ℝ) : Prop :=
KernelConstraint (fun g : G => gMat g) (repMat ρout) (repMat ρin) k
/-- Section 2.2, eq. (1): the induced representation `Ind_G^{(ℝ²,+)⋊G} ρ` acting on a feature field
`f : ℝ² → ℝ^c` of type `ρ`: `([Ind ρ](t g) f)(x) = ρ(g) f(g⁻¹(x - t))`. -/
def indAct (G : Subgroup O2) {n : Type*} [Fintype n] [DecidableEq n] (ρ : MatRep G n)
(t : Plane) (g : G) (f : Plane → n → ℝ) : Plane → n → ℝ :=
fun x => repMat ρ g *ᵥ f (gMat g⁻¹ *ᵥ (x - t))
/-- Appendix D.1: the convolution (correlation) of a feature field with a kernel,
`(k ⋆ f)(x) = ∫_{ℝ²} k(y) f(x + y) dy`. -/
def steerConv {m n : Type*} [Fintype m] [Fintype n] (k : Plane → Matrix m n ℝ)
(f : Plane → n → ℝ) : Plane → m → ℝ :=
fun x => ∫ y, k y *ᵥ f (x + y)
/-- Section 2.4: the block `κ^{ij}` of a matrix `κ` written in the irrep bases, i.e. indexed by
`Σ i, Fin (dOut i)` (output irreps `i ∈ I_out` of dimensions `dOut i`) and `Σ j, Fin (dIn j)`. -/
def kernelBlock {Iout Iin : Type*} {dOut : Iout → ℕ} {dIn : Iin → ℕ}
(κ : Matrix (Σ i, Fin (dOut i)) (Σ j, Fin (dIn j)) ℝ) (i : Iout) (j : Iin) :
Matrix (Fin (dOut i)) (Fin (dIn j)) ℝ :=
Matrix.of fun a b => κ ⟨i, a⟩ ⟨j, b⟩
/-- Section 2.6 and Appendix D.2.2: the Euclidean norm `|v|` of a feature vector. -/
def eNorm {n : Type*} [Fintype n] (v : n → ℝ) : ℝ := Real.sqrt (∑ i, v i ^ 2)
/-- Section 2.6 and Appendix D.2.2: the norm nonlinearity `σ_norm(v) = η(|v|) v / |v|`. (At
`v = 0` Lean's convention `a / 0 = 0` gives `σ_norm(0) = 0`; the paper leaves this value
undefined.) -/
def normNL {n : Type*} [Fintype n] (η : ℝ → ℝ) (v : n → ℝ) : n → ℝ :=
(η (eNorm v) / eNorm v) • v
open Classical in
/-- Section 2.6 and Appendix B: the quotient representation `ρ_quot^{G/H}` of a finite group `G`,
permuting the axes `e_{gH}` of `ℝ^{|G|/|H|}` by `ρ_quot(g̃) e_{gH} = e_{g̃gH}`. -/
def quotRep {G : Type*} [Group G] (H : Subgroup G) (g : G) : Matrix (G ⧸ H) (G ⧸ H) ℝ :=
Matrix.of fun a b => if a = g • b then 1 else 0
/-- Appendix D.2.4: the regular representation of the cyclic group `C_N`, whose elements are the
rotations by `2πp/N`, `p ∈ ℤ/N`, acting on `ℝ^N` (axes `e_p`) by `ρ_reg(p̃) e_p = e_{p̃ + p}`. -/
def regRepCN (N : ℕ) (p : ZMod N) : Matrix (ZMod N) (ZMod N) ℝ :=
Matrix.of fun q q' => if q = p + q' then 1 else 0
/-- Appendix D.2.4: an index `argmax f` of a maximal entry of `f ∈ ℝ^N` (a fixed choice among the
maximisers). -/
def vfArgmax (N : ℕ) [NeZero N] (v : ZMod N → ℝ) : ZMod N :=
Classical.choose (Finset.exists_max_image Finset.univ v Finset.univ_nonempty)
/-- Appendix D.2.4: the vector field nonlinearity
`σ_vec(f) = max(f) (cos θ, sin θ)ᵀ` with `θ = 2π argmax(f) / N`. -/
def vecFieldNL (N : ℕ) [NeZero N] (v : ZMod N → ℝ) : Plane :=
(Finset.univ.sup' Finset.univ_nonempty v) •
![Real.cos (2 * Real.pi * ((vfArgmax N v).val : ℝ) / N),
Real.sin (2 * Real.pi * ((vfArgmax N v).val : ℝ) / N)]
/-- Appendix F.1: the rotation matrix `ψ(θ)`. -/
def rotMat (θ : ℝ) : Matrix (Fin 2) (Fin 2) ℝ :=
!![Real.cos θ, -Real.sin θ; Real.sin θ, Real.cos θ]
/-- Appendix F.1: the matrix `ξ(s) = diag(1, s)`, `s ∈ ({±1}, *)`; `ξ(-1)` is the reflection along
the horizontal axis. -/
def flipMat (s : ℤˣ) : Matrix (Fin 2) (Fin 2) ℝ :=
!![1, 0; 0, ((s : ℤ) : ℝ)]
/-- Appendix F.1: the matrix `ψ(θ) ξ(s)` of the element `g = r_θ s` of `O(2)`; it acts on polar
coordinates by `g.x(r, φ) = x(r, sφ + θ)`. Every element of `O(2)` is of this form. -/
def o2Elem (θ : ℝ) (s : ℤˣ) : Matrix (Fin 2) (Fin 2) ℝ := rotMat θ * flipMat s
/-- Section 2.5 and Appendix F.1: the point `x(r, φ) = (r cos φ, r sin φ)` with polar
coordinates `(r, φ)`. -/
def polar (r φ : ℝ) : Plane := ![r * Real.cos φ, r * Real.sin φ]
/-- Appendix F.2: the dimension of the real irrep `ψ_k` of `SO(2)` of frequency `k ∈ ℕ`
(`1` for `k = 0`, `2` otherwise). -/
def so2Dim : ℕ → ℕ
| 0 => 1
| _ + 1 => 2
/-- Appendix F.2: the real irreps of `SO(2)` evaluated at the rotation `r_θ`:
`ψ_0(r_θ) = 1` and `ψ_k(r_θ) = ψ(kθ)` for `k ≥ 1`. -/
def so2Irrep : (k : ℕ) → ℝ → Matrix (Fin (so2Dim k)) (Fin (so2Dim k)) ℝ
| 0 => fun _ => 1
| k + 1 => fun θ => rotMat (((k + 1 : ℕ) : ℝ) * θ)
/-- Table 8: the number of angular basis elements of `SO(2)`-steerable kernels from `ψ_n` to
`ψ_m`. -/
def so2BasisCard : ℕ → ℕ → ℕ
| 0, 0 => 1
| 0, _ + 1 => 2
| _ + 1, 0 => 2
| _ + 1, _ + 1 => 4
/-- Table 8 and eqs. (24), (26), (28), (29): the angular basis of `SO(2)`-steerable kernels
`κ : ℝ² → ℝ^{dim ψ_m × dim ψ_n}` for input irrep `ψ_n` and output irrep `ψ_m`:
* `m = n = 0`: `[1]` (eq. (26));
* `m = 0 < n`: `[cos(nφ + γ), sin(nφ + γ)]`, `γ ∈ {0, π/2}` (eq. (29));
* `n = 0 < m`: `[cos(mφ + γ); sin(mφ + γ)]`, `γ ∈ {0, π/2}` (eq. (28));
* `m, n > 0`: `ψ(μφ + γ) ξ(s)` with `μ = m - sn`, `γ ∈ {0, π/2}`, `s ∈ {±1}` (eq. (24)); the index
`b ∈ {0,1,2,3}` encodes `γ = (b mod 2) π/2` and `s = 1` for `b < 2`, `s = -1` otherwise. -/
def so2Basis : (m n : ℕ) → Fin (so2BasisCard m n) → ℝ →
Matrix (Fin (so2Dim m)) (Fin (so2Dim n)) ℝ
| 0, 0 => fun _ _ => 1
| 0, n + 1 => fun b φ =>
!![Real.cos (((n + 1 : ℕ) : ℝ) * φ + ((b : ℕ) : ℝ) * (Real.pi / 2)),
Real.sin (((n + 1 : ℕ) : ℝ) * φ + ((b : ℕ) : ℝ) * (Real.pi / 2))]
| m + 1, 0 => fun b φ =>
!![Real.cos (((m + 1 : ℕ) : ℝ) * φ + ((b : ℕ) : ℝ) * (Real.pi / 2));
Real.sin (((m + 1 : ℕ) : ℝ) * φ + ((b : ℕ) : ℝ) * (Real.pi / 2))]
| m + 1, n + 1 => fun b φ =>
rotMat ((((m + 1 : ℕ) : ℝ) - (if (b : ℕ) < 2 then 1 else -1) * ((n + 1 : ℕ) : ℝ)) * φ
+ (((b : ℕ) % 2 : ℕ) : ℝ) * (Real.pi / 2)) *
flipMat (if (b : ℕ) < 2 then 1 else -1)
/-- Table 8: the angular frequency `μ` of each basis element of `so2Basis m n`. -/
def so2BasisFreq : (m n : ℕ) → Fin (so2BasisCard m n) → ℤ
| 0, 0 => fun _ => 0
| 0, n + 1 => fun _ => (n + 1 : ℕ)
| m + 1, 0 => fun _ => (m + 1 : ℕ)
| m + 1, n + 1 => fun b =>
((m + 1 : ℕ) : ℤ) - (if (b : ℕ) < 2 then 1 else -1) * ((n + 1 : ℕ) : ℤ)
/-- Appendix F.2: a label `(i, k)` of a real irrep `ψ_{i,k}` of `O(2)`: `ψ_{0,0}` (trivial),
`ψ_{1,0}` (sign of the reflection) and `ψ_{1,k}`, `k ≥ 1` (frequency `k`). -/
structure O2IrrepLabel where
/-- the index `i ∈ {0, 1}` -/
i : Fin 2
/-- the frequency `k ∈ ℕ` -/
k : ℕ
/-- `ψ_{0,k}` is an irrep only for `k = 0` -/
valid : k = 0 ∨ i = 1
/-- Appendix F.2: the dimension of `ψ_{i,k}` (`1` for `k = 0`, `2` otherwise). -/
def o2Dim (l : O2IrrepLabel) : ℕ :=
match l.k with
| 0 => 1
| _ + 1 => 2
/-- Appendix F.2: the real irreps of `O(2)` evaluated at `g = r_θ s`:
`ψ_{i,0}(r_θ s) = s^i` and `ψ_{1,k}(r_θ s) = ψ(kθ) ξ(s)` for `k ≥ 1`. -/
def o2Irrep : (l : O2IrrepLabel) → ℝ → ℤˣ → Matrix (Fin (o2Dim l)) (Fin (o2Dim l)) ℝ
| ⟨i, 0, _⟩ => fun _ s => !![((s : ℤ) : ℝ) ^ (i : ℕ)]
| ⟨_, k + 1, _⟩ => fun θ s => rotMat (((k + 1 : ℕ) : ℝ) * θ) * flipMat s
/-- Table 2 / Table 9 (as derived in eqs. (34), (35), (37), (38)): the number of angular basis
elements of `O(2)`-steerable kernels from `ψ_{j,n}` to `ψ_{i,m}`. -/
def o2BasisCard (l l' : O2IrrepLabel) : ℕ :=
match l.k, l'.k with
| 0, 0 => if l.i = l'.i then 1 else 0
| 0, _ + 1 => 1
| _ + 1, 0 => 1
| _ + 1, _ + 1 => 2
/-- Section 2.5, Table 2, and Appendix F.4.3, eqs. (34), (35), (37), (38): the angular basis of
`O(2)`-steerable kernels for input irrep `ψ_{j,n}` and output irrep `ψ_{i,m}`, as derived in
Appendix F.4.3:
* `m = n = 0`: `[1]` if `i = j`, no element otherwise (eq. (35));
* `m = 0 < n`: `[cos(nφ + iπ/2), sin(nφ + iπ/2)]` (eq. (38));
* `n = 0 < m`: `[cos(mφ + jπ/2); sin(mφ + jπ/2)]` (eq. (37));
* `m, n > 0`: `ψ(μφ) ξ(s)` with `μ = m - sn`, `s ∈ {±1}`, i.e. `ψ((m-n)φ)` and `ψ((m+n)φ) ξ(-1)`
(eq. (34)). -/
def o2Basis : (l l' : O2IrrepLabel) → Fin (o2BasisCard l l') → ℝ →
Matrix (Fin (o2Dim l)) (Fin (o2Dim l')) ℝ
| ⟨_, 0, _⟩, ⟨_, 0, _⟩ => fun _ _ => !![(1 : ℝ)]
| ⟨i, 0, _⟩, ⟨_, n + 1, _⟩ => fun _ φ =>
!![Real.cos (((n + 1 : ℕ) : ℝ) * φ + ((i : ℕ) : ℝ) * (Real.pi / 2)),
Real.sin (((n + 1 : ℕ) : ℝ) * φ + ((i : ℕ) : ℝ) * (Real.pi / 2))]
| ⟨_, m + 1, _⟩, ⟨j, 0, _⟩ => fun _ φ =>
!![Real.cos (((m + 1 : ℕ) : ℝ) * φ + ((j : ℕ) : ℝ) * (Real.pi / 2));
Real.sin (((m + 1 : ℕ) : ℝ) * φ + ((j : ℕ) : ℝ) * (Real.pi / 2))]
| ⟨_, m + 1, _⟩, ⟨_, n + 1, _⟩ => fun b φ =>
rotMat ((((m + 1 : ℕ) : ℝ) - (if (b : ℕ) = 0 then 1 else -1) * ((n + 1 : ℕ) : ℝ)) * φ) *
flipMat (if (b : ℕ) = 0 then 1 else -1)
/-- Table 2: the angular frequency `μ` of each basis element of `o2Basis l l'`. -/
def o2BasisFreq : (l l' : O2IrrepLabel) → Fin (o2BasisCard l l') → ℤ
| ⟨_, 0, _⟩, ⟨_, 0, _⟩ => fun _ => 0
| ⟨_, 0, _⟩, ⟨_, n + 1, _⟩ => fun _ => (n + 1 : ℕ)
| ⟨_, m + 1, _⟩, ⟨_, 0, _⟩ => fun _ => (m + 1 : ℕ)
| ⟨_, m + 1, _⟩, ⟨_, n + 1, _⟩ => fun b =>
((m + 1 : ℕ) : ℤ) - (if (b : ℕ) = 0 then 1 else -1) * ((n + 1 : ℕ) : ℤ)
end SteerableE2CNN
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Plane. The plane is the set of real coordinate vectors , i.e. viewed as functions . It carries the standard product (Lebesgue) measure, which is used by every integral below.
O2. is the set of real matrices with
regarded as a group under matrix multiplication. Its elements are such matrices together with the proof that they are orthogonal.
gMat. For any subgroup and any , is simply the underlying real matrix of . Below it is written as the matrix itself, acting on the plane by .
MatRep. Let be any group and any finite index set with decidable equality. A "representation" of on is any group homomorphism
where is the group of invertible real matrices with rows and columns indexed by . No continuity is required. The index set may be empty, which gives the zero-dimensional representation.
repMat. For a representation and , is the underlying (invertible) real matrix of size .
IsIrrep. A representation is called irreducible exactly when both of the following hold:
- The index set is nonempty.
- Let be any real linear subspace with for all and all . Then or .
This is irreducibility over , not over .
KernelConstraint. The ingredients are:
- an arbitrary index type , which may be empty;
- finite index sets ;
- an arbitrary function assigning a real matrix to each ;
- arbitrary functions and assigning to each a real and matrix respectively;
- a function from to real matrices.
None of these functions is required to be a homomorphism, invertible, continuous or measurable. The constraint holds when, for every and every ,
Here is the matrix inverse, with the convention that a non-invertible matrix's "inverse" is the zero matrix. So if is singular, the right-hand side is . If is empty, the constraint holds vacuously.
IsSteerable. Let be a subgroup, and let and be representations. A function is -steerable when, for all and all ,
where is the product of the matrix of with . Because the are invertible, the inverse here is the genuine inverse. No regularity (continuity, measurability, integrability) of is required.
indAct. Let be a subgroup and a representation. Take a translation , an element , and an arbitrary function . Then is the function
Here is the inverse of in , applied to as a matrix. This only defines the output function; nothing asserts that it is a group action.
steerConv. Let be finite index sets, and . Then is
a vector-valued (Bochner) integral with respect to Lebesgue measure. It is a correlation: the argument is , not . If the integrand is not integrable as a function into , the value at that is defined to be the zero vector.
kernelBlock. Let and be arbitrary index types, with dimensions , . Let be a real matrix whose:
- rows are indexed by pairs with and ;
- columns are indexed by pairs with and .
The block is the matrix with entries
Dimensions may be , giving empty blocks.
eNorm. For with a finite index set,
This is when is empty.
normNL. For an arbitrary function and ,
Division by is taken to give . Hence for every , including those with .
quotRep. Let be any group (not required to be finite), any subgroup, and . Then is the real matrix with rows and columns indexed by the left cosets (possibly infinitely many). Its entries are
where . Equivalently, its column at is the basis vector . This is just a matrix-valued function of ; it is not packaged as a homomorphism.
regRepCN. For and , is the matrix indexed by with entries
so it maps to . For the index set is itself, which is infinite.
vfArgmax. For and , is some index with for all . When several indices attain the maximum, it is a fixed but unspecified one of them.
vecFieldNL. For and ,
Here is the representative of (the unspecified choice above). The maximum may be negative, in which case the output points in direction .
rotMat. For ,
flipMat. For (the units of ),
o2Elem. For and , this is the matrix . Only this product is defined; nothing in this definition asserts a statement about which elements of arise this way.
polar. For any real and (negative allowed),
so2Dim. For , this is if and if .
so2Irrep. For and :
- is the matrix ;
- for , , the rotation matrix.
It is a function of the real number , not of a group element, and nothing here asserts that it is a homomorphism or irreducible.
so2BasisCard. For (with the output label and the input label), the value is:
- if ;
- if exactly one of is ;
- if .
so2Basis. For , an index and , this is a real matrix of size , given case by case:
- : the constant matrix .
- , , : the row
- , , : the column
- , : set for and for , and . The basis element is
Here is a free real argument. Nothing in this definition asserts a link to polar coordinates or to steerability.
so2BasisFreq. For the same , this assigns an integer "frequency":
- if ;
- if ;
- if ;
- if , with as above. This is for and for .
O2IrrepLabel. A label is a pair with , , and or . The possible labels are therefore , , and for .
o2Dim. For a label , this is if and if .
o2Irrep. For a label , and :
- is the matrix , which is for and for ;
- for ,
It is a function of the pair . Nothing here asserts that it is a homomorphism or irreducible.
o2BasisCard. For an output label and an input label , the value is:
- if and ;
- if and ;
- if exactly one of is ;
- if .
o2Basis. For an output label , an input label , an index and , this is a real matrix of size , given case by case:
- : the matrix . When there is no index at all, so the basis is empty.
- : the single row
whose phase uses the output index .
- : the single column
whose phase uses the input index .
- , : set for and for . The basis element is , that is,
There is no phase offset in this last case. Nothing in this definition asserts a link to polar coordinates or to steerability.
o2BasisFreq. For the same labels and index, this assigns an integer frequency:
- if ;
- if ;
- if ;
- if . This is for and for .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.