Documentation

QEC1.Remarks.Rem_24_ShorStyleMeasurement

Remark 24: Shor-Style Measurement as Gauging #

Statement #

The gauging measurement procedure (Def_5) recovers Shor-style logical measurement as a special case. Let L be a Pauli logical operator with weight W = |supp(L)|.

Shor-style measurement uses an auxiliary GHZ state on W qubits, transversal CX gates, and X measurements on the auxiliary qubits.

Gauging measurement viewpoint: Choose a graph G with vertex set supp(L) ∪ {d_1, ..., d_W} where:

  1. W dummy vertices d_i (one per qubit in supp(L))
  2. A connected subgraph on the dummy vertices
  3. Each d_i connected by a single edge to the corresponding qubit i

After measuring the edges of the dummy subgraph first (ungauging step of Def_5), the remaining state on dummy qubits is equivalent to a GHZ state entangled with supp(L), recovering Shor-style measurement.

Main Results #

Shor-style graph construction #

The vertex type is Q ⊕ Q where Q = Fin W represents the support of L. The first copy (Sum.inl i) represents the original support qubits. The second copy (Sum.inr i) represents the dummy vertices d_i.

The edge set consists of:

  1. Pairing edges: (Sum.inl i, Sum.inr i) connecting each support qubit to its dummy
  2. Dummy subgraph edges: edges among dummy vertices forming a connected subgraph
@[reducible, inline]

The vertex type for the Shor-style gauging graph: support qubits ⊕ dummy qubits. Both are indexed by Fin W, so the total vertex count is 2W.

