The two-factor joint register: tensor states, partial operators, and the Born marginal #
Category: 1-Mathlib (CSD-free).
The product-index register EuclideanSpace ℂ (ι₁ × ι₂) over arbitrary finite factors, with the
four pieces every two-register algorithm argument consumes:
tensorState φ ψ— the product state, coordinateφ c * ψ y, with bilinearity (tensorState_smul_left/right,tensorState_sum_left/right) and|c⟩ ⊗ |y⟩ = |(c,y)⟩(tensorState_basis).matrixLeft M Φ— a matrix kernel acting on the first factor only (the shape of "the inverse QFT on the counting register"), linear (matrixLeft_smul/matrixLeft_sum), with the key reduction ★matrixLeft_tensorState: on a product state it acts on the first factor and leaves the second alone.sliceLeft Φ c— the second-register slice at first-register outcomec, the vector whose norm² is the marginal weight.probLeft Φ c— the Born marginal on the first register,∑_y ‖Φ (c, y)‖²; on a product state it is the product law (probLeft_tensorState), and — the load-bearing fact — ★★probLeft_sum_tensor_orthogonal: for a sum of product states whose second factors are pairwise orthogonal, the marginal is the mixture of the branch marginals, with every cross-term dead. This is the lemma that turns a multi-branch kickback state into a classical mixture of single-phase distributions.
Extracted 2026-08-29 (plan specs/amplitude-amplification-plan.md, AA-5b step 1) from the
Fin T × ZMod N-typed originals in Empirical/QM/Algorithms/ShorCore.lean (tensorCN,
qftInvCount, probCount), which are now the instances; the second consumer is the amplitude
-estimation kickback marginal (AA-5b), whose two branches have orthogonal eigenvector
companions. The mixture lemma is new here — Shor's file never needed the general form, and the
8/π² assembly does.
The tensor state #
The tensor product of two register states, as a vector on the product index:
coordinate (tensorState φ ψ) (c, y) = φ c * ψ y.
Equations
- QuantumInfo.tensorState φ ψ = (WithLp.equiv 2 (ι₁ × ι₂ → ℂ)).symm fun (p : ι₁ × ι₂) => φ.ofLp p.1 * ψ.ofLp p.2
Instances For
The tensor is linear in the first factor.
The tensor commutes with finite sums in the first factor.
The tensor is linear in the second factor.
The tensor commutes with finite sums in the second factor.
On basis states the tensor is the joint basis state: |c⟩ ⊗ |y⟩ = |(c, y)⟩.
The tensor is additive in the second factor.
A matrix kernel on the first factor #
A matrix kernel acting on the first factor only: coordinate
(matrixLeft M Φ) (c, y) = ∑_x M c x · Φ (x, y). This is the shape of "apply the inverse QFT
to the counting register of a joint state".
Equations
Instances For
The partial matrix action is homogeneous.
The coordinate of the Euclidean matrix action: (M ψ) c = ∑_x M c x · ψ x.
★ Key reduction: on a product state, a first-factor kernel acts on the first factor and
leaves the second alone: matrixLeft M (φ ⊗ ψ) = (M φ) ⊗ ψ.
The partial matrix action is additive.
The second-register slice and the Born marginal on the first register #
The second-register slice of a joint state at first-register outcome c: the (not
normalized) vector y ↦ Φ (c, y) whose norm² is the marginal weight of c.
Equations
- QuantumInfo.sliceLeft Φ c = (WithLp.equiv 2 (ι₂ → ℂ)).symm fun (y : ι₂) => Φ.ofLp (c, y)
Instances For
The slice of a product state is the scaled second factor.
The product law: the marginal of a product state is the first-factor Born weight scaled by the second factor's norm².
★★ The orthogonal-branch mixture law. For a sum of product states whose second factors
are pairwise orthogonal, the Born marginal on the first register is the mixture of the
branch marginals — every cross-term dies against the orthogonality. This is what turns a
multi-branch kickback state ∑_s φ_s ⊗ u_s (orthogonal eigenvector companions u_s) into a
classical mixture of single-branch counting distributions.
★ The two-branch mixture law: for two product states with orthogonal second factors, the first-register marginal is the sum of the branch marginals — the form the two-eigenvector kickback state consumes.