Documentation

CsdLean4.Mathlib.QuantumInfo.TransversalClifford

Transversal Cliffords: a Pauli string factorises, and the transversal Hadamard swaps X and Z #

Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #62 (b), the general half.

A Pauli string is a tensor product over the qubits — which is obvious on paper and needs saying once in Lean, because pauliMat a b is defined by its entries and blockKron by a product over the blocks. Once said, the conjugation rule of a transversal gate is the single-qubit rule raised to the tensor power, and that is the whole mechanism of transversality.

Honest scope #

⚠️ Nothing here is about a code: these are identities in the Pauli group and its normaliser. That a particular transversal gate preserves a particular code space is the code's business, and needs the code's labels (for the Steane code, the CSS condition bdot_rowComb_rowComb).

⚠️ The Schrödinger-picture action of a transversal gate on encoded states is not here. What the conjugation rule gives is the Heisenberg picture: where the logical Paulis go.

References: M. Nielsen, I. Chuang, Quantum Computation and Quantum Information §10.4.2 (transversal gates), §10.5.8; A. Steane, PRL 77 (1996); specs/BACKLOG.md #62; specs/steane-plan.md; specs/future-work.md.

Permutation matrices #

def QuantumInfo.permMat {α : Type u_1} [DecidableEq α] (σ : α → α) :
Matrix α α ℂ

The matrix of a basis permutation: the gate that sends |w⟩ to |σ w⟩. A transversal CNOT is one of these, which is why its logical action needs no amplitudes.

Equations
Instances For
    theorem QuantumInfo.permMat_apply {α : Type u_1} [DecidableEq α] (σ : α → α) (z w : α) :
    permMat σ z w = if z = σ w then 1 else 0
    theorem QuantumInfo.permMat_mul_apply {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq α] {σ : α → α} (hσ : Function.Involutive σ) (M : Matrix α β ℂ) (z : α) (c : β) :
    (permMat σ * M) z c = M (σ z) c

    A permutation matrix on the left reindexes the rows by the permutation.

    theorem QuantumInfo.mul_permMat_apply {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq α] (σ : α → α) (M : Matrix β α ℂ) (z : β) (c : α) :
    (M * permMat σ) z c = M z (σ c)

    A permutation matrix on the right reindexes the columns.

    theorem QuantumInfo.permMat_conjTranspose {α : Type u_1} [DecidableEq α] {σ : α → α} (hσ : Function.Involutive σ) :
    theorem QuantumInfo.permMat_mul_self {α : Type u_1} [Fintype α] [DecidableEq α] {σ : α → α} (hσ : Function.Involutive σ) :
    permMat σ * permMat σ = 1

    A Pauli string is a tensor product over the qubits #

    def QuantumInfo.onePauli (u v : Fin 2) :
    Matrix (Fin 2) (Fin 2) ℂ

    The single-qubit Pauli X^u Z^v: it moves |w⟩ to |w + u⟩ and signs it by (−1)^{v w}.

    Equations
    Instances For
      theorem QuantumInfo.onePauli_apply (u v z w : Fin 2) :
      onePauli u v z w = if w = z + u then signChar (v * w) else 0
      theorem QuantumInfo.pauliMat_eq_blockKron {n : ℕ} (a b : Fin n → Fin 2) :
      pauliMat a b = blockKron fun (i : Fin n) => onePauli (a i) (b i)

      ★★ A Pauli string is the tensor product of its single-qubit Paulis.

      The single-qubit Hadamard on a Pauli #

      H X^u Z^v = (−1)^{uv} X^v Z^u H: the Hadamard moved across a Pauli, with one factor of H on each side, so the √2 never has to be squared.

      ★ H X^u Z^v H = (−1)^{uv} X^v Z^u — the four cases H I H = I, H X H = Z, H Z H = X, H (XZ) H = −XZ.

      The transversal Hadamard #

      noncomputable def QuantumInfo.hadTransversal (n : ℕ) :
      Matrix (Fin n → Fin 2) (Fin n → Fin 2) ℂ

      The transversal Hadamard: the Hadamard on every one of the n qubits.

      Equations
      Instances For

        ★★ The transversal Hadamard exchanges the X- and Z-labels of a Pauli string, with the sign (−1)^{a·b}: the single-qubit rule raised to the tensor power. On a CSS code's stabiliser labels a · b = 0, so the group is preserved elementwise.