Equations
Instances For

    The adjacency relation for the Shor-style gauging graph. Two vertices are adjacent if:

    1. A pairing edge: (inl i, inr i) connecting support qubit i to dummy d_i
    2. A dummy subgraph edge: (inr i, inr j) where i ~ j in Gdummy
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem ShorStyleMeasurement.shorGraphAdj_symm (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (p q : ShorVertex W) :
      shorGraphAdj W Gdummy p qshorGraphAdj W Gdummy q p

      The Shor-style gauging graph on 2W vertices. Edges: W pairing edges {(inl i, inr i)} plus the dummy subgraph.

      Equations
      Instances For

        The Shor graph has 2W vertices.

        theorem ShorStyleMeasurement.shor_pairing_edge (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i : Fin W) :
        (ShorGraph W Gdummy).Adj (Sum.inl i) (Sum.inr i)

        Each pairing edge connects support qubit i to its dummy d_i.

        theorem ShorStyleMeasurement.shor_dummy_edge (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i j : Fin W) (hadj : Gdummy.Adj i j) :
        (ShorGraph W Gdummy).Adj (Sum.inr i) (Sum.inr j)

        Dummy subgraph edges are edges of the Shor graph.

        def ShorStyleMeasurement.shorDummyHom (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
        Gdummy →g ShorGraph W Gdummy

        The embedding of the dummy subgraph into the Shor graph via Sum.inr.

        Equations
        Instances For
          theorem ShorStyleMeasurement.shorGraph_connected (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (hW : 0 < W) (hconn : Gdummy.Connected) :
          (ShorGraph W Gdummy).Connected

          The Shor graph is connected when the dummy subgraph is connected and W ≥ 1.

          theorem ShorStyleMeasurement.shor_dummy_degree_ge_one (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (_hW : 0 < W) (i : Fin W) :
          0 < (ShorGraph W Gdummy).degree (Sum.inr i)

          Each dummy vertex d_i has degree ≥ 1 in the Shor graph (the pairing edge to i).

          theorem ShorStyleMeasurement.shor_support_degree_ge_one (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (_hW : 0 < W) (i : Fin W) :
          0 < (ShorGraph W Gdummy).degree (Sum.inl i)

          Each support vertex has degree ≥ 1 in the Shor graph (the pairing edge to d_i).

          theorem ShorStyleMeasurement.shor_edge_trichotomy (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] {p q : ShorVertex W} (hadj : (ShorGraph W Gdummy).Adj p q) :
          (∃ (i : Fin W), p = Sum.inl i q = Sum.inr i p = Sum.inr i q = Sum.inl i) ∃ (i : Fin W) (j : Fin W), p = Sum.inr i q = Sum.inr j Gdummy.Adj i j

          The edge set trichotomy: every edge of the Shor graph is either a pairing edge or a dummy subgraph edge.

          Extended logical operator on the Shor graph #

          The vertex set of the Shor graph is (Fin W) ⊕ (Fin W), where the first copy represents supp(L) and the second copy represents the dummy vertices. The logical operator being measured is L' = ∏_v X_v over ALL vertices (both support and dummy), exactly as in Rem_10's extendedLogicalOp.

          The logical operator L' on the Shor graph vertex set: L' = ∏_{v ∈ V ⊕ D} X_v. This is the extended logical from Rem_10 with V = D = Fin W.

          Equations
          Instances For

            L' is pure X-type: no Z-support.

            L' is self-inverse: L' · L' = 1.

            @[simp]

            L' has X-support on all vertices.

            @[simp]

            L' has no Z-support on any vertex.

            The weight of L' is 2W.

            The support-restricted logical: L on the original support qubits only. Acts as X on all Sum.inl qubits and I on Sum.inr qubits.

            Equations
            Instances For

              The dummy product: ∏_{d ∈ D} X_d on dummy qubits only.

              Equations
              Instances For

                The factorization L' = L · ∏_d X_d. The full logical is the product of the support-restricted logical and dummy X product.

                L restricted to support qubits is pure X-type.

                Dummy product is pure X-type.

                Measurement sign and dummy vertices #

                When dummy vertices are initialized in |+⟩ (eigenstate of X with eigenvalue +1), measuring A_v on a dummy vertex always gives outcome +1 (= 0 in ZMod 2). Therefore σ(L') = σ(L): the measurement sign of the extended logical equals that of the original logical. This is the same result as Rem_10.

                theorem ShorStyleMeasurement.shor_measurement_sign_dummies (W : ) (supportOutcomes dummyOutcomes : Fin WZMod 2) (h_dummy : ∀ (d : Fin W), dummyOutcomes d = 0) :
                v : ShorVertex W, Sum.elim supportOutcomes dummyOutcomes v = i : Fin W, supportOutcomes i

                Measurement sign with dummies: if all dummy outcomes are 0, the sign equals the sum over support outcomes only.

                Gauging structure on the Shor graph #

                The gauging measurement on the Shor graph has the following structure:

                The key observation: after measuring the dummy subgraph edges in the ungauging step, the remaining state on dummy qubits is a GHZ-like state entangled with the support qubits via the pairing edges {d_i, i}. This is exactly the Shor-style structure.

                The Gauss's law operator A_v on the Shor graph is pure X-type.

                The product of all Gauss operators on the Shor graph equals the logical L'. This is the structural content of Def_2's gaussLaw_product applied to the Shor graph.

                @[simp]

                The logical operator on the Shor graph's extended system (V ⊕ E) acts as X on all vertex qubits and I on edge qubits. On vertex qubits, this is L' = ∏_{v ∈ V ⊕ D} X_v.

                @[simp]
                theorem ShorStyleMeasurement.shor_logicalOp_xVec_edge (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] [Fintype (ShorGraph W Gdummy).edgeSet] (e : (ShorGraph W Gdummy).edgeSet) :
                @[simp]

                Circuit correspondence #

                The CX entangling circuit (Rem_9) transforms A_v into X_v. On the Shor graph, this means:

                This is the content of Rem_9's entanglingCircuit_transforms_gaussLaw applied to the Shor graph.

                The entangling circuit transforms A_v to X_v on the Shor graph. Here v is a vertex of the Shor graph (a ShorVertex W), and the result is pauliX (Sum.inl v) on the ExtQubit type.

                The inverse: the CX circuit transforms X_v back to A_v.

                The circuit is involutive: applying it twice gives the identity.

                Edge structure of the Shor graph #

                The edge set of the Shor graph decomposes into:

                1. W pairing edges {(inl i, inr i)} for i ∈ Fin W
                2. The edges of the dummy subgraph Gdummy (lifted to Sum.inr)

                We prove properties about this decomposition.

                theorem ShorStyleMeasurement.shor_no_support_support_edges (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i j : Fin W) :
                ¬(ShorGraph W Gdummy).Adj (Sum.inl i) (Sum.inl j)

                Support-support edges don't exist: no two support qubits are adjacent.

                theorem ShorStyleMeasurement.shor_support_dummy_iff (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i j : Fin W) :
                (ShorGraph W Gdummy).Adj (Sum.inl i) (Sum.inr j) i = j

                Support-dummy edges are exactly pairing edges: (inl i) ~ (inr j) iff i = j.

                theorem ShorStyleMeasurement.shor_dummy_dummy_iff (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i j : Fin W) :
                (ShorGraph W Gdummy).Adj (Sum.inr i) (Sum.inr j) Gdummy.Adj i j

                Dummy-dummy edges are exactly the dummy subgraph edges.

                The degree of a support vertex i in the Shor graph is exactly 1 (only the pairing edge to d_i).

                theorem ShorStyleMeasurement.shor_support_degree_eq_one (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i : Fin W) :
                (ShorGraph W Gdummy).degree (Sum.inl i) = 1

                The degree of each support vertex is exactly 1.

                theorem ShorStyleMeasurement.shor_dummy_neighborFinset (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i : Fin W) :
                (ShorGraph W Gdummy).neighborFinset (Sum.inr i) = {Sum.inl i} Finset.map { toFun := Sum.inr, inj' := } (Gdummy.neighborFinset i)

                The neighbor set of a dummy vertex i in the Shor graph is {inl i} ∪ (Gdummy neighbors of i lifted to Sum.inr).

                Structural correspondence with Shor-style measurement #

                The Shor-style measurement protocol corresponds to the gauging procedure as follows:

                Shor-style step Gauging step
                GHZ state preparation on W dummy qubits Connected dummy subgraph edges
                Transversal CX_{d_i → i} Pairing edges {d_i, i}
                Measure X on each d_i Measure A_{d_i} (Gauss operator at dummy vertex)
                Product of outcomes = σ σ = ∑_v ε_v (measurement sign)

                The key insight: after measuring the dummy subgraph edges (during ungauging), the remaining dummy qubits form a GHZ state entangled with support qubits via the W pairing edges. This is exactly the Shor-style entanglement structure.

                The advantage of the gauging viewpoint: the dummy subgraph can be chosen freely (path graph, star graph, expander, etc.) to optimize for hardware constraints.

                theorem ShorStyleMeasurement.shor_graph_is_connected (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] [Fintype (ShorGraph W Gdummy).edgeSet] (hW : 0 < W) (hconn : Gdummy.Connected) :
                (ShorGraph W Gdummy).Connected

                The Shor graph is connected.

                All Gauss operators on the Shor graph mutually commute.

                Each Gauss operator is self-inverse.

                Measuring all A_v and taking the product gives the measurement of L'. This is the fundamental equivalence that makes the gauging procedure work.

                The Gauss operator at a dummy vertex d_i is pure X-type.

                The Gauss operator at a support vertex i is pure X-type.

                theorem ShorStyleMeasurement.shor_style_structural_correspondence (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] [Fintype (ShorGraph W Gdummy).edgeSet] (hW : 0 < W) (hconn : Gdummy.Connected) :
                (ShorGraph W Gdummy).Connected Fintype.card (ShorVertex W) = 2 * W (∀ (v w : ShorVertex W), (GaussFlux.gaussLawOp (ShorGraph W Gdummy) v).PauliCommute (GaussFlux.gaussLawOp (ShorGraph W Gdummy) w)) (∀ (v : ShorVertex W), GaussFlux.gaussLawOp (ShorGraph W Gdummy) v * GaussFlux.gaussLawOp (ShorGraph W Gdummy) v = 1) v : ShorVertex W, GaussFlux.gaussLawOp (ShorGraph W Gdummy) v = GaussFlux.logicalOp (ShorGraph W Gdummy) ∀ (i : Fin W), (ShorGraph W Gdummy).degree (Sum.inl i) = 1

                Structural correspondence summary.

                Degree sum and edge count analysis #

                The Shor graph has a special structure: support vertices have degree 1, and dummy vertex degrees are determined by the dummy subgraph. We derive degree sums and edge count bounds from these structural properties.

                theorem ShorStyleMeasurement.shor_dummy_degree_eq (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (i : Fin W) :
                (ShorGraph W Gdummy).degree (Sum.inr i) = 1 + Gdummy.degree i

                The degree of dummy vertex i in the Shor graph is 1 + its degree in Gdummy.

                theorem ShorStyleMeasurement.shor_support_degree_sum (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                i : Fin W, (ShorGraph W Gdummy).degree (Sum.inl i) = W

                The sum of degrees of support vertices is W (each has degree 1).

                theorem ShorStyleMeasurement.shor_dummy_degree_sum (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                i : Fin W, (ShorGraph W Gdummy).degree (Sum.inr i) = W + i : Fin W, Gdummy.degree i

                The sum of degrees of dummy vertices is W + ∑ deg_Gdummy(i).

                theorem ShorStyleMeasurement.shor_total_degree_sum (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                v : ShorVertex W, (ShorGraph W Gdummy).degree v = 2 * (ShorGraph W Gdummy).edgeFinset.card

                Total degree sum of the Shor graph equals 2 × |E(ShorGraph)|.

                theorem ShorStyleMeasurement.shor_degree_sum_decompose (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                v : ShorVertex W, (ShorGraph W Gdummy).degree v = i : Fin W, (ShorGraph W Gdummy).degree (Sum.inl i) + i : Fin W, (ShorGraph W Gdummy).degree (Sum.inr i)

                The total degree sum decomposes as support + dummy contributions.

                theorem ShorStyleMeasurement.shor_connected_dummy_edge_bound (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (hconn : Gdummy.Connected) :
                Nat.card (Fin W) Nat.card Gdummy.edgeSet + 1

                A connected dummy subgraph on W vertices has at least W-1 edges.

                Optimization flexibility: degree bounds #

                The key advantage of the gauging viewpoint over standard Shor-style measurement: the dummy subgraph can be optimized for specific constraints.

                If Gdummy has maximum degree d, then every vertex in the Shor graph has degree at most max(1, d+1). For a path graph (d=2), the Shor graph has max degree 3. We formalize this max degree transfer property.

                theorem ShorStyleMeasurement.shor_dummy_degree_bound (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (d : ) (hbound : ∀ (i : Fin W), Gdummy.degree i d) (i : Fin W) :
                (ShorGraph W Gdummy).degree (Sum.inr i) d + 1

                If every dummy vertex has degree ≤ d in Gdummy, then every dummy vertex has degree ≤ d + 1 in the Shor graph (adding the pairing edge).

                theorem ShorStyleMeasurement.shor_max_degree_bound (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] (d : ) (hbound : ∀ (i : Fin W), Gdummy.degree i d) (v : ShorVertex W) :
                (ShorGraph W Gdummy).degree v d + 1

                Max degree of the entire Shor graph is bounded by d + 1.

                theorem ShorStyleMeasurement.shor_edge_count_via_handshaking (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                2 * (ShorGraph W Gdummy).edgeFinset.card = W + (W + i : Fin W, Gdummy.degree i)

                The Shor graph edge count via the handshaking identity.

                theorem ShorStyleMeasurement.shor_dummy_handshaking (W : ) (Gdummy : SimpleGraph (Fin W)) [DecidableRel Gdummy.Adj] :
                i : Fin W, Gdummy.degree i = 2 * Gdummy.edgeFinset.card

                The handshaking lemma applied to the dummy subgraph.