Documentation

LeanPool.LeanQuantumAlg.Algorithms.Grover

Grover search in the good/bad-plane model #

Grover search evolves in the two-dimensional plane spanned by the uniform superposition over bad indices and the uniform superposition over good indices. In that plane the phase oracle and diffusion reflection form exactly the same rotation used by amplitude amplification [dW19, qcnotes.tex:2768], and after k Grover iterates the success probability is sin((2k+1)θ)^2 [dW19, qcnotes.tex:2817].

This file states the Grover specialization against an explicit plane model: phaseOracle, diffusion, and the hypothesis that their product is the standard amplification rotation on the invariant good/bad plane. Building the full n-qubit oracle/diffusion implementation and rounding the optimal iteration count are separate refinements; the correctness theorem here is the closed-form rotation core used by those refinements.

Main results #

def QuantumAlg.phaseOracle {n : } (marked : Fin (2 ^ n)Bool) :

The concrete Grover phase oracle for a marked-set predicate: |j⟩ receives phase -1 exactly when marked j is true.

Equations
Instances For
    theorem QuantumAlg.phaseOracle_apply_ket {n : } (marked : Fin (2 ^ n)Bool) (j : Fin (2 ^ n)) :

    A Grover search instance restricted to its invariant two-dimensional bad/good plane. The initial state is amplitudeAmplificationState θ 0, so the initial marked-subspace probability is sin θ ^ 2; the oracle and diffusion assumptions are the explicit theorem inputs.

    • θ :

      Initial angle from the bad axis; for t marked items among N, the textbook relation is sin θ = sqrt (t / N).

    • phaseOracle : Gate 1

      Phase oracle: reflection through the bad subspace in the good/bad plane.

    • diffusion : Gate 1

      Diffusion reflection through the prepared uniform/start state.

    • One Grover iterate, diffusion after phase oracle, is the standard amplitude-amplification rotation on the invariant plane.

    Instances For

      Grover correctness in the accepted two-dimensional scope: under the explicit oracle/diffusion rotation hypothesis, k Grover iterates produce the standard closed-form state.

      Grover success probability in the good/bad-plane model. Measuring the good basis state after k Grover iterates succeeds with probability sin((2k+1)θ)^2.

      Every Grover plane model is an amplitude-amplification model with the phase oracle as the good reflection and the diffusion operator as the start-state reflection.

      Equations
      Instances For

        Grover is the amplitude-amplification specialization where the good reflection is the phase oracle and the start-state reflection is the diffusion operator.

        noncomputable def QuantumAlg.Grover.timedIterate (M : GroverModel) (k : ) :

        The state after k Grover iterates, annotated with iterate cost k.

        Equations
        Instances For

          Grover correctness, phrased through the TimeM return value.

          The marked-subspace success probability after the timed Grover iterate.

          The timed Grover iterate has the same return value as its amplitude-amplification view.

          Trusted public resource profile for k Grover iterations on n index qubits: k oracle queries and a linear-in-n elementary-gate representative per iterate.

          Equations
          Instances For
            theorem QuantumAlg.Grover.success_probability_with_resources (M : GroverModel) {n t k : } (_ht_pos : 0 < t) (_ht_le : t 2 ^ n) ( : M.θ = Real.arcsin (t / ↑(2 ^ n))) :
            (timedIterate M k).ret.probOutcome 1 = Real.sin ((2 * k + 1) * Real.arcsin (t / ↑(2 ^ n))) ^ 2 (resourceProfile n k).HasExactCounts k 0 (k * n) 0

            Grover supporting theorem for the public marked-count statement. The relation between the concrete n-qubit oracle and this good/bad plane remains an explicit model hypothesis; under the marked-count angle relation, the timed iterate has the public success probability and resource profile.

            theorem QuantumAlg.GroverSearch.main_phase_oracle_basis_action {n : } (marked : Fin (2 ^ n)Bool) (j : Fin (2 ^ n)) :

            Registered basis-action wrapper for the concrete Grover phase oracle.

            theorem QuantumAlg.GroverSearch.main_success_probability_with_resources (M : GroverModel) {n t k : } (ht_pos : 0 < t) (ht_le : t 2 ^ n) ( : M.θ = Real.arcsin (t / ↑(2 ^ n))) :
            (Grover.timedIterate M k).ret.probOutcome 1 = Real.sin ((2 * k + 1) * Real.arcsin (t / ↑(2 ^ n))) ^ 2 (Grover.resourceProfile n k).HasExactCounts k 0 (k * n) 0

            Registered resource wrapper for the marked-count Grover statement.