Bit-indexed matrices of the NOT, Hadamard and CNOT gates #
The register gates of CslibFrontier/Computability/Circuit/Quantum/Basic.lean are indexed by bit
strings Fin k → Bool. Small protocols are easier to state with one basis index per qubit, as
Bool for one qubit and Bool × Bool for two. This file provides the Bool × Bool-indexed
CNOT matrix |a, b⟩ ↦ |a, b ⊕ a⟩ (Cslib.Quantum.Gate.cnotMatrix), the action of the
Hadamard matrix Cslib.Quantum.Gate.hadamardMatrix on vectors, the identifications of the
register gates Cslib.Quantum.Gate.cnot and Cslib.Quantum.Gate.not with cnotMatrix and the
Pauli matrix X (Cslib.Quantum.pauliX) under the reindexings Fin 2 → Bool ≃ Bool × Bool and
Fin 1 → Bool ≃ Bool (de Wolf, Section 1.4), and the computational-basis column
characterization Cslib.Quantum.mem_unitaryGroup_iff_orthonormal_toEuclideanCLM_ket of unitarity
(Arora and Barak, Claim 20.11).
Main definitions #
Cslib.Quantum.Gate.cnotMatrix: the CNOT matrix onBool × Bool, first qubit the control.
Main results #
Cslib.Quantum.toEuclideanCLM_ket,Cslib.Quantum.mem_unitaryGroup_iff_orthonormal_toEuclideanCLM_ket: a matrix maps|j⟩to itsj-th column, and is unitary iff the imagesU |j⟩of the computational basis are orthonormal.Cslib.Quantum.Gate.cnotMatrix_mem_unitaryGroup: the CNOT matrix is unitary.Cslib.Quantum.Gate.cnotMatrix_mulVec,Cslib.Quantum.Gate.hadamardMatrix_mulVec: the action of the CNOT and Hadamard matrices on vectors.Cslib.Quantum.Gate.cnot_eq_submatrix_cnotMatrix: the register gatecnotiscnotMatrix.Cslib.Quantum.Gate.not_eq_submatrix_pauliX: the register gatenotis the Pauli matrixX.
References #
A matrix maps the computational basis state |j⟩ to its j-th column in Euclidean space.
A square complex matrix is unitary if and only if the images U |j⟩ of the computational basis
vectors form an orthonormal family in EuclideanSpace ℂ ι
Arora and Barak, Claim 20.11.
The register gate cnot is the CNOT matrix, reindexed by Fin 2 → Bool ≃ Bool × Bool.
The register gate not is the Pauli matrix X, reindexed by Fin 1 → Bool ≃ Bool.