Documentation

QEC1.Remarks.Rem_25_SteaneStyleMeasurement

Remark 25: Steane-Style Measurement as Gauging #

Statement #

The gauging measurement procedure can implement Steane-style measurement of a stabilizer group by combining two gauging procedures.

Standard Steane-style measurement:

  1. Prepare an ancilla code block in a known state.
  2. Apply transversal CX gates between data and ancilla.
  3. Read out the ancilla in the Z basis.
  4. The outcomes reveal the data's stabilizer eigenvalues.

Implementation via gauging (for CSS ancilla code):

Main Results #

CSS stabilizer codes #

A CSS (Calderbank-Shor-Steane) code is a stabilizer code where every check is either purely X-type (zVec = 0) or purely Z-type (xVec = 0).

A stabilizer code is CSS if every check is either pure X-type or pure Z-type.

Equations
Instances For

    The X-type check indices of a CSS code.

    Equations
    Instances For

      The Z-type check indices of a CSS code.

      Equations
      Instances For
        theorem SteaneStyleMeasurement.xCheck_is_pureX {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i : C.I) (hi : i xCheckIndices C) :
        (C.check i).zVec = 0

        An X-type check has no Z-support.

        theorem SteaneStyleMeasurement.zCheck_is_pureZ {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i : C.I) (hi : i zCheckIndices C) :
        (C.check i).xVec = 0

        A Z-type check has no X-support.

        theorem SteaneStyleMeasurement.xChecks_commute {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i j : C.I) (_hi : i xCheckIndices C) (_hj : j xCheckIndices C) :

        X-type checks are pure X-type (they mutually commute trivially).

        theorem SteaneStyleMeasurement.zChecks_commute {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i j : C.I) (_hi : i zCheckIndices C) (_hj : j zCheckIndices C) :

        Z-type checks are pure Z-type (they mutually commute trivially).

        theorem SteaneStyleMeasurement.pureX_pureX_commute {Q : Type u_1} [DecidableEq Q] [Fintype Q] (P R : PauliOp Q) (hP : P.zVec = 0) (hR : R.zVec = 0) :

        Two pure X-type operators commute (their symplectic inner product vanishes because all z-components are zero).

        theorem SteaneStyleMeasurement.pureZ_pureZ_commute {Q : Type u_1} [DecidableEq Q] [Fintype Q] (P R : PauliOp Q) (hP : P.xVec = 0) (hR : R.xVec = 0) :

        Two pure Z-type operators commute.

        The identity check (zVec = 0 ∧ xVec = 0) is trivially CSS-compatible.

        Step 1: State Preparation via Hypergraph Gauging #

        The ancilla code block is prepared by:

        1. Starting with a trivial code (all qubits independent)
        2. Adding one dummy qubit per X-type check of the ancilla CSS code
        3. Performing hypergraph gauging (Rem_17) using the hypergraph whose hyperedges are the Z-type checks of the ancilla code

        The hypergraph incidence relation is: qubit q is incident to Z-check i iff q participates in Z-check i (i.e., the Z-check acts nontrivially on q).

        def SteaneStyleMeasurement.zCheckIncident {Q : Type u_1} {I : Type u_2} (checks : IPauliOp Q) (q : Q) (i : I) :

        The incidence relation for state preparation: qubit q is incident to Z-check i iff the check has Z-action at q.

        Equations
        Instances For
          instance SteaneStyleMeasurement.zCheckIncident_decidable {Q : Type u_1} {I : Type u_2} (checks : IPauliOp Q) (q : Q) (i : I) :
          Equations
          theorem SteaneStyleMeasurement.zCheck_boundary_eq {Q : Type u_1} [DecidableEq Q] [Fintype Q] {I : Type u_2} [DecidableEq I] [Fintype I] (checks : IPauliOp Q) (γ : IZMod 2) (q : Q) :
          (HypergraphGeneralization.hyperBoundaryMap (zCheckIncident checks)) γ q = i : I, if (checks i).zVec q 0 then γ i else 0

          The hypergraph boundary map for Z-check incidence computes the Z-parity at each qubit from a vector of check activations.

          The Gauss's law operators for Z-check hypergraph gauging are all pure X-type.

          The Gauss's law operators for Z-check hypergraph gauging mutually commute.

          Step 1 (State preparation via hypergraph gauging). The hypergraph whose hyperedges correspond to the Z-type checks of the ancilla CSS code defines a valid hypergraph gauging (Rem_17). The boundary map encodes the Z-check parity structure: for each qubit q, (∂γ)q = Σ{i : Z-checks with support on q} γ_i. The Gauss operators A_v are all pure X-type and mutually commute.

          Step 2: Entangling via Gauging — Perfect Matching Graph #

          The entangling step uses a graph G that is a perfect matching between data qubits and ancilla qubits. Each data qubit i is connected to the corresponding ancilla qubit i by a single edge.

          The vertex set is (Fin n) ⊕ (Fin n) where:

          This graph measures XX on each pair (data_i, ancilla_i).

          @[reducible, inline]

          The vertex type: data qubits ⊕ ancilla qubits.

          Equations
          Instances For

            The adjacency relation for the perfect matching graph: data qubit i is adjacent to ancilla qubit i (and no other edges).

            Equations
            Instances For

              The perfect matching graph between data and ancilla qubits.

              Equations
              Instances For

                The matching graph has 2n vertices.

                Each edge connects data qubit i to ancilla qubit i.

                Data qubit i is adjacent to ancilla qubit i.

                Ancilla qubit i is adjacent to data qubit i.

                No two data qubits are adjacent.

                No two ancilla qubits are adjacent.

                Data qubit i is only adjacent to ancilla qubit i.

                Ancilla qubit i is only adjacent to data qubit i.

                Each pair (data_i, ancilla_i) forms a connected component. Data qubit i and ancilla qubit i are reachable from each other.

                theorem SteaneStyleMeasurement.matching_components (n : ) (p q : MatchingVertex n) (h : (MatchingGraph n).Reachable p q) :
                ∃ (i : Fin n), (p = Sum.inl i p = Sum.inr i) (q = Sum.inl i q = Sum.inr i)

                The matching graph consists of n connected components: each data-ancilla pair {inl i, inr i} is one component.

                Step 2: Entangling via XX Gauging on Matching Pairs #

                The entangling step gauges XX on each data-ancilla pair independently. For each pair (data_i, ancilla_i), we have a single-edge graph connecting them. The Gauss operator at each vertex acts as X on the vertex and X on the edge.

                The Gauss's law operator for the matching graph is pure X-type.

                The Gauss's law operators for the matching graph all commute.

                The product of all Gauss operators on the matching graph equals the logical operator L = ∏_v X_v on all vertex qubits.

                Each Gauss operator on the matching graph is self-inverse.

                The logical operator on the matching graph acts as X on all vertex qubits.

                The logical operator on the matching graph is pure X-type.

                Step 3: Readout via Z Measurements (Ungauging) #

                The readout step measures Z_e on each edge qubit e, which is the ungauging step (Step 4 of Def_5). For the matching graph, each edge connects data_i to ancilla_i, so measuring Z on the edge qubit effectively reads out information about the ancilla in the Z basis.

                After ungauging, the edge qubits are discarded and the system returns to operating on the original data + ancilla qubits.

                Edge Z operators on the matching graph are pure Z-type (no X-support).

                Edge Z operators all commute (both pure Z-type).

                Edge Z operators are self-inverse.

                Step 3 (Readout is ungauging). The readout step consists of measuring Z on each edge qubit. All Z measurements commute and are self-inverse, which is exactly the ungauging step of Def_5.

                Steane-Style Measurement as Composition of Gaugings #

                The full Steane-style measurement is a composition of three gauging operations:

                Steane step Gauging operation
                Prepare ancilla in codestate Hypergraph gauging (Rem_17) with Z-check hyperedges
                Transversal CX (data ↔ ancilla) Graph gauging (Def_5) with matching graph
                Z readout of ancilla Ungauging step (Z measurements on edge qubits)

                The hypergraph gauging in Step 1 prepares the ancilla by:

                The graph gauging in Steps 2-3 entangles data with ancilla by:

                Ancilla Code Properties #

                The key properties of the ancilla CSS code that make the decomposition work:

                1. Z-type checks define the hypergraph for state preparation
                2. X-type checks determine the number of dummy qubits needed
                3. The CSS property ensures X and Z checks can be handled independently
                theorem SteaneStyleMeasurement.css_check_partition {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (hcss : IsCSS C) (i : C.I) (hne : C.check i 1) :

                For a CSS code, the X-type checks and Z-type checks cover all non-identity checks.

                The number of dummy qubits for state preparation equals the number of X-type checks in the ancilla CSS code.

                theorem SteaneStyleMeasurement.xCheck_zCheck_commute {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i j : C.I) (_hi : i xCheckIndices C) (_hj : j zCheckIndices C) :

                For a CSS code, X-type checks commute with Z-type checks.

                theorem SteaneStyleMeasurement.zCheck_boundary_structure {Q : Type u_1} [DecidableEq Q] [Fintype Q] (C : StabilizerCode Q) [DecidableEq C.I] (i : C.I) (_hi : i zCheckIndices C) (q : Q) :

                The Z-check incidence boundary map encodes the Z-check parity structure.

                Degree Analysis for the Matching Graph #

                The matching graph has a very simple structure:

                This gives the minimal possible overhead for the entangling step.

                The neighbor set of a data vertex i is just {inr i}.

                The neighbor set of an ancilla vertex i is just {inl i}.

                Each data vertex has degree exactly 1.

                Each ancilla vertex has degree exactly 1.

                Every vertex in the matching graph has degree exactly 1.

                The degree sum of the matching graph is 2n.

                The matching graph has exactly n edges (by handshaking: 2|E| = 2n).

                Summary: Steane-style Measurement via Gauging #

                The formalization captures the key structural content of Remark 25:

                1. CSS codes split into X-type and Z-type checks
                2. State preparation uses hypergraph gauging on Z-type check incidence
                3. Entangling uses graph gauging on a perfect matching
                4. Readout uses Z measurements (ungauging)
                5. The CX circuit equivalence from Rem_9 connects the two viewpoints