Documentation

CsdLean4.Empirical.QM.Gates.TwoQubit

Empirical/QM: Two-qubit gates (CNOT, SWAP, CZ) #

Category: 3-Local (promotion-ready to 2-Framework on demand).

Pure linear-algebra definitions for the canonical two-qubit gates on Matrix (Fin 4) (Fin 4) ℂ, with their involutivity properties (G * G = 1). These gates are real Hermitian permutation/diagonal matrices, so involutivity coincides with unitarity: each qmG*_hermitian (Gᴴ = G) combines with the involutive qmG*_mul_self to give qmG*_unitary (Gᴴ * G = 1), now proved for every gate. No CSD ontology; the CSD-side reading lives in the companion Empirical/CSD/Gates/TwoQubit.lean.

Contents #

Basis order |00⟩, |01⟩, |10⟩, |11⟩ (qubit-0 = high bit, qubit-1 = low bit). Function-based matrix definitions; the !! notation fails to propagate ℂ elaboration cleanly for 4×4.

noncomputable def CSD.Empirical.QM.Gates.qmCNOT :
Matrix (Fin 4) (Fin 4)

Controlled-NOT gate on Fin 4.

Equations
Instances For

    CNOT is involutive: CNOT * CNOT = 1.

    CNOT is Hermitian (real symmetric {0,1} permutation matrix): CNOTᴴ = CNOT.

    CNOT is unitary: CNOTᴴ * CNOT = 1 (Hermitian + involutive).

    noncomputable def CSD.Empirical.QM.Gates.qmSWAP :
    Matrix (Fin 4) (Fin 4)

    SWAP gate on Fin 4.

    Equations
    Instances For

      SWAP is unitary: SWAPᴴ * SWAP = 1.

      noncomputable def CSD.Empirical.QM.Gates.qmCZ :
      Matrix (Fin 4) (Fin 4)

      Controlled-Z gate: phase-flip on |11⟩.

      Equations
      Instances For

        CZ is Hermitian (real diagonal {1,-1} matrix): CZᴴ = CZ.

        CZ is unitary: CZᴴ * CZ = 1.