Documentation

CsdLean4.Empirical.CSD.Algorithms.GroverFlow

Empirical/CSD: Grover's search as a flow on Σ #

Category: 3-Local (CSD-side twin of Empirical/QM/Algorithms/Grover.lean).

Empirical/QM/Algorithms/Grover.lean proves the search algorithm on the QM side: after k Grover steps from the uniform superposition the marked item w is measured with probability sin²((2k+1)θ) (grover_success). This file is the same algorithm on the CSD side. The Grover step is a unitary matrix on the n-qubit register (the oracle and the diffusion operator are reflections, 1 − 2|v⟩⟨v|), so it is a Circuit and hence a flow on the register's sector Σ = ℂℙ^{2ⁿ − 1} (CircuitFlow.lean); k runs are the flow iterated k times; and the readout is the record basin of the outcome w. The headline reads the algorithm's success probability off the basin's Born weight at the flowed ready point.

⚠️ Honest scope. The QM-side theorem carries the mathematics; this file adds the ontic reading (a flow on Σ, a basin as readout) and no new analysis of the algorithm. What the RegisterFlow.lean note says applies: the flow is the time-one map of the projective action, no Hamiltonian generating the step is modelled (R-015). The oracle is a reflection given as a matrix; no query model is claimed, as in the QM file.

References: Empirical/QM/Algorithms/Grover.lean; Empirical/CSD/Algorithms/CircuitFlow.lean; specs/BACKLOG.md #34; specs/future-work.md.

Reflections as matrices #

The reflection through a unit vector v, as a matrix: 1 − 2|v⟩⟨v|.

Equations
Instances For

    A reflection through a unit vector is an involution.

    A reflection through a unit vector is unitary.

    |v⟩⟨v| acts as ψ ↦ ⟪v, ψ⟫ v.

    A reflection acts as ψ ↦ ψ − 2⟪v, ψ⟫ v.

    Grover's operators as matrices #

    noncomputable def CSD.Empirical.CSDBridge.Algorithms.oracleMatrix {n : ℕ} (w : Fin n → Fin 2) :
    Matrix (Fin n → Fin 2) (Fin n → Fin 2) ℂ

    The oracle 1 − 2|w⟩⟨w|, the reflection through the marked basis state.

    Equations
    Instances For
      noncomputable def CSD.Empirical.CSDBridge.Algorithms.diffusionMatrix (n : ℕ) :
      Matrix (Fin n → Fin 2) (Fin n → Fin 2) ℂ

      The diffusion operator 2|s⟩⟨s| − 1, minus the reflection through the uniform superposition.

      Equations
      Instances For
        noncomputable def CSD.Empirical.CSDBridge.Algorithms.groverMatrix {n : ℕ} (w : Fin n → Fin 2) :
        Matrix (Fin n → Fin 2) (Fin n → Fin 2) ℂ

        One Grover step as a matrix: diffusion after the oracle.

        Equations
        Instances For

          The Grover matrix acts as the Grover step.

          The search as a circuit and as a flow #

          noncomputable def CSD.Empirical.CSDBridge.Algorithms.groverCircuit {n : ℕ} (w : Fin n → Fin 2) :
          Circuit (Fin n → Fin 2)

          Grover's search as a circuit on the n-qubit register.

          Equations
          Instances For

            The ready point: the uniform superposition as a point of the register's sector.

            Equations
            Instances For
              theorem CSD.Empirical.CSDBridge.Algorithms.grover_flow_born {n : ℕ} (hn : 1 ≤ n) (w : Fin n → Fin 2) (k : ℕ) (θ : ℝ) (hsin : Real.sin θ = (√(2 ^ n))⁻¹) (hcos : Real.cos θ = √(2 ^ n - 1) / √(2 ^ n)) :

              ★★ Grover on Σ. At the point reached from the ready point by k runs of the search flow, the record basin of the marked item w has Born weight sin²((2k+1)θ), sin θ = 1/√2ⁿ: the algorithm's success probability, read as the ontic typicality volume of the outcome's basin at the flowed point.

              theorem CSD.Empirical.CSDBridge.Algorithms.grover_flow_certain {n : ℕ} (hn : 1 ≤ n) (w : Fin n → Fin 2) (k : ℕ) (θ : ℝ) (hsin : Real.sin θ = (√(2 ^ n))⁻¹) (hcos : Real.cos θ = √(2 ^ n - 1) / √(2 ^ n)) (hopt : (2 * ↑k + 1) * θ = Real.pi / 2) :

              ★ Certainty at the optimal count, on Σ: when (2k+1)θ = π/2 the marked item's basin has full weight at the flowed ready point.