Hadamard on every qubit of |0⟩ gives the uniform superposition
ProvedQAlgorithms.Nannicini.hadamard_all_zero_uniformLet and let be the Hadamard gate. Consider a -qubit register in the all-zero basis state .
- Applying to each of the qubits, one after the other, yields the uniform superposition.
- Applying the matrix , whose entries are (Eq. (1.5)), also yields the uniform superposition:
This is how many quantum algorithms start: gates turn the initial state into an equal-weight superposition of all basis states.
Formalization Note Applying to qubit is the embedding of the one-qubit matrix on wire ; the product over all wires is taken in wire order (the factors commute). The uniform superposition is the vector all of whose amplitudes equal . The case is included; both sides are then the one-dimensional unit vector.
import Definitions.Def_QAlgorithms_Defs_Adiabatic set_option autoImplicit false
namespace QAlgorithms.Nannicini
open QAlgorithms
/-- Nannicini, Proposition 1.38, PDF p. 25. Given a `q`-qubit register in the state `|0⟩_q`,
applying the Hadamard gate to all qubits, or equivalently the matrix `H^{⊗q}` (Eq. (1.5)),
yields the uniform superposition `(1/√(2^q)) Σ_{j ∈ {0,1}^q} |j⟩`.
The first conjunct applies `H` to each wire in turn (wire `0` first); the second applies the
frozen `hadamardN q`, the matrix of Eq. (1.5). `uniformState (Qubits q)` has every amplitude
equal to `1/√(card (Qubits q)) = 1/√(2^q)`. -/
theorem hadamard_all_zero_uniform (q : ℕ) :
act (orderedProd fun i : Fin q =>
embedOp (Gate.ofMatrix1 hadamard).mat (Stabilizer.wire1 i)) (zeroKet q) =
uniformState (Qubits q) ∧
act (hadamardN q) (zeroKet q) = uniformState (Qubits q) := by
sorry
end QAlgorithms.Nannicini
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix a natural number (the case is included). The statement concerns the state space of qubits, with computational basis , where wire carries bit . It asserts that two equalities hold simultaneously.
First equality. For each wire , let be the matrix that acts as the one-qubit Hadamard on wire and as the identity elsewhere. The one-qubit Hadamard is
Explicitly, the matrix entries are
Form the ordered product
in which wire 's factor is applied first. For this is the empty product, i.e. the identity. The claim is that applying this product to the all-zeros basis vector gives the uniform vector , whose every coordinate is
Second equality. The -qubit Hadamard matrix is defined entrywise by
where is the parity of the bitwise AND of and . The claim is that applied to it also gives the same uniform vector .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.