Documentation

QEC1.Remarks.Rem_6_CircuitImplementation

Rem_6: Circuit Implementation of the Gauging Procedure #

Statement #

The gauging procedure can be implemented by a quantum circuit with no additional ancilla qubits beyond the edge qubits. After initializing the edge qubits in |0⟩, perform the entangling circuit ∏v ∏{e ∋ v} CX_{v→e} where CX_{v→e} is a controlled-X gate with control qubit v and target qubit e. Next, projectively measure X_v on all vertices v ∈ G and keep the post-measurement state. Then repeat the same entangling circuit ∏v ∏{e ∋ v} CX_{v→e}. Finally, measure Z_e on all edge qubits and discard them.

Main Definitions #

Main Results #

Key Properties #

The circuit has five phases:

  1. Initialize edge qubits in |0⟩
  2. Apply entangling circuit ∏v ∏{e ∋ v} CX_{v→e}
  3. Measure X_v on all vertices and keep post-measurement state
  4. Apply the same entangling circuit again
  5. Measure Z_e on all edges and discard

Controlled-X (CNOT) Gate #

structure QEC1.CXGate (QubitType : Type u_1) :
Type u_1

A controlled-X gate specification with control and target qubits

  • control : QubitType

    The control qubit

  • target : QubitType

    The target qubit

  • control_ne_target : self.control self.target

    Control and target are different

Instances For
    instance QEC1.instDecidableEqCXGate {QubitType : Type u_1} [DecidableEq QubitType] :
    DecidableEq (CXGate QubitType)
    Equations
    • One or more equations did not get rendered due to their size.

    Circuit Steps #

    The phases of the gauging circuit

    • InitializeEdges : CircuitPhase

      Phase 1: Initialize edge qubits in |0⟩

    • FirstEntangling : CircuitPhase

      Phase 2: Apply first entangling circuit ∏v ∏{e ∋ v} CX_{v→e}

    • MeasureXVertices : CircuitPhase

      Phase 3: Measure X_v on all vertices

    • SecondEntangling : CircuitPhase

      Phase 4: Apply second entangling circuit (same as first)

    • MeasureZEdges : CircuitPhase

      Phase 5: Measure Z_e on all edges and discard

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.

        The circuit has exactly 5 phases

        Phase ordering

        Equations
        @[simp]

        InitializeEdges is the first phase

        @[simp]

        MeasureZEdges is the last phase

        Entangling Circuit Structure #

        structure QEC1.EntanglingCircuit {V : Type u_1} [DecidableEq V] [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] :
        Type u_1

        The entangling circuit ∏v ∏{e ∋ v} CX_{v→e} for a graph G.

        For each vertex v, for each edge e incident to v, apply CX with control v and target e. The edges are represented as Sym2 V elements from the graph's edge set.

        Instances For

          The number of CX gates equals ∑_v deg(v) = 2|E|

          Each vertex contributes deg(v) CX gates

          Measurement Specifications #

          structure QEC1.XMeasurementSpec (QubitType : Type u_2) [DecidableEq QubitType] :
          Type u_2

          Specification of measuring Pauli X on a set of qubits

          • qubits : Finset QubitType

            The qubits to measure

          • keep : QubitTypeBool

            Whether to keep or discard each qubit after measurement

          Instances For
            structure QEC1.ZMeasurementSpec (QubitType : Type u_2) [DecidableEq QubitType] :
            Type u_2

            Specification of measuring Pauli Z on a set of qubits

            • qubits : Finset QubitType

              The qubits to measure

            • keep : QubitTypeBool

              Whether to keep or discard each qubit after measurement

            Instances For

              Complete Gauging Circuit #

              structure QEC1.GaugingCircuit {V : Type u_1} [DecidableEq V] [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] :
              Type u_1

              The complete gauging circuit implementing the gauging procedure.

              The circuit uses:

              • Vertex qubits (V): the original code qubits in supp(L)
              • Edge qubits (E_G): auxiliary qubits, one per edge

              No additional ancilla qubits are required beyond the edge qubits.

              The circuit proceeds in 5 phases:

              1. Initialize edge qubits in |0⟩
              2. Apply ∏v ∏{e ∋ v} CX_{v→e}
              3. Measure X_v on all vertices, keep post-measurement state
              4. Apply ∏v ∏{e ∋ v} CX_{v→e} (same circuit as step 2)
              5. Measure Z_e on all edges and discard
              Instances For

                Key Properties #

                The two entangling circuits are identical

                All edge qubits are initialized (from Rem_2 convention)

                X measurements are performed on all vertices

                X measurement keeps the post-measurement state

                Z measurements are performed on all edges

                Z measurement discards the edge qubits

                No Additional Ancilla Property #

                inductive QEC1.GaugingCircuit.CircuitQubit {V : Type u_1} (G : SimpleGraph V) :
                Type u_1

                The qubit types used in the circuit

                Instances For

                  No additional ancilla beyond edge qubits: every qubit is either a vertex or edge qubit

                  Helper: check if a circuit qubit is an edge qubit

                  Equations
                  Instances For

                    The ancilla qubits are exactly the edge qubits

                    Circuit Depth Analysis #

                    The circuit consists of exactly 5 phases

                    Default Circuit Construction #

                    Construct the default gauging circuit for a graph G

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      The circuit sequence as a list of phases

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        The circuit sequence is strictly increasing in phase order

                        CX Gate Count #

                        noncomputable def QEC1.numCXGates {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] :

                        Total number of CX gates in one entangling circuit

                        Equations
                        Instances For

                          The number of CX gates equals 2|E| (each edge contributes 2 gates)

                          noncomputable def QEC1.totalCXGates {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] :

                          Total CX gates in the full circuit (both entangling rounds)

                          Equations
                          Instances For

                            Total CX gates equals 4|E|

                            Summary #

                            The gauging procedure circuit implementation:

                            1. Initialization: Edge qubits start in |0⟩ (no extra work for logical qubits)
                            2. First Entangling: ∏v ∏{e ∋ v} CX_{v→e} creates correlations
                            3. X Measurement: Projectively measure X on all vertices, keep results
                            4. Second Entangling: Repeat the same CX pattern
                            5. Z Measurement: Measure Z on all edges and discard

                            Key efficiency: