Computational-basis register (R1 foundation) #
Category: 1-Mathlib (CSD-free; staged as a Mathlib-upstream candidate).
The foundation for the quantum-algorithm branch (specs/nqubit-register-plan.md). A register
state over a finite computational basis ι is a vector in EuclideanSpace ℂ ι; the
n-qubit register is the instance where the basis is the bitstrings:
QReg n := EuclideanSpace ℂ (Fin n → Fin 2).
This file provides the computational basis basisState, the Born probability prob, the
coordinate-of-a-sum bridge sum_coord, and the core API: Born as a squared inner product
(prob_eq_inner_sq), normalisation of a unit state (sum_prob_eq_one), and that a basis state
is measured with certainty (prob_basisState). Downstream files add the Hadamard transform, the
QFT (Fourier.lean), phase estimation (PhaseEstimation.lean), oracles, and the algorithms.
Generalised 2026-08-29 (a strict widening, at the second consumer per CONVENTIONS.md §9):
the primitives were stated for bitstrings only, and Empirical/QM/Algorithms/ShorCore.lean
carried a verbatim second copy over a general finite index for its ZMod N and Fin T
registers. The general form subsumes both; the bitstring statements are the ι = Fin n → Fin 2
instances and every consumer elaborates as before.
An n-qubit register state: a vector in the 2ⁿ-dimensional Hilbert space indexed by
bitstrings Fin n → Fin 2. The bitstring instance of the general finite-basis register below.
Equations
- QuantumInfo.QReg n = EuclideanSpace ℂ (Fin n → Fin 2)
Instances For
The computational basis state |x⟩ indexed by an arbitrary finite type.
Equations
Instances For
The Born probability of measuring computational-basis outcome z in state ψ:
‖ψ z‖² = ‖⟨z|ψ⟩‖².
Instances For
Born rule, inner-product form: the probability is the squared modulus of the
amplitude ⟨z|ψ⟩.
A computational basis state is measured with certainty: prob |x⟩ z = [z = x].
Coordinatewise: a finite sum of register states evaluates as the sum of coordinates.