Documentation

CsdLean4.Mathlib.QuantumInfo.JointRegister

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:

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 #

noncomputable def QuantumInfo.tensorState {ι₁ : Type u_1} {ι₂ : Type u_2} (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) :
EuclideanSpace (ι₁ × ι₂)

The tensor product of two register states, as a vector on the product index: coordinate (tensorState φ ψ) (c, y) = φ c * ψ y.

Equations
Instances For
    @[simp]
    theorem QuantumInfo.tensorState_apply {ι₁ : Type u_1} {ι₂ : Type u_2} (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) (c : ι₁) (y : ι₂) :
    (tensorState φ ψ).ofLp (c, y) = φ.ofLp c * ψ.ofLp y
    theorem QuantumInfo.tensorState_smul_left {ι₁ : Type u_1} {ι₂ : Type u_2} (k : ) (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) :
    tensorState (k φ) ψ = k tensorState φ ψ

    The tensor is linear in the first factor.

    theorem QuantumInfo.tensorState_sum_left {ι₁ : Type u_1} {ι₂ : Type u_2} {κ : Type u_3} (s : Finset κ) (f : κEuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) :
    tensorState (∑ ks, f k) ψ = ks, tensorState (f k) ψ

    The tensor commutes with finite sums in the first factor.

    theorem QuantumInfo.tensorState_smul_right {ι₁ : Type u_1} {ι₂ : Type u_2} (k : ) (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) :
    tensorState φ (k ψ) = k tensorState φ ψ

    The tensor is linear in the second factor.

    theorem QuantumInfo.tensorState_sum_right {ι₁ : Type u_1} {ι₂ : Type u_2} {κ : Type u_3} (φ : EuclideanSpace ι₁) (s : Finset κ) (f : κEuclideanSpace ι₂) :
    tensorState φ (∑ ks, f k) = ks, tensorState φ (f k)

    The tensor commutes with finite sums in the second factor.

    @[simp]
    theorem QuantumInfo.tensorState_basis {ι₁ : Type u_1} {ι₂ : Type u_2} [DecidableEq ι₁] [DecidableEq ι₂] (c : ι₁) (y : ι₂) :

    On basis states the tensor is the joint basis state: |c⟩ ⊗ |y⟩ = |(c, y)⟩.

    theorem QuantumInfo.tensorState_add_right {ι₁ : Type u_1} {ι₂ : Type u_2} (φ : EuclideanSpace ι₁) (ψ χ : EuclideanSpace ι₂) :
    tensorState φ (ψ + χ) = tensorState φ ψ + tensorState φ χ

    The tensor is additive in the second factor.

    A matrix kernel on the first factor #

    noncomputable def QuantumInfo.matrixLeft {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] (M : Matrix ι₁ ι₁ ) (Φ : EuclideanSpace (ι₁ × ι₂)) :
    EuclideanSpace (ι₁ × ι₂)

    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
      @[simp]
      theorem QuantumInfo.matrixLeft_apply {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] (M : Matrix ι₁ ι₁ ) (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) (y : ι₂) :
      (matrixLeft M Φ).ofLp (c, y) = x : ι₁, M c x * Φ.ofLp (x, y)
      theorem QuantumInfo.matrixLeft_smul {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] (M : Matrix ι₁ ι₁ ) (k : ) (Φ : EuclideanSpace (ι₁ × ι₂)) :
      matrixLeft M (k Φ) = k matrixLeft M Φ

      The partial matrix action is homogeneous.

      theorem QuantumInfo.matrixLeft_sum {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] {κ : Type u_3} (M : Matrix ι₁ ι₁ ) (s : Finset κ) (f : κEuclideanSpace (ι₁ × ι₂)) :
      matrixLeft M (∑ ks, f k) = ks, matrixLeft M (f k)

      The partial matrix action commutes with finite sums.

      theorem QuantumInfo.toEuclideanLin_coord {ι₁ : Type u_1} [Fintype ι₁] [DecidableEq ι₁] (M : Matrix ι₁ ι₁ ) (φ : EuclideanSpace ι₁) (c : ι₁) :
      ((Matrix.toEuclideanLin M) φ).ofLp c = x : ι₁, M c x * φ.ofLp x

      The coordinate of the Euclidean matrix action: (M ψ) c = ∑_x M c x · ψ x.

      theorem QuantumInfo.matrixLeft_tensorState {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] [DecidableEq ι₁] (M : Matrix ι₁ ι₁ ) (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) :

      Key reduction: on a product state, a first-factor kernel acts on the first factor and leaves the second alone: matrixLeft M (φ ⊗ ψ) = (M φ) ⊗ ψ.

      theorem QuantumInfo.matrixLeft_add {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₁] (M : Matrix ι₁ ι₁ ) (Φ Ψ : EuclideanSpace (ι₁ × ι₂)) :
      matrixLeft M (Φ + Ψ) = matrixLeft M Φ + matrixLeft M Ψ

      The partial matrix action is additive.

      The second-register slice and the Born marginal on the first register #

      noncomputable def QuantumInfo.sliceLeft {ι₁ : Type u_1} {ι₂ : Type u_2} (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) :

      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
      Instances For
        @[simp]
        theorem QuantumInfo.sliceLeft_apply {ι₁ : Type u_1} {ι₂ : Type u_2} (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) (y : ι₂) :
        (sliceLeft Φ c).ofLp y = Φ.ofLp (c, y)
        theorem QuantumInfo.sliceLeft_sum {ι₁ : Type u_1} {ι₂ : Type u_2} {κ : Type u_3} (s : Finset κ) (f : κEuclideanSpace (ι₁ × ι₂)) (c : ι₁) :
        sliceLeft (∑ ks, f k) c = ks, sliceLeft (f k) c

        Slicing commutes with finite sums.

        theorem QuantumInfo.sliceLeft_tensorState {ι₁ : Type u_1} {ι₂ : Type u_2} (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) (c : ι₁) :
        sliceLeft (tensorState φ ψ) c = φ.ofLp c ψ

        The slice of a product state is the scaled second factor.

        noncomputable def QuantumInfo.probLeft {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) :

        The Born marginal on the first register: probLeft Φ c = ∑_y ‖Φ (c, y)‖².

        Equations
        Instances For
          theorem QuantumInfo.probLeft_nonneg {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) :
          0 probLeft Φ c
          theorem QuantumInfo.probLeft_eq_inner {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] (Φ : EuclideanSpace (ι₁ × ι₂)) (c : ι₁) :
          (probLeft Φ c) = inner (sliceLeft Φ c) (sliceLeft Φ c)

          The marginal weight is the squared norm of the slice, as an inner product.

          theorem QuantumInfo.probLeft_tensorState {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] (φ : EuclideanSpace ι₁) (ψ : EuclideanSpace ι₂) (c : ι₁) :
          probLeft (tensorState φ ψ) c = φ.ofLp c ^ 2 * y : ι₂, ψ.ofLp y ^ 2

          The product law: the marginal of a product state is the first-factor Born weight scaled by the second factor's norm².

          theorem QuantumInfo.probLeft_sum_tensor_orthogonal {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] {κ : Type u_3} (s : Finset κ) (φ : κEuclideanSpace ι₁) (u : κEuclideanSpace ι₂) (horth : ks, ls, k linner (u k) (u l) = 0) (c : ι₁) :
          probLeft (∑ ks, tensorState (φ k) (u k)) c = ks, (φ k).ofLp c ^ 2 * y : ι₂, (u k).ofLp y ^ 2

          ★★ 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.

          theorem QuantumInfo.probLeft_add_tensor_orthogonal {ι₁ : Type u_1} {ι₂ : Type u_2} [Fintype ι₂] (φ₁ φ₂ : EuclideanSpace ι₁) (u₁ u₂ : EuclideanSpace ι₂) (h12 : inner u₁ u₂ = 0) (c : ι₁) :
          probLeft (tensorState φ₁ u₁ + tensorState φ₂ u₂) c = φ₁.ofLp c ^ 2 * y : ι₂, u₁.ofLp y ^ 2 + φ₂.ofLp c ^ 2 * y : ι₂, u₂.ofLp y ^ 2

          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.