Appendix B: Master List of Definitions & Theorems - Chapter 10
This appendix serves as a centralized, rigorous catalog of the foundational mathematical postulates, definitions, axioms, lemmas, and theorems introduced in Chapter 10 of the Quantum Braid Dynamics (QBD) monograph.
10.1.1 Definition: Logical Basis
The Logical Basis of the topological qubit, denoted , is constituted by the exclusive mapping of binary computational states to the two distinct stable prime braid configurations of the electron topology within the tripartite causal graph. This mapping is defined by the following exhaustive structural specifications:
- Logical Zero (): The ground state is identified strictly with the symmetric electron braid configuration , characterized by the uniform writhe vector . This state transforms as the trivial singlet representation under the permutation group acting on the ribbons, rendering it topologically decoupled from the color gauge field.
- Logical One (): The excited state is identified strictly with the asymmetric electron braid configuration , characterized by the redistributed writhe vector . This state transforms as a non-trivial multiplet (triplet or octet ) under the permutation group , rendering it topologically coupled to the color gauge field.
- Invariant Constraint: Both states are subject to the global topological conservation law , thereby ensuring that the electric charge observable remains invariant at across the entire logical subspace.
The fixed-label uniqueness result applies to the symmetric charge sector Fixed-Charge Uniqueness §7.3.7. The asymmetric logical excitation remains an allowed computational candidate at the same charge; its coherent control and transient color interpretation retain their stated physical assumptions.
In Plain English:
Section 10.1.1 formalizes the properties of the QBD definition regarding logical basis.
10.1.2 Theorem: Qubit Optimality
Let the topological pair be the unique minimal physical system satisfying the criteria for a fault-tolerant physical qubit. This system simultaneously satisfies topological stability, distinctness, controllability, and measurability.
In Plain English:
Section 10.1.2 formalizes the properties of the QBD theorem regarding qubit optimality.
10.1.3 Lemma: Topological Stability
Let the selected same-writhe logical subspace be invariant for a finite-dimensional effective Hamiltonian with a positive spectral gap above it, and let any admitted escape obey a specified rate-action bound. Then the gap separates the logical energies from the selected leakage sector, and the specified escape rate is exponentially bounded by the supplied action.
In Plain English:
Section 10.1.3 formalizes the properties of the QBD lemma regarding topological stability.
10.1.3.1 Proof: Topological Stability
I. Fixed-writhe labels
For the two configurations of Logical Basis §10.1.1,
For every label with , . Thus both labels minimize that linear cost. Under permutation invariance , so selects the first label alone in the symmetric sector (Fixed-Charge Uniqueness §7.3.7).
II. Spectral separation
Write for the logical projector, and for the projector onto the orthogonal complement within the sector. In the Hamiltonian model of Topological Stability §10.1.3, use and
For normalized and ,
Also gives for every , so for this isolated evolution.
III. Escape under the specified rate model
If an admitted escape process has rate with and , then
For an effective thermal activation model the same calculation uses . For a constant escape rate, survival over one clock interval is and the failure probability satisfies .
Q.E.D.
In Plain English:
Section 10.1.3.1 formalizes the properties of the QBD proof regarding topological stability.
10.1.4 Lemma: Topological Distinctness
For any two logical states and , their configurations define strictly orthogonal subspaces within the configuration Hilbert space . This orthogonality is mandated by the disjointness of their ambient isotopy classes.
In Plain English:
Section 10.1.4 formalizes the properties of the QBD lemma regarding topological distinctness.
10.1.4.1 Proof: Topological Distinctness
I. Configuration Basis and Writhe Labels
Let index the orthonormal graph configuration basis, so
(Configuration Space Validity §3.5.3). For a graph configuration with three labeled ribbons, write its integer label as . The two selected logical configurations have labels
(Logical Basis §10.1.1). Define
II. Disjoint Label Sets
If , its first writhe coordinate would satisfy
which is impossible. Hence . The conclusion also holds if labels are compared up to ribbon permutations: the multiset is distinct from .
For vectors of finite support,
and therefore
Every delta is zero because the two indexing sets are disjoint.
III. Orthogonal Subspaces and Their Projectors
Let be the diagonal projector defined on each graph ket by
Then
These bounded projectors extend to . For arbitrary vectors in their images,
Thus the stated distinct configuration sectors (Topological Distinctness §10.1.4) satisfy
Q.E.D.
In Plain English:
Section 10.1.4.1 formalizes the properties of the QBD proof regarding topological distinctness.
10.1.5 Lemma: State Controllability
Let the logical pair admit independent Hermitian exchange and phase controls whose restrictions are nonzero multiples of and and which preserve the code. Then the controls generate arbitrary logical rotations without leakage and preserve total writhe on the code.
In Plain English:
Section 10.1.5 formalizes the properties of the QBD lemma regarding state controllability.
10.1.5.1 Proof: State Controllability
I. Writhe transfer
On integer labels, define . On the selected states of Logical Basis §10.1.1,
Every shift preserves and . For the logical projector , the projected forward term is and its adjoint is . The displayed unprojected terms outside the pair explain why the physical control in State Controllability §10.1.5 requires an admission condition.
II. Exchange pulse and leakage
Let preserve the code and restrict to with . For every , , so
At this is . The conserved charge acts as and therefore commutes with every such logical pulse.
III. Arbitrary rotations
The independent phase pulse supplies . Conjugating the exchange pulse uses , giving . With and , the right two factors multiply to
Left multiplication by gives
An arbitrary matrix has the form with . For , one has
Define when and when . Define when and when . Then and , including the zero-entry cases. The phase equations and their solution are
Consequently,
Let denote the admitted physical pulses for , respectively. Code preservation gives for . Hence
Q.E.D.
In Plain English:
Section 10.1.5.1 formalizes the properties of the QBD proof regarding state controllability.
10.1.6 Lemma: Basis Measurability
Let a measured observable have the logical pair as eigenstates with distinct eigenvalues, realized by the Casimir values and in the stated color representation. Then its spectral projectors distinguish the pair exactly, and a calibrated coherent pointer coupling yields a projective readout preserving each basis eigenstate.
In Plain English:
Section 10.1.6 formalizes the properties of the QBD lemma regarding basis measurability.
10.1.6.1 Proof: Basis Measurability
I. Logical observable
For the color model of Basis Measurability §10.1.6, use the stipulated eigenvalues of on the orthogonal states of Topological Distinctness §10.1.4. With and ,
For , and .
II. Conditional pointer evolution
Prepare an auxiliary pointer in and use the modeled Hamiltonian on the code, with and . Orthogonality of the projectors gives
At the pointer pulse maps
III. Outcome and repeatability
The two pointer outcomes have probabilities and . The conditioned system vectors are the corresponding basis eigenstates up to phase. For the second readout, gives
Thus the specified pulse and pointer measurement distinguish the states in a single shot and preserve the observed basis eigenstate.
Q.E.D.
In Plain English:
Section 10.1.6.1 formalizes the properties of the QBD proof regarding basis measurability.
10.1.7 Proof: Qubit Optimality
I. Fixed Charge and Orthogonality
The labels of Logical Basis §10.1.1 give
In the orthonormal configuration basis of Topological Distinctness §10.1.4, write each logical state as a normalized sum over its label support . The first coordinate is on and on , so
Thus is an orthogonal projector, and .
II. Complexity and Spectral Separation
The fixed-charge linear cost satisfies
Both assigned labels attain this minimum. For the invariant finite sector of Topological Stability §10.1.3, let be the largest logical energy. If each leakage eigenvalue satisfies , then for a normalized leakage vector ,
This bound uses the supplied gap and does not identify the minimizing pair uniquely among candidate devices.
III. Coherent Control
On the invariant code, take the admitted exchange and phase directions of State Controllability §10.1.5. Write with and . Since , their products include
For a target with first row , take , and . A phase with zero coefficient can be arbitrary. The displayed matrix then equals the target in . Since both Hamiltonians preserve the code, each exponential and their product preserve it.
IV. Calibrated Nondemolition Readout
Use the admitted Casimir with logical eigenvalues and (Basis Measurability §10.1.6). On the code, and . For the pointer in and the pulse with ,
Measuring the pointer gives probabilities and . Since , a second readout after outcome returns with probability one. The pulse preserves each basis eigenstate conditionally on the outcome. The gap, color representation, and admitted controls remain premises for these criteria.
Q.E.D.
In Plain English:
Section 10.1.7 formalizes the properties of the QBD proof regarding qubit optimality.
10.2.1 Definition: Stabilizer Group
The Braid Code Stabilizer Group, denoted , is defined as the abelian subgroup of the Pauli group acting on the graph edges, generated by three distinct classes of local topological check operators:
- Geometric Stabilizers: For every fundamental 3-cycle in the braid lattice, the operator enforces the geometric closure condition, possessing the eigenvalue for valid cycles and for broken cycles.
- Ribbon Stabilizers: For every plaquette defining a segment of a ribbon , the operator enforces the structural connectivity of the strand, possessing the eigenvalue for intact ribbons and for frayed or disconnected segments.
- Vertex Stabilizers: For every vertex in the braid subgraph, the operator enforces the conservation of flux at the node, possessing the eigenvalue for valid flow and for phase defects.
In Plain English:
Section 10.2.1 formalizes the properties of the QBD definition regarding stabilizer group.
10.2.2 Theorem: Braid Code Consistency
Let the stabilizer group define a mathematically consistent quantum error-correcting code on the causal graph, where the stabilizer generators commute mutually and the logical codespace is well-defined.
In Plain English:
Section 10.2.2 formalizes the properties of the QBD theorem regarding braid code consistency.
10.2.3 Lemma: Geometric Commutation
Assume the geometric stabilizers commute mutually and with the vertex stabilizers on the causal graph. This commutation is structurally enforced by the topological intersection properties of the graph embedding.
In Plain English:
Section 10.2.3 formalizes the properties of the QBD lemma regarding geometric commutation.
10.2.3.1 Proof: Geometric Commutation
I. Pauli Products on Edge Factors
For finite edge sets , define
These act on the tensor factors of the stabilizer construction (Stabilizer Group §10.2.1). On a single factor,
On distinct factors, for . Commuting each factor in through gives one minus sign for each edge in the intersection:
II. Two Geometric Checks
For any , factors on the intersection cancel because , and all remaining factors commute. With ,
In particular this holds for two triangular cycles .
III. Cycle-Star Intersection
Let be a simple triangular cycle, and let . Its edge-set intersection is
where the edge indices are read modulo three. The two listed edges are distinct because the cycle is simple. Thus the intersection size is zero or two, and
This proves the required pairwise relations (Geometric Commutation §10.2.3):
Q.E.D.
In Plain English:
Section 10.2.3.1 formalizes the properties of the QBD proof regarding geometric commutation.
10.2.4 Lemma: Bit-Flip Localization
Let the geometric checks on the candidate edge set have a binary cycle-incidence matrix. Then the relative syndrome of is its edge column, and every single flip is distinguished from the no-error case and from other single flips exactly when these columns are nonzero and pairwise distinct.
In Plain English:
Section 10.2.4 formalizes the properties of the QBD lemma regarding bit-flip localization.
10.2.4.1 Proof: Bit-Flip Localization
I. Signed reference checks
Use the geometric operators of Stabilizer Group §10.2.1. Write with the registered sign . Define . For each factor,
The relative syndrome bit, equal to when the output sign differs from , is therefore .
II. Inversion of the syndrome
For the candidate set in Bit-Flip Localization §10.2.4, the no-error bit string is zero and the single-flip string at is . An edge can be distinguished from no error exactly if . Two edges can be distinguished exactly if
over . These are the nonzero and distinct-column conditions.
III. Worked cycle patterns
If distinct triangles share exactly one edge, a flip of that edge marks both rows. The joint mark identifies the shared edge among candidates, since any other edge with those marks would also have to belong to their intersection. By contrast, on one isolated triangle whose edges are , the check matrix is
The single check detects any of the three flips and leaves their locations indistinguishable.
Q.E.D.
In Plain English:
Section 10.2.4.1 formalizes the properties of the QBD proof regarding bit-flip localization.
10.2.5 Lemma: Ribbon Integrity Commutation
Assume the ribbon integrity stabilizers commute with all other generators of the stabilizer group on the causal graph. This property is structurally enforced by the construction of ribbon segments as closed plaquettes that share an even number of edges with any vertex star.
In Plain English:
Section 10.2.5 formalizes the properties of the QBD lemma regarding ribbon integrity commutation.
10.2.5.1 Proof: Ribbon Integrity Commutation
I. Plaquette Support
Let a ribbon segment have the four distinct boundary edges
as in the stabilizer construction (Stabilizer Group §10.2.1). Its boundary vertices may be labeled , with edges in the underlying undirected support.
II. Commutation with All Diagonal Checks
For a geometric cycle or a second ribbon plaquette , the all- product rule gives
The cancellation rule is valid for arbitrary overlaps because every repeated factor contributes (Geometric Commutation §10.2.3).
III. Commutation with Vertex Checks
The intersections with a vertex star are explicitly
Consequently,
IV. Extension to the Generated Group
Let be any stabilizer generators. If for each , repeated substitution gives
Every group element is such a finite product, since each Pauli check is its own inverse. Therefore
Q.E.D.
In Plain English:
Section 10.2.5.1 formalizes the properties of the QBD proof regarding ribbon integrity commutation.
10.2.6 Lemma: Fraying Detection
Let the ordered ribbon strip assign each internal rung to exactly the two adjacent plaquettes . Then an flip on has the relative syndrome pair and is distinguishable from flips on the other internal rungs.
In Plain English:
Section 10.2.6 formalizes the properties of the QBD lemma regarding fraying detection.
10.2.6.1 Proof: Fraying Detection
I. Ribbon plaquette checks
Use the plaquette of Ribbon Integrity Commutation §10.2.5 with . For an internal rung of Fraying Detection §10.2.6, the support indicator is
II. Relative syndrome
If the baseline is , commuting past the four factors gives
Thus the bit vector is . With the intact baseline , the measured signs at those two positions are and all other signs remain .
III. Scope of the pair signature
For a linearly ordered strip, equality gives , hence . A boundary rung that belongs to only one plaquette gives a single mark. Two adjacent internal rung flips instead give
over , because the shared mark cancels.
Q.E.D.
In Plain English:
Section 10.2.6.1 formalizes the properties of the QBD proof regarding fraying detection.
10.2.7 Lemma: Vertex Commutation
For all vertex stabilizers , the operators commute mutually across the entire graph. This is enforced by the property that any two distinct vertex stars share at most one edge, upon which the operators acting are identical (Pauli-X), satisfying the trivial self-commutation relation .
In Plain English:
Section 10.2.7 formalizes the properties of the QBD lemma regarding vertex commutation.
10.2.7.1 Proof: Vertex Commutation
I. Vertex-Star Products
For each vertex , let and
(Stabilizer Group §10.2.1). On the same factor , and on distinct factors
II. Arbitrary Overlap
For vertices , put , . Commutativity of all factors permits collection of the common edges:
For disjoint stars this is the product on their union. For adjacent vertices with a unique shared edge , the shared pair is . The formula also includes , where and .
III. Pairwise Commutation
Subtracting the two products gives
Together with the cycle-star and plaquette-star relations (Geometric Commutation §10.2.3), (Ribbon Integrity Commutation §10.2.5), this supplies pairwise commutation of the three declared check families.
Q.E.D.
In Plain English:
Section 10.2.7.1 formalizes the properties of the QBD proof regarding vertex commutation.
10.2.8 Lemma: Phase Error Detection
Let a single Pauli-Z error on an edge be uniquely identified by the simultaneous syndrome flip of the vertex stabilizers and at the edge's endpoints. The error signature corresponds to the unique pair of vertices , which unambiguously identifies the connecting edge in a simple graph topology.
In Plain English:
Section 10.2.8 formalizes the properties of the QBD lemma regarding phase error detection.
10.2.8.1 Proof: Phase Error Detection
I. Single-Edge Error and Reference Syndrome
Fix an edge in the simple support graph, with distinct endpoints. Let satisfy the vertex checks
(Stabilizer Group §10.2.1). The phase-error state is . Since , it has the same norm as .
II. Syndrome at Every Vertex
At , separate the factor:
The same calculation at yields . If , then ; every has , so
Thus the complete vertex syndrome is
(Phase Error Detection §10.2.8).
III. Injectivity in the Stated Error Class
Suppose two single-edge phase errors on and have the same vertex syndrome. Their negative-syndrome sets are equal:
In a simple support graph there is at most one edge with a given unordered pair of endpoints. Therefore , and the map is injective among single-edge errors. In particular,
Q.E.D.
In Plain English:
Section 10.2.8.1 formalizes the properties of the QBD proof regarding phase error detection.
10.2.9 Proof: Braid Code Consistency
I. Commuting Signed Checks
Write for a valid geometric cycle, for an intact plaquette, and for a vertex check. For edge supports ,
A cycle or plaquette meets a vertex star in zero or two edges, giving commutation by Geometric Commutation §10.2.3 and Ribbon Integrity Commutation §10.2.5. All checks commute with one another (Vertex Commutation §10.2.7), and all checks commute with one another. The scalar signs leave these relations unchanged.
II. Nonempty Signed Sector
Let be the binary check matrices and let record the prescribed signs as bits. For a binary selection of rows , group the and operators in that order. The product is
This is scalar exactly when . The signed checks therefore generate a group excluding exactly when for every such dependency. Under this condition the group average
is the projector onto the common positive sector. The idempotence follows because each group element appears times in the double sum, and only the identity has nonzero trace. A nontrivial encoded qubit further requires .
III. Single-Error Signatures
For the columns and , the relative binary syndromes are
For bit flips, nonzero and pairwise distinct columns distinguish the errors and the identity (Bit-Flip Localization §10.2.4). For phase flips, distinct endpoints give the two incident star bits. A simple underlying graph with checks on both endpoints distinguishes edges through these bits (Phase Error Detection §10.2.8). If both matrices have nonzero and pairwise distinct columns then all the displayed single-edge signatures are distinct.
IV. Rung and Boundary Checks
In the plaquette restriction of Fraying Detection §10.2.6, an internal rung has , hence the signs on its two adjacent plaquettes both flip to from the intact sector. A rung incident on one checked boundary plaquette has a single syndrome bit, and an unchecked boundary edge has zero plaquette syndrome. Distinct internal rungs have different adjacent pairs. For two adjacent internal flips,
The shared check cancels. Equal columns on any two edges instead give a zero two-flip syndrome for that check family. Thus the adjacent pair of signs follows from local support, while global localization uses the full incidence test.
Q.E.D.
In Plain English:
Section 10.2.9 formalizes the properties of the QBD proof regarding braid code consistency.
10.2.9.1 Calculation: Stabilizer Commutativity Verification
Verification of the abelian structure of the stabilizer group established in the Braid Code Consistency §10.2.9 is based on the following protocols:
- Operator Construction: The algorithm constructs tensor product operators representing geometric stabilizers (Z-type cycles), ribbon integrity checks (Z-type segments), and vertex stabilizers (X-type stars) on a 6-qubit system.
- Overlap Definition: The protocol defines specific test cases for disjoint supports, even overlaps (sharing 2 edges), and odd overlaps (sharing 1 edge) to test the commutation logic.
- Commutator Metric: The simulation computes the norm of the commutator for each pair. A norm of zero confirms commutation, while a non-zero norm indicates anticommutation. This verifies the result established in Braid Code Consistency §10.2.9.
import qutip as qt
import numpy as np
# Define Pauli matrices
I = qt.qeye(2)
X = qt.sigmax()
Z = qt.sigmaz()
# Assume a 6-qubit system for demonstration
# Case 1: Disjoint geometric stabilizers on qubits 0-2 and 3-5
S_geom1 = qt.tensor(Z, Z, Z, I, I, I)
S_geom2 = qt.tensor(I, I, I, Z, Z, Z)
comm1 = (S_geom1 * S_geom2 - S_geom2 * S_geom1).norm()
print("Disjoint geometric commutator norm: ", comm1)
# Case 2: Overlapping geometric on qubits 0-2 and 2-4 (share qubit 2)
S_geom_overlap1 = qt.tensor(Z, Z, Z, I, I, I)
S_geom_overlap2 = qt.tensor(I, I, Z, Z, Z, I)
comm2 = (S_geom_overlap1 * S_geom_overlap2 - S_geom_overlap2 * S_geom_overlap1).norm()
print("Overlapping geometric commutator norm: ", comm2)
# Case 3: Ribbon stabilizer on qubits 0-3: Z0 Z1 Z2 Z3, geom on 1,2,4 (even overlap on 1,2)
S_ribbon = qt.tensor(Z, Z, Z, Z, I, I)
S_geom_r = qt.tensor(I, Z, Z, I, Z, I)
comm3 = (S_ribbon * S_geom_r - S_geom_r * S_ribbon).norm()
print("Ribbon-geom commutator norm (even overlap): ", comm3)
# Case 4: Vertex X stabilizers, v1 incident to 0,1: X0 X1, v2 to 1,2: X1 X2
S_v1 = qt.tensor(X, X, I, I, I, I)
S_v2 = qt.tensor(I, X, X, I, I, I)
comm4 = (S_v1 * S_v2 - S_v2 * S_v1).norm()
print("Vertex X commutator norm: ", comm4)
# Case 5: Vertex X and geom Z with even overlap (share two edges: 0,1)
S_v_even = qt.tensor(X, X, I, I, I, I)
S_geom_even = qt.tensor(Z, Z, Z, Z, I, I)
comm5 = (S_v_even * S_geom_even - S_geom_even * S_v_even).norm()
print("Vertex-geom even overlap commutator norm: ", comm5)
# Odd overlap contrast (share one: qubit 0)
S_geom_odd = qt.tensor(Z, I, Z, I, I, I)
comm6 = (S_v_even * S_geom_odd - S_geom_odd * S_v_even).norm()
print("Odd overlap (should not commute): ", comm6)
print("Commutators near 0 confirm commutation where designed.")
Simulation Results:
Disjoint geometric commutator norm: 0.0
Overlapping geometric commutator norm: 0.0
Ribbon-geom commutator norm (even overlap): 0.0
Vertex X commutator norm: 0.0
Vertex-geom even overlap commutator norm: 0.0
Odd overlap (should not commute): 128.0
Commutators near 0 confirm commutation where designed.
Conclusion: The simulation confirms that all designed stabilizer pairs (disjoint and even-overlap) yield a commutator norm of exactly 0.0. Specifically, the vertex-geometric interaction with an even overlap (sharing 2 edges) commutes, validating the topological intersection rule. In contrast, the control case with an odd overlap yields a non-zero norm (128.0), confirming that the code correctly distinguishes valid topological intersections from errors. These results validate the consistency of the stabilizer group structure.
In Plain English:
Section 10.2.9.1 formalizes the properties of the QBD calculation regarding stabilizer commutativity verification.
10.3.1 Definition: Logical Codespace
The Logical Codespace, denoted , is defined as the two-dimensional subspace of the global Hilbert space spanned by the orthonormal stable electron braid configurations, . This subspace is energetically protected by the mass gap of the vacuum, such that any state is a simultaneous eigenstate of the full stabilizer group with the specific code-defined syndrome vector.
In Plain English:
Section 10.3.1 formalizes the properties of the QBD definition regarding logical codespace.
10.3.2 Theorem: Topological Fault Tolerance
Let the topological qubit constitute a quantum error-correcting code capable of protecting quantum information against local graph defects through thermodynamic self-correction. This is established by the proof that no operator of weight 1 or 2 exists that commutes with the stabilizer group while acting non-trivially on the logical subspace , thereby guaranteeing the deterministic detection and correction of all arbitrary single-qubit errors.
In Plain English:
Section 10.3.2 formalizes the properties of the QBD theorem regarding topological fault tolerance.
10.3.3 Lemma: Syndrome Flipping
Let an encoded edge be covered by at least one -type and one -type check in a commuting Pauli code. Then each single-edge error has a nontrivial syndrome and sends the code to an orthogonal syndrome sector.
In Plain English:
Section 10.3.3 formalizes the properties of the QBD lemma regarding syndrome flipping.
10.3.3.1 Proof: Syndrome Flipping
I. Signed stabilizers
For each registered check of Stabilizer Group §10.2.1, put where is its code eigenvalue. Then for the code projector . For a Pauli , define by
The sign cancels from the relative syndrome.
II. The three single-edge errors
Let and be the incidence columns of the and checks covering edge . The relations and give the separate contributions for and . Since , its sign on each check is the product of the two signs. Thus
Both columns are nonzero under Syndrome Flipping §10.3.3, so each listed syndrome is nonzero.
III. Orthogonality and a matched inverse
If a sign flips on check , then for any code vector ,
If the observed syndrome identifies up to a phase and a stabilizer, an inverse representative recovers the logical state: for a signed stabilizer . This recovery condition is stronger than the nonzero syndrome test.
Q.E.D.
In Plain English:
Section 10.3.3.1 formalizes the properties of the QBD proof regarding syndrome flipping.
10.3.4 Lemma: Minimum Weight
Let a nontrivial logical stabilizer code have the property that every Pauli of weight at most two with zero syndrome acts as a scalar on the code. Then its Pauli distance satisfies , with equality if a weight-three zero-syndrome Pauli acts nontrivially on the code.
In Plain English:
Section 10.3.4 formalizes the properties of the QBD lemma regarding minimum weight.
10.3.4.1 Proof: Minimum Weight
I. Low-weight products
In Minimum Weight §10.3.4, define the weight of a Pauli as the number of edge factors on which it acts nontrivially. The commutation signs of Syndrome Flipping §10.3.3 give
Thus two single errors with equal syndromes can have a zero-syndrome product even when each is detected.
II. Distance and correction
A zero-syndrome Pauli preserves the joint code sector. A nonzero-syndrome Pauli sends it to an orthogonal sector. Hence
The stated low-weight criterion yields . For any errors of weight at most one, has weight at most two. If its syndrome is nonzero, . Otherwise the criterion gives . Thus the weight-one set satisfies the scalar compression condition for exact correction. A zero-syndrome non-scalar weight-three witness gives .
A sufficient incidence test is available for a CSS check family. Write a Pauli, up to phase, as , where the binary vectors select its and factors. Then its syndrome is
If both check matrices have nonzero, pairwise distinct columns, each kernel excludes every binary vector of weight one or two. A vector of weight one maps to its nonzero column, and a vector of weight two maps to the sum of two different columns. For , both and have weight at most two. Zero syndrome therefore forces . This gives the low-weight exclusion for such an incidence model.
III. Single-check diagnostic example
For the three-edge fixture of Code Distance Verification §10.3.5.2, the valid geometric sign is for . With that check alone,
Moreover and , with both vectors in the check's eigenspace. Hence is non-scalar for this single-check code. The full braid check family needs the separate low-weight test.
Q.E.D.
In Plain English:
Section 10.3.4.1 formalizes the properties of the QBD proof regarding minimum weight.
10.3.5 Lemma: Thermodynamic Correction
Let a recovery round use the signed syndrome projectors and inverse representatives that correct the identity and every single-edge Pauli on the code. Then it defines a trace-preserving recovery channel, and under independent per-edge Pauli error probability on edges the pure-state fidelity is at least .
In Plain English:
Section 10.3.5 formalizes the properties of the QBD lemma regarding thermodynamic correction.
10.3.5.1 Proof: Thermodynamic Correction
I. Syndrome projectors
Use the commuting signed checks of Syndrome Flipping §10.3.3. For a syndrome sign vector define
For distinct at least one pair of factors multiplies to , so . Also
Inconsistent sign vectors give zero projectors.
II. Corrective channel
For each syndrome choose a unitary representative inverse as in Thermodynamic Correction §10.3.5. With ,
For a correctable Pauli with syndrome , and . Thus for ,
III. Independent-noise bound
Let denote an error at edge . Two or more errors imply at least one pair , so independence and the union bound give
All other branches return . For a pure input , their contribution to the output overlap is their total probability, and the remaining branches have nonnegative overlap. Hence .
Q.E.D.
In Plain English:
Section 10.3.5.1 formalizes the properties of the QBD proof regarding thermodynamic correction.
10.3.5.2 Calculation: Code Distance Verification
The fixture uses the relative syndrome rule of Syndrome Flipping §10.3.3 and illustrates why the low-weight criterion in Minimum Weight §10.3.4 needs the full check family.
- State Initialization: Use with baseline sign for the unsigned geometric check .
- Error Application: Apply each listed Pauli independently to that same initial state.
- Syndrome Comparison: Compare each measured sign with the baseline to identify collisions and undetected errors.
import qutip as qt
identity = qt.qeye(2)
x = qt.sigmax()
z = qt.sigmaz()
check = qt.tensor(z, z, z)
state = qt.tensor(qt.basis(2, 1), qt.basis(2, 1), qt.basis(2, 1))
errors = {
"I": qt.tensor(identity, identity, identity),
"X0": qt.tensor(x, identity, identity),
"X1": qt.tensor(identity, x, identity),
"Z0": qt.tensor(z, identity, identity),
"X0 X1": qt.tensor(x, x, identity),
}
print("One-check syndrome example (check = Z0 Z1 Z2)")
for name, error in errors.items():
output = error * state
print(f"{name:5} check sign: {qt.expect(check, output):+.0f}")
Simulation Results:
One-check syndrome example (check = Z0 Z1 Z2)
I check sign: -1
X0 check sign: +1
X1 check sign: +1
Z0 check sign: -1
X0 X1 check sign: -1
Conclusion: Both and flip the check to , so the check detects them but cannot distinguish them. The identity, , and all give the baseline sign . This tests one check. The distance of a specified physical code depends on its full check family and the action of its low-weight zero-syndrome errors.
In Plain English:
Section 10.3.5.2 formalizes the properties of the QBD calculation regarding code distance verification.
10.3.6 Lemma: Vertex Fock Space Formalization
Let be the Hilbert direct sum of fixed-size graph sectors, with graph labels retained for the vertex operators. Then a fixed legal insertion mode defines an isometry from its eligible subspace into the next sector, whose adjoint removes that mode on its image and vanishes on the orthogonal complement.
In Plain English:
Vertex Fock Space represents the quantum state of the causal graph as a direct sum of Hilbert spaces of different sizes, allowing quantum superpositions of graph sizes.
10.3.6.1 Proof: Vertex Fock Space Formalization
I. Orthogonal Size Sectors
Use orthonormal graph basis states, with labels retained for the insertion operation (Vertex Fock Space Formalization §10.3.6). Distinct sizes are orthogonal. For vectors with finitely many nonzero components,
The Hilbert completion consists of sequences with finite sum of squared norms. Indeed the squared distance between partial sums ending at and is , which tends to zero for square-summable sequences. A normalized state has total squared norm one.
II. Legal Insertion as an Isometry
Fix a mode with a fresh vertex label and specified incident edges. Let be the closed span of basis graphs on which insertion is legal. The operator is conditional on that domain, as with other legality-restricted operations (Elementary Task Space §1.5.1). On a basis graph in the domain set
Deleting the marked vertex and its incident edges from returns . Thus implies , so for basis elements
For any finite linear combination, the norm of the image is therefore the square root of the same sum of squared coefficients. This defines an isometry by continuous extension.
III. Adjoint and Range Projection
Let be the adjoint of the isometry. The basis matrix element is
Consequently is when and zero for all other basis graphs. The products satisfy
If the mode is admissible throughout , the first identity is . Extending the map by zero on the ineligible subspace instead gives the eligible-space projector on the whole sector.
Q.E.D.
In Plain English:
Section 10.3.6.1 formalizes the properties of the QBD proof regarding vertex fock space formalization.
10.3.7 Proof: Topological Fault Tolerance
I. Low-Weight Criterion
For a commuting signed CSS family and a Pauli up to phase, the relative syndrome of Syndrome Flipping §10.3.3 is . If both matrices have nonzero and pairwise distinct columns, a vector of weight one maps to a nonzero column and a vector of weight two maps to the sum of distinct columns. For , both and have weight at most two, so implies .
More generally, for a code with projector , the criterion in Minimum Weight §10.3.4 allows scalar zero-syndrome products. For single-edge errors or the identity , a nonzero syndrome of gives by orthogonality. If it has zero syndrome, the criterion gives . This is the exact correction condition for those errors and yields on a nontrivial code.
II. Explicit Distance-Three Benchmark
As a separate seven-edge CSS fixture, choose with columns . Thus
Each row has weight four and each pair shares two ones, proving the last equality. Columns exhibit rank three, so with all checks signed positive the independent checks give dimension . For , . Both and preserve the code. Their restrictions anticommute because their overlap has size three:
An invertible scalar action could not anticommute with the other invertible restriction. Thus acts nontrivially on the code. Together with the column test, this gives for the fixture. A physical scaffold needs its own check matrices and witness. Steane's seven-qubit code
III. Recovery Round
Use the syndrome projectors and inverse representatives from Thermodynamic Correction §10.3.5. They satisfy . For independent per-edge Pauli error probability , the probability of errors on two or more edges is bounded by
If the recovery corrects the identity and all single-edge errors, those histories return the input. Hence for pure encoded input the recovered fidelity is at least .
IV. Labeled Graph-Size Changes
For a fixed legal insertion with isometry on its eligible sector, and (Vertex Fock Space Formalization §10.3.6). In particular for eligible inputs. A recovery using this insertion needs the indicated domain and removal match. These identities do not supply an autonomous physical decoder.
Q.E.D.
In Plain English:
Section 10.3.7 formalizes the properties of the QBD proof regarding topological fault tolerance.
10.4.1 Definition: Writhe Shuffling
The Writhe Shuffling process (implementing the Logical X Gate, denoted ) is defined as the specific sequence of PUC-compliant graph rewrites that transforms the internal writhe configuration from the symmetric vector to the asymmetric vector and vice versa. This process constitutes a conservative redistribution of local twist among the ribbons, constrained by the strict invariance of the total writhe and the linking number .
In Plain English:
Section 10.4.1 formalizes the properties of the QBD definition regarding writhe shuffling.
10.4.2 Theorem: Logical X Gate
Let the writhe shuffling operation execute a logical X gate on the topological qubit codespace, which satisfies the conservation of global invariants for electric charge and color charge modulo the logical state definition.
In Plain English:
Section 10.4.2 formalizes the properties of the QBD theorem regarding logical x gate.
10.4.3 Lemma: Writhe Conservation
For any writhe shuffling operation, the total writhe of the braid configuration is conserved during the transformation.
In Plain English:
Section 10.4.3 formalizes the properties of the QBD lemma regarding writhe conservation.
10.4.3.1 Proof: Writhe Conservation
I. Elementary Redistribution
Let and let a shuffle transfer an integer from coordinate to coordinate , with . Its label action is
(Writhe Shuffling §10.4.1). Define .
II. Sum Before and After a Shuffle
Both affected coordinates and every unaffected one contribute explicitly:
For a sequence of such transfers, the base equality is . The single-transfer identity gives
Induction therefore establishes conservation for every finite shuffle sequence.
III. Selected Logical Transition
For the specified logical labels (Logical X Gate §10.4.2), the coordinate difference is
The reverse transfer has the negative coordinate increment and also preserves the sum. Hence
Q.E.D.
In Plain English:
Section 10.4.3.1 formalizes the properties of the QBD proof regarding writhe conservation.
10.4.4 Lemma: Charge Conservation
Let the global electric charge be conserved under all writhe shuffling operations.
In Plain English:
Section 10.4.4 formalizes the properties of the QBD lemma regarding charge conservation.
10.4.4.1 Proof: Charge Conservation
I. Integer-Writhe Charge
The charge definition and total writhe are
(Charge Operator §7.3.1). An allowed shuffle has by the coordinate-sum calculation (Writhe Conservation §10.4.3).
II. Charge Difference
Substitution gives
For the selected logical labels,
III. Linear Operator Form
On writhe basis states define . Let be a shuffle operator whose matrix elements vanish unless the sums agree:
On finite linear combinations in the common domain,
Thus the shuffle preserves charge, including on coherent linear combinations in each fixed-charge sector:
Q.E.D.
In Plain English:
Section 10.4.4.1 formalizes the properties of the QBD proof regarding charge conservation.
10.4.5 Proof: Logical X Gate
I. Writhe Balance Along the Rewrite Word
In the transfer convention , the forward and reverse transfers are
For a prefix of a word of admitted elementary transfers as in Writhe Conservation §10.4.3,
Therefore at each step (Charge Conservation §10.4.4). A coherent superposition of intermediate labels in this sector is also a eigenstate.
II. Projected Exchange and Pulse
For the logical projector , the unprojected forward shift also sends to , and the reverse shift sends to . Thus
With the admitted invariant control of State Controllability §10.1.5, . Since ,
It exchanges with , preserving the norm and the code.
III. Color and Physical Support
If the encoded color observable is as in Basis Measurability §10.1.6, then
Thus an exact global color conservation law would need a matched model of the control and surrounding degrees of freedom. The prefix balance establishes electric charge conservation for the stated transfer word. Whether the matched control is transversal depends on its physical tensor factors and implementation.
Q.E.D.
In Plain English:
Section 10.4.5 formalizes the properties of the QBD proof regarding logical x gate.
10.5.1 Theorem: Logical Z Gate
Let the Logical Z Gate be implemented by a Quantum Non-Demolition (QND) measurement process that couples the qubit to the gauge field, satisfying the condition that the process induces a state-dependent geometric phase shift of exactly on the excited state while leaving the ground state strictly invariant.
In Plain English:
Section 10.5.1 formalizes the properties of the QBD theorem regarding logical z gate.
10.5.2 Lemma: Singlet Transparency
Let the logical zero carry the trivial representation and let the probe couple only through the total color generators. Then the probe Hamiltonian annihilates the logical-zero sector and its interaction-picture action there is the identity.
In Plain English:
Section 10.5.2 formalizes the properties of the QBD lemma regarding singlet transparency.
10.5.2.1 Proof: Singlet Transparency
I. Trivial action and generators
Use the logical zero of Logical Basis §10.1.1 with the specified trivial color action in Singlet Transparency §10.5.2. For each generator , for every . Differentiating at gives
II. Probe matrix elements
In the total-generator model let , with the including the coupling and probe variables. For any probe vector ,
For arbitrary final vectors the transition matrix element of this interaction is therefore zero, including the diagonal expectation.
III. Interaction evolution
Let and let . The adjoint evolution obeys
Integration gives , and multiplying by gives .
The probe-induced phase on that sector is zero relative to free evolution.
Q.E.D.
In Plain English:
Section 10.5.2.1 formalizes the properties of the QBD proof regarding singlet transparency.
10.5.3 Lemma: Color Phase
Let a coherent color transport along a closed path preserve the logical pair, act trivially on the singlet, and have eigenvalue on the logical-one line. Then its restriction is , yielding logical when the admitted path is calibrated to modulo .
In Plain English:
Section 10.5.3 formalizes the properties of the QBD lemma regarding color phase.
10.5.3.1 Proof: Color Phase
I. Ordered color transport
In the model of Color Phase §10.5.3, parametrize the closed path by and write its Hermitian connection along the path as . The equation with gives the integral relation
Substitution into the right side gives the first two terms beyond the identity,
The later connection matrices appear to the left. Since , the transport is unitary.
II. A commuting calibration example
In the fundamental color model, let and along the path. For all , . Define
Since , one has . Its derivative is
Thus satisfies the same transport equation and initial condition as . Their product has derivative and initial value
Since is unitary, yields . With ,
The first color basis line acquires eigenvalue at . Its phase follows from the specified connection and chosen line.
III. Logical restriction
Using Singlet Transparency §10.5.2 for the singlet line and the stipulated holonomy eigenvalue on the other line,
At , this is . Both projectors onto the logical basis lines commute with the restricted transporter, and the code remains invariant by premise.
Q.E.D.
In Plain English:
Section 10.5.3.1 formalizes the properties of the QBD proof regarding color phase.
10.5.4 Proof: Logical Z Gate
I. Singlet Probe Response
With the trivial color representation of Singlet Transparency §10.5.2, differentiating gives . For and ,
Since , this gives in the interaction picture.
II. Holonomy Calibration
Along a closed path with the connection convention of Color Phase §10.5.3, solve with . Iterating the integral equation gives
For the commuting calibration on the represented color sector, integrating yields
At , a logical excited line matched to acquires eigenvalue . Taking in the same representation yields on that line. The quadratic Casimir is unchanged between these two calibrations.
III. Coherent Gate on the Code
If the admitted transport returns the probe to the same auxiliary state on both branches, the singlet result and the calibrated eigenline give
For a recorded projective measurement, tracing out orthogonal records instead yields and sends to zero. The coherent gate sends that same matrix element to .
Q.E.D.
In Plain English:
Section 10.5.4 formalizes the properties of the QBD proof regarding logical z gate.
10.6.1 Theorem: Hadamard Gate
Let the Hadamard rewrite process execute a logical Hadamard gate on the topological qubit codespace. This is established by a thermodynamic cycle that heats the qubit to drive mixing and quenches it to trap coherence, mapping and .
In Plain English:
Section 10.6.1 formalizes the properties of the QBD theorem regarding hadamard gate.
10.6.2 Lemma: Temperature Control
Let the local temperature increment be proportional to the excess rewrite density and relax after the drive according to a first-order decay law. Then the post-drive increment is exponentially decreasing, and an independently specified activated dephasing rate gives a coherence-time bound in terms of the barrier and temperature.
In Plain English:
Section 10.6.2 formalizes the properties of the QBD lemma regarding temperature control.
10.6.2.1 Proof: Temperature Control
I. Local density and temperature
For a patch of volume in Temperature Control §10.6.2, let count rewrites in a fixed sampling interval and be its undriven reference count. The excess density and temperature are
with a calibration coefficient. The assigned density already includes the volume division.
II. Post-drive relaxation
Assume first-order relaxation after the drive ends at , with and time constant . Then
Hence . At the remaining increment is .
III. Conditional coherence bound
For a separate effective activation model with barrier as in Topological Stability §10.1.3, take and assume at fixed . For a gate duration ,
When the logarithm is positive, this holds for . When it is nonpositive, the ratio is already at least for every positive in that model.
Q.E.D.
In Plain English:
Section 10.6.2.1 formalizes the properties of the QBD proof regarding temperature control.
10.6.3 Lemma: Topological Degeneracy
Let the two logical labels have a common baseline and mass conversion in the quadratic writhe cost model, with sharing savings zero and two for the two states, respectively. Then their modeled energies are equal and the restricted thermal ensemble has equal populations when each state has multiplicity one.
In Plain English:
Section 10.6.3 formalizes the properties of the QBD lemma regarding topological degeneracy.
10.6.3.1 Proof: Topological Degeneracy
I. Net costs
Use the logical labels of Logical Basis §10.1.1 and the sharing convention motivated by Integer Geometric Efficiency §7.4.5. Let denote the total saving in units of one geometric quantum in the quadratic model. Then
With and ,
Hence precisely when . The assigned values give .
II. Thermal population
In the restricted ensemble of Topological Degeneracy §10.6.3, with one state per label and , the probabilities satisfy
For equal energies the denominator is , and .
III. Thermal state and coherent comparison
Write . In the logical basis the density matrices are
Thus , whereas . Every logical unitary preserves .
Q.E.D.
In Plain English:
Section 10.6.3.1 formalizes the properties of the QBD proof regarding topological degeneracy.
10.6.4 Proof: Hadamard Gate
I. Thermal Evolution
In the two-state population model take . At the assigned degeneracy of Topological Degeneracy §10.6.3, and the two rates coincide. With common possibly time-dependent rate and coherence damping , the undriven equations integrate to
Cooling can reduce the decay rates. A diagonal input remains diagonal, and an exact maximally mixed state also satisfies for every unitary.
II. Admitted Coherent Pulse
Let . From and ,
For an admitted code-preserving drive , the pulse at gives
The columns give and . In particular has all four entries equal to .
III. Conditional Thermal Budget
For the activated dephasing law of Temperature Control §10.6.2, let be the activation barrier, separate from the logical splitting. With , the stipulated budget is
When the logarithm is positive this gives . When it is nonpositive every positive meets this budget in the model. For a driven Markovian dephasing model with jump , the dissipative term has trace norm at most on a density matrix because . Integrating in the ideal drive's interaction picture bounds the trace distance to ideal evolution by . This bound uses the specified dephasing channel.
Q.E.D.
In Plain English:
Section 10.6.4 formalizes the properties of the QBD proof regarding hadamard gate.
10.6.4.1 Calculation: Hadamard Quench Verification
The example uses the distinction between the active pulse and undriven relaxation in Hadamard Gate §10.6.4. It assigns constant dissipation rather than a temperature-dependent history of the form considered in Temperature Control §10.6.2.
- State Initialization: Start from the pure state .
- Driven Evolution: Integrate with , Hamiltonian , , and two fixed raising and lowering jump rates over .
- Output Comparison: Read the two populations and both components of the off-diagonal element.
import qutip as qt
import numpy as np
from qutip import mesolve, sigmay, sigmap, sigmam
# Initial |0><0|
rho0 = qt.ket2dm(qt.basis(2, 0))
# Drive H = Ω σy /2
Ω = 10.0
H = (Ω / 2) * sigmay()
# Low Γ=0.1 for partial mixing
Γ = 0.1
c_ops = [np.sqrt(Γ) * sigmam(), np.sqrt(Γ) * sigmap()]
times = np.linspace(0, 0.2, 50)
result = mesolve(H, rho0, times, c_ops)
rho_final = result.states[-1]
off_diag_real = np.real(rho_final[0,1])
off_diag_imag = np.imag(rho_final[0,1])
pops = np.real(np.diag(rho_final.full()))
print("Final pops: ", pops)
print("Final off-diag real: ", off_diag_real)
print("Final off-diag imag: ", off_diag_imag)
print("Verification: High Ω low Γ for ~0.5 coherence.")
Simulation Results:
Final pops: [0.29588084 0.70411916]
Final off-diag real: 0.441222096461602
Final off-diag imag: 0.0
Verification: High Ω low Γ for ~0.5 coherence.
Conclusion: The final populations are about and . The real coherence is about and the imaginary coherence is zero. The nonzero coherence occurs in the model with an explicit drive. For this input the overlap with is . The output evaluates one driven state trajectory. Certifying a Hadamard channel requires its action on the full operator space.
In Plain English:
Section 10.6.4.1 formalizes the properties of the QBD calculation regarding hadamard quench verification.
10.7.1 Theorem: Controlled-Z Gate
Let the Controlled-Z rewrite process , realized by the conditional interaction of two adjacent topological qubits mediated by a local gauge bridge, execute a logical Controlled-Z gate on the two-qubit codespace. This is established by the coupled syndrome dynamics that execute a phase flip on target state if and only if control state is .
In Plain English:
Section 10.7.1 formalizes the properties of the QBD theorem regarding controlled-z gate.
10.7.2 Lemma: Syndrome Coupling
Let an admitted bridge couple each commuting signed check to a separate pointer through the Hamiltonian , with the pointers prepared in . Then the syndrome is transferred to orthogonal pointer states at , preserving the encoded state within each fixed syndrome sector.
In Plain English:
Section 10.7.2 formalizes the properties of the QBD lemma regarding syndrome coupling.
10.7.2.1 Proof: Syndrome Coupling
I. Commuting bridge model
For the bridge of Syndrome Coupling §10.7.2, let be the signed checks of Syndrome Flipping §10.3.3. On the data register , and the pointer Pauli matrices act on separate pointer factors. Consequently,
The bridge preserves the measured data eigenspaces throughout the pulse.
II. Transfer on each syndrome
Let have eigenvalues for . With the evolution factors as
For one pointer, . Their overlap is
At it vanishes, so product pointers for distinct syndromes are orthogonal.
III. State preservation and readout
If are the joint syndrome projectors, linearity gives the output on an arbitrary input as
A pointer readout selects with probability . Inside one eigenspace the pointer is independent of the logical vector and the data state is unchanged. Discarding the pointer on a superposition across distinct syndromes yields .
Q.E.D.
In Plain English:
Section 10.7.2.1 formalizes the properties of the QBD proof regarding syndrome coupling.
10.7.3 Lemma: Control Dynamics
Let a code-preserving two-qubit interaction restrict to , with , and leave no branch record in auxiliary degrees of freedom. Then its pulse at is the logical controlled- gate.
In Plain English:
Section 10.7.3 formalizes the properties of the QBD lemma regarding control dynamics.
10.7.3.1 Proof: Control Dynamics
I. Coherent controlled phase
For the model in Control Dynamics §10.7.3, abbreviate the two-qubit basis as and set . Since for ,
On a general input this gives
At the restriction is , the action in Controlled-Z Gate §10.7.1.
II. Recorded stochastic comparison
In the scheduler comparison, write and for the two modeled acceptance probabilities at unit thermal factor (Addition Probability §4.5.6). With orthogonal records for acceptance and rejection, one corresponding channel has operators
where on the control. They satisfy . In the ideal probability limit , applying the channel to gives zero: the acceptance operator kills and the rejection operator kills . The coherent leaves this matrix element unchanged.
III. Continuous dephasing comparison
For a separate Markovian model with and jump , , the equation is
The populations are constant. For , , so . In this model the same phase evolution acquires an additional coherence loss when .
Q.E.D.
In Plain English:
Section 10.7.3.1 formalizes the properties of the QBD proof regarding control dynamics.
10.7.4 Proof: Controlled-Z Gate
I. Nondemolition Syndrome Transfer
In Syndrome Coupling §10.7.2, take commuting signed checks and separate pointers with , using . For a simultaneous eigenstate with eigenvalues , the pointer outputs at are . A pointer with opposite signs has overlap
The scaffold state is unchanged within the given syndrome. The checks act by fixed signs on the valid codespace, so this coupling alone has the same pointer action on every logical branch.
II. Coherent Conditional Phase
Take the separately admitted interaction with and the same final auxiliary state for every branch (Control Dynamics §10.7.3). Then
On it gives . Its coefficient matrix has determinant , hence rank two, proving entanglement. The result requires coherent branch action and removal of auxiliary records.
III. Readout and Noise
Write . For a specified controller model use syndrome projectors , readout jumps , and detectable Pauli events with constant rates . The effective equation between feedback rounds is
Here the Hamiltonian denotes its codespace restriction and must have a specified extension on error sectors. The readout dissipator vanishes within any fixed syndrome block since equals either or zero there. An unobserved projector jump that distinguishes logical branches, such as , instead damps the coherence by for in the model of Control Dynamics §10.7.3.
IV. Ideal Fast Feedback
Assume the cycle reliably resolves the syndrome and applies the inverse correction, and that one fault anywhere in the driven cycle remains correctable relative to ideal evolution. In a cycle of length , independent Poisson Pauli events with total rate have mean . Failure is possible only for two or more events in this ideal controller model, so
For cycles the union bound gives . The small-cycle limit gives the conditional quadratic suppression per round. The bound assumes the specified correctable events and reliable controller.
Q.E.D.
In Plain English:
Section 10.7.4 formalizes the properties of the QBD proof regarding controlled-z gate.
10.8.1 Definition: Rewrite Process
The T-Gate Process, denoted , is defined as a composite sequence of PUC-compliant rewrites that is constituted by three mandatory topological phases:
- Loop Nucleation: A rewrite process that nucleates a temporary, closed 3-cycle loop adjacent to the target braid, adhering to the Axiom 2: Geometric Constructibility §2.3.1 by forming irreducible geometric quanta.
- Self-Braiding: A topological transport phase where the loop encircles a single strand of the target ribbon and passes through the framing, realizing a geometric half-Dehn twist.
- Loop Annihilation: An inverse rewrite process that de-allocates the temporary loop, returning the graph to vacuum while retaining the accumulated geometric phase on the target qubit.
In Plain English:
Section 10.8.1 formalizes the properties of the QBD definition regarding rewrite process.
10.8.2 Theorem: T-Gate
Let the twist rewrite process execute a logical T gate ( phase rotation) on the topological qubit codespace. This is established by a self-exchange operation that induces a fractional Dehn twist on the framing of the asymmetric excited state while leaving the symmetric ground state invariant.
In Plain English:
Section 10.8.2 formalizes the properties of the QBD theorem regarding t-gate.
10.8.3 Lemma: Ribbon Category
Let denote the diagram model whose objects are ordered words of oriented ribbon ends and whose morphisms are boundary-fixed framed isotopy classes of collared tangles. Then stacking and straight ribbons define a category, with the ribbon structure supplied by the tensor, braiding, duality, and twist constructions below.
In Plain English:
Section 10.8.3 formalizes the properties of the QBD lemma regarding ribbon category.
10.8.3.1 Proof: Ribbon Category
I. Objects and morphisms
In Ribbon Category §10.8.3, fix standard ordered boundary points and reference framings in the two end planes of . An object records the orientations of its ordered ribbon ends. A morphism is a framed oriented tangle with those ends, straight and fixed in small collars of both end planes. Write for its framed ambient isotopy class relative to the collars. The slice coordinate orders stacking and allows cups and caps in the interior.
II. Composition and well-definedness
For and , place below and identify the collared ends labeled . Write this stack as . For example, the two height embeddings are
The straight collars meet with the same orientation and framing. If and are collar-fixed isotopies of the two factors, the rescaled isotopies in their respective slabs agree with the identity near the seam. Their union is an isotopy of the stack. Thus depends only on the classes.
III. Associativity and identity
For , the two parenthesizations place the three factors between breakpoints and . Interpolate the two interior heights:
At every , embed the three tangles into the three ordered slabs. Using straight collars at the moving seams, this gives a framed isotopy with fixed external ends, so
The identity consists of straight ribbons with the standard framing. Stacking with or changes only the length of the straight end collars of . Reparametrizing those collars gives .
IV. Ribbon structure
Horizontal juxtaposition and block exchanges give the structures in Monoidal Structure §10.8.4 and Braiding Structure §10.8.5.
The cups and caps and the full framing rotation satisfy the identities in Duality Structure §10.8.6 and Twist Structure §10.8.7 on the same classes.
Q.E.D.
In Plain English:
Section 10.8.3.1 formalizes the properties of the QBD proof regarding ribbon category.
10.8.4 Lemma: Monoidal Structure
Let the tensor product on the framed-tangle model concatenate boundary words and juxtapose representatives in disjoint ordered strips. Then it is a bifunctor with the empty word as unit, and the canonical reassociations and unit removals satisfy the pentagon and triangle identities.
In Plain English:
Section 10.8.4 formalizes the properties of the QBD lemma regarding monoidal structure.
10.8.4.1 Proof: Monoidal Structure
I. Juxtaposition of morphisms
In Ribbon Category §10.8.3, represent each factor in an ordered strip and place it to the left or right by an orientation-preserving horizontal rescaling. Align the ordered ends to the standard boundary points by straightened collars. For two choices of strip positions, the inequalities between the strip endpoints remain strict under linear interpolation, and each strip width remains positive. This supplies a deformation through disjoint supports, relative to the external ends after collar alignment. Isotopies of the individual representatives stay in their respective strips.
For , , , and , both sides of
have in the left strip and in the right strip, in that bottom-to-top order. The seams can be chosen at the same height, so the two stacks represent the same class. Juxtaposition of straight ribbons also gives .
II. Reassociation and the pentagon
Use the ordered-word model of Monoidal Structure §10.8.4. The two parenthesizations and flatten to the same word . Their canonical associator is the straight identity on that word. With four factors both pentagon composites are explicitly
Naturality is the equality of the same three ordered tangle factors on the two sides of the reassociation square.
III. Unit and the triangle
The empty word contributes no ribbon to a juxtaposition, so and are the identity on the flattened word . Removing the empty middle strip directly or after reassociation gives
Thus the pentagon and triangle hold in the strict ordered-word realization.
Q.E.D.
In Plain English:
Section 10.8.4.1 formalizes the properties of the QBD proof regarding monoidal structure.
10.8.5 Lemma: Braiding Structure
Let be the framed block overcrossing of the ordered tangle model. Then it is a natural isomorphism and satisfies both hexagon identities with the canonical associators.
In Plain English:
Section 10.8.5 formalizes the properties of the QBD lemma regarding braiding structure.
10.8.5.1 Proof: Braiding Structure
I. Block exchange and its inverse
For Braiding Structure §10.8.5, put the blocks in small disks of radius centered at and . Move their centers along
The center separation remains constant with and are translated without rotation of their internal framings. In projection, the left block crosses over the right block. Reversing the motion gives the inverse of the exchange. The motion followed by its reversal contracts by replacing the progress parameter along the out-and-back path by times that parameter for from zero to one. All intermediate motions retain the disk separation, and the contraction fixes the external ends.
II. Naturality
For and , put their collared representatives in the two disks, as in Monoidal Structure §10.8.4. At deformation parameter , run each internal tangle in the height interval . Give the exchange a progress function , where the first function completes the exchange below the midplane and the second starts it above the midplane. Each height slice places the two local pieces in disjoint disks. The two parameters interpolate between exchanging before the internal tangles and exchanging after them. This gives the framed isotopy
III. Both hexagons
Use the strict word convention, with straight reassociations suppressed. In a positive shuffle of two blocks, each elementary crossing swaps an adjacent pair to , with the left-block strand over the right-block strand. For a strand order , let count pairs consisting of an -strand still to the left of a -strand. If , a pair of this kind with the smallest position separation is adjacent. An intervening -strand would be closer to the right member, and an intervening -strand would be closer to the left member. An adjacent swap changes the relative order of exactly those two strands, so for a step ,
It follows that every partial shuffle can be completed in further steps from . The induction assertion is that all complete shuffles from a fixed represent the same braid morphism. If , all -strands already precede all -strands, and the only shuffle is the empty word.
Suppose the assertion holds for all orders with fewer than remaining pairs, and let . If two shuffles start with the same crossing, their tails agree as braids by the induction hypothesis at . If their first crossings occupy positions and , respectively, they cannot overlap, since an overlapped position would have to be both an -strand and a -strand. Thus . Let and be the orders after the respective first steps, and the order after both. The two routes have the same target and satisfy the distant braid relation (Distant Commutativity §8.1.3)
Let be a complete shuffle from . By the induction hypothesis at , the tail after equals as a braid. At , the tail after equals . The original shuffles therefore agree by
In , each strand of crosses once over each strand of and , and the order within is preserved. Exchanging with and then with is another shuffle of the same blocks. Likewise, shuffles past , which can be done by crossing over and then over . The typed equations are
With parentheses retained, the two routes are
Every associator is the straight identity on the ordered word. Substituting those identities gives the two shuffle equations above, with sources and , respectively.
IV. Three-block relation
Apply naturality with and . Expanding and by the second hexagon gives
Both composites have source and target .
Q.E.D.
In Plain English:
Section 10.8.5.1 formalizes the properties of the QBD proof regarding braiding structure.
10.8.6 Lemma: Duality Structure
Let be the reverse word of with each orientation reversed, and equip the collared tangle model with nested untwisted cups and caps for that pairing. Then the two snake composites are the identities on and .
In Plain English:
Section 10.8.6 formalizes the properties of the QBD lemma regarding duality structure.
10.8.6.1 Proof: Duality Structure
I. Boundary pairing
For set , where the star on each end reverses its orientation. In Duality Structure §10.8.6, use and . In either ordered boundary, the nested arcs pair positions and for . The corresponding end orientations match along each bend and the planar reference framing introduces zero twists. Juxtaposition and the units use Monoidal Structure §10.8.4.
II. Snake on
The first map produces the ordered blocks . Index an incoming in the last block by . The cap joins it to the middle-block end at position , and the cup joins that end to position in the first block. The path is therefore
Each cap and cup is used by one of these paths, leaving no closed component. In the planar composite each path joins the same ordered ends as a straight ribbon. The two bends are untwisted. Sliding a bent arc across the empty planar strip between it and its straightened position removes the bends; for the nested arcs one does this from an outermost strip, then repeats on the remaining arcs. The framing extends across each planar slide. Thus
III. Snake on
For , the three blocks are . An incoming end at position in the first block is joined by the cap to position in the middle block. The cup sends it to position in the last block. Hence
The output is in position of and again there is no closed component. Straightening the untwisted arcs gives
Q.E.D.
In Plain English:
Section 10.8.6.1 formalizes the properties of the QBD proof regarding duality structure.
10.8.7 Lemma: Twist Structure
Let be the positive full framing rotation of the boundary block in the collared tangle model. Then is a natural isomorphism satisfying the unit, balancing, and dual-twist identities.
In Plain English:
Section 10.8.7 formalizes the properties of the QBD lemma regarding twist structure.
10.8.7.1 Proof: Twist Structure
I. Twist and naturality
For Twist Structure §10.8.7, let rotate a transverse plane through angle in the positive crossing sense. On a straight boundary block, is the motion for increasing from zero to one and constant on the end collars. The inverse uses the negative rotation, and an empty block gives .
For a collared tangle , apply this rotation to every height slice. Choose one progress function that completes the rotation in the input collar and another that performs it in the output collar. The family has the same end values. Each map rotates an entire slice and hence preserves disjointness and framing. The end diagrams give
II. Balancing
For two disjoint disks centered at , write a point of either disk as . The full rotation sends it to
The first term moves the centers through two positive half-exchanges as in Braiding Structure §10.8.5. The second term makes one full internal framing rotation in each disk. The disks stay disjoint during the center motion. The progress of the internal rotation can therefore be delayed continuously until the center motion has finished, while fixing both initial and final framings. The resulting stack is
III. Dual compatibility
In the planar cup and cap convention of Duality Structure §10.8.6, the dual of a tangle box is its half-turn in the plane of the bends. To see this for an endomorphism , its dual composite is
The two bends route each strand into and out of the box from the opposite end, reversing the horizontal order and end orientation. Turning the box through the bends and straightening the untwisted collars yields the half-turned diagram. In coordinates it replaces by and conjugates the transverse action by the reflection . Since ,
The new progress function again starts at zero and ends at one, and the order and orientations are those of . This proves .
Q.E.D.
In Plain English:
Section 10.8.7.1 formalizes the properties of the QBD proof regarding twist structure.
10.8.8 Lemma: Gate Set Universality
Let act coherently on a common logical register as , , and up to global phase, with single-site addressing and an admitted on each pair. Then their products are dense in the logical unitary group modulo global phase.
In Plain English:
Section 10.8.8 formalizes the properties of the QBD lemma regarding gate set universality.
10.8.8.1 Proof: Gate Set Universality
I. One-qubit rotations
For sites work with the inverse image of the closed projective gate group under the quotient by scalar phases. This is a closed subgroup and contains the determinant-one representatives of the gate words. On one site, use , , , and . In the logical gate model of T-Gate §10.8.2, , so up to global phase it is . Let and . The product of its conjugate and itself has determinant-one representative
Its eigenvalues are with . If were rational, these eigenvalues would be roots of unity and their sum an algebraic integer. But the norm of in is
which is not an integer. Thus is irrational, and powers of are dense on its axis of rotations. Conjugation by changes the axis vector from to , giving a second, nonparallel axis. For the two axes and with and , the Pauli multiplication rule gives
The cross product is nonzero and perpendicular to both axes. The three generators span , so .
II. Coupling sites
For the two-site gate of Controlled-Z Gate §10.7.1,
It sends to and is its own inverse. Conjugating on the target gives a factor on , so
Let be a nonempty support with distinct sites, and set for . Define and . The base case is . For , suppose . Every with is outside the support of , so
For a local change of Pauli factor, . With ,
For any Pauli string on the chosen support, let be the product of the corresponding local changes for the factors , respectively. Then , and the gate group closure contains
Scalar phases of the conjugating gates cancel in this identity.
III. Density on the register
The Pauli strings are orthogonal for the trace pairing since . The nonidentity strings are traceless, so their multiples by form a real basis of . The Lie algebra of therefore contains this basis. Since is connected, .
IV. Transfer to admitted rewrites
Let be the encoding isometry and suppose for each generator of Gate Set Universality §10.8.8. For a word , define , and for . The empty word has , and , hence . For , assume . Then
Thus . In particular, for the code projector ,
The complete circuit reproduces the dense logical gate set up to global phase.
Q.E.D.
In Plain English:
Section 10.8.8.1 formalizes the properties of the QBD proof regarding gate set universality.
10.8.9 Proof: T-Gate
I. Diagram Operations and the Physical Bridge
In the diagram model of Ribbon Category §10.8.3, stacking composes operations and horizontal juxtaposition gives the tensor product (Monoidal Structure §10.8.4).
Block exchanges are supplied by Braiding Structure §10.8.5, and reversed oriented ends by Duality Structure §10.8.6. The natural twist of Twist Structure §10.8.7 is a full framing rotation. A physical half-twist needs a matched closed logical operation, including the boundary identification and a coherent representation of its square by the full twist on the code.
II. Relative Phase Calibration
Let . Suppose a supplied realization preserves both lines and gives the full twist lifted eigenphases and . For the selected square-root branch with half the lifted eigenphase on each line, the eigenvalue equations are
Thus and . Because ,
The square condition allows an independent sign on each square-root eigenvalue, so the branch must be supplied by the physical matching. If the full twist phases are parametrized by , the matched relative full phase requires . A relative weight of would give full phase and phase on the corresponding half branch. Permutation symmetry of a writhe label supplies neither a phase integral nor cancellation among loop amplitudes.
III. Irrational Rotation from the Calibrated Gate
With the represented Hadamard , use . The phase-normalized gives the determinant-one product
Here and . If the eigenangles of satisfied , the eigenvalues would be roots of unity, and their sum an algebraic integer. Its quadratic norm is
which cannot be the norm of an algebraic integer in . Hence is irrational. The Bloch rotation angle is up to orientation. This supplies the irrational rotation used in Gate Set Universality §10.8.8 after the physical phase match.
Q.E.D.
In Plain English:
Section 10.8.9 formalizes the properties of the QBD proof regarding t-gate.
10.8.9.1 Calculation: T-Gate Phase Verification
The calculation supplies the diagonal matrix from the calibrated model in T-Gate §10.8.9 as an input. The physical framing representation for Twist Structure §10.8.7 is a separate premise.
- Operator Definition: Set .
- State Evolution: Apply the supplied matrix to both basis states and to the equal superposition.
- Overlap Check: Compute the real part of for each input.
import qutip as qt
import numpy as np
# Define logical basis: |0_L> = |0>, |1_L> = |1>
psi0 = qt.basis(2, 0) # |0_L>
psi1 = qt.basis(2, 1) # |1_L>
# T-gate unitary: diag(1, exp(i π/4))
theta = np.pi / 4
T = qt.Qobj(np.diag([1, np.exp(1j * theta)]))
# Action on |0_L>: phase 0
result0 = T * psi0
phase0 = np.real(psi0.dag() * result0) # Scalar for pure state; no [0,0] needed
print(f"Phase on |0_L> (expected 0, cos(0)=1): {phase0}")
# Action on |1_L>: phase π/4
result1 = T * psi1
phase1 = np.real(psi1.dag() * result1)
print(f"Phase on |1_L> (expected cos(π/4)≈0.707): {phase1}")
# Superposition: (|0_L> + |1_L>)/√2
superpos = (psi0 + psi1).unit()
result_super = T * superpos
expect_super = np.real(superpos.dag() * result_super)
print(f"Real part on superposition (mixed phases): {expect_super}")
print("Verification: Phases match T-gate unitary, confirming state-dependent geometric phase.")
Simulation Results:
Phase on |0_L> (expected 0, cos(0)=1): 1.0
Phase on |1_L> (expected cos(π/4)≈0.707): 0.7071067811865476
Real part on superposition (mixed phases): 0.8535533905932736
Verification: Phases match T-gate unitary, confirming state-dependent geometric phase.
Conclusion: For the assigned matrix the real overlaps are , , and . These real overlaps would be the same for the opposite phase. The program checks the assigned matrix and leaves the sign and physical realization of the geometric phase to the representation calibration.
In Plain English:
Section 10.8.9.1 formalizes the properties of the QBD calculation regarding t-gate phase verification.
10.9.1 Theorem: Group Closure
Let the physical gate set generate the full Clifford group via exact composition and approximate arbitrary unitary operators in via the Solovay-Kitaev theorem. This closure ensures that the causal graph dynamics are computationally universal and fault-tolerant.
In Plain English:
Section 10.9.1 formalizes the properties of the QBD theorem regarding group closure.
10.9.2 Lemma: Clifford Generation
Let the derived gates (Phase) and be constructible from the physical primitives. Specifically, is generated by the sequence , and is generated by the sequence , establishing the completeness of the set for Clifford operations.
In Plain English:
Section 10.9.2 formalizes the properties of the QBD lemma regarding clifford generation.
10.9.2.1 Proof: Clifford Generation
I. Declared Primitive Actions
Use the stated logical actions of the physical primitives as inputs. The first action is (Hadamard Gate §10.6.1). The phase action is (T-Gate §10.8.2). The two-qubit action is (Controlled-Z Gate §10.7.1). In the ordered one- and two-qubit bases, the matrices are
The tensor order is control first, target second.
II. Phase and Controlled-NOT Matrices
Direct multiplication gives
The two target products needed for the controlled operation are
Consequently,
It follows on all four basis vectors that .
III. Pauli Conjugation
Let . Besides calculated above,
Write . Applying the conjugated operators to , for , gives
Since conjugation preserves products and the generate the Pauli group, these identities show that normalize that group.
IV. Reduction of an Arbitrary Clifford Action
Let normalize the -qubit Pauli group. Its Hermitian Pauli images
satisfy and . The support of is nonempty: would imply , a contradiction. The local reductions supplied by Section III are
Applying the corresponding gate on each nonidentity factor takes to for a nonempty support .
Move one element of to position one if necessary. The required swap is a generated gate, since
For every , conjugation by cancels the extra factor:
If the result is , conjugation by changes it to . This constructs a generated circuit for which fixes by conjugation.
For ,
Thus its first Pauli factor is or . A power of , which fixes , makes this factor up to sign. Local gates on the remaining qubits make every other nonidentity factor . Then removes such a factor because
while keeping fixed. A remaining negative sign is removed by conjugation with . Hence a further generated circuit converts to a unitary satisfying
To solve these two conditions, write in the first-qubit decomposition. Commutation with gives
Commutation with then gives
Therefore , with from . For every remaining qubit , the conjugates are
They are Pauli operators since is a product of Clifford operators. Their first factor is the identity, so and are Pauli operators on the remaining factors. Thus is an -qubit Clifford.
For , the same block calculation leaves , a scalar. For the induction step, suppose all -qubit Clifford actions have generated circuits. Let denote the additional generated circuit taking to . Then
The induction hypothesis supplies the circuit for ; and were constructed above. Hence all -qubit Clifford actions are generated, up to a common global phase.
V. Primitive Rewrite Compositions
Replacing each primitive matrix by its stated logical rewrite action yields the exact compositions (Clifford Generation §10.9.2):
Every inverse used in the reduction is also a finite word: , , . Consequently the reduction gives a synthesis in the declared primitive set for every Clifford action modulo global phase.
Q.E.D.
In Plain English:
Section 10.9.2.1 formalizes the properties of the QBD proof regarding clifford generation.
10.9.3 Lemma: Solovay-Kitaev Density
Let a finite inverse-closed instruction set generate a dense subgroup of at fixed . Then the Dawson-Nielsen Solovay-Kitaev construction approximates each target to operator-norm error using gates, where .
In Plain English:
Section 10.9.3 formalizes the properties of the QBD lemma regarding solovay-kitaev density.
10.9.3.1 Proof: Solovay-Kitaev Density
I. Dense Instruction Set and Refinement
Let the finite gate set be inverse closed and dense in the stated sense (Solovay-Kitaev Density §10.9.3). This is the instruction-set hypothesis for the approximation argument, separate from the construction of Clifford operations (Clifford Generation §10.9.2). Compactness and density give a finite net at a fixed base error . The balanced-commutator refinement has the error and length bounds and for some fixed . The factor five counts the previous approximation and the four factors of the correction commutator. Dawson and Nielsen
II. Solving the Error and Length Bounds
Choose the base error with and set . Then
The two bounds hold with equality at . Given both bounds at , the next step satisfies
III. Length at the Target Error
For target , the bound gives whenever
Set and take . Then
Since as , the length is with .
Q.E.D.
In Plain English:
Section 10.9.3.1 formalizes the properties of the QBD proof regarding solovay-kitaev density.
10.9.4 Proof: Group Closure
I. Exact Logical Gates
On an admitted invariant register take the logical up to scalar phases and allow single-site addressing and the specified pair couplings. The products of Clifford Generation §10.9.2 give
where on the control. Together with these generate the logical Clifford group modulo overall phase. Gottesman's stabilizer formalism
II. Density of the Admitted Gate Set
The product of normalized and its conjugate from T-Gate §10.8.9 has an irrational eigenangle. With and , its rotation axis and the conjugate axis are and . Powers are dense in the circle about each axis. For the Pauli vector ,
The two axes and the bracket therefore span . On multiple sites, conjugating by multiplies its action on by the replacement , giving . For support containing , conjugation by the product of CNOTs with target and all controls in gives
Conjugating locally changes each into the desired Pauli direction. The closure thus contains the one-parameter groups of every nonidentity Pauli string. Their skew-Hermitian generators are independent traceless matrices by trace orthogonality, so the projective closure has full Lie algebra and is the full connected projective unitary group (Gate Set Universality §10.8.8).
III. Normalization and Inverses
Use the local determinant-one representatives , , and , embedded at their addressed sites. Their powers provide inverses at constant cost. Let be their closure in . Projective surjectivity gives for its finite scalar center . Thus has finitely many closed cosets and is open, so connectedness gives . The physical gate words implement these representative actions up to scalar phase.
IV. Gate Length at Fixed Register Size
For this inverse-closed dense finite instruction set, Solovay-Kitaev Density §10.9.3 uses and . With ,
For , the choice yields
The approximation is for the admitted logical gates at fixed . Physical fault tolerance additionally requires control and recovery guarantees for faults throughout a circuit. Dawson and Nielsen
Q.E.D.
In Plain English:
Section 10.9.4 formalizes the properties of the QBD proof regarding group closure.
10.9.4.1 Calculation: Solovay-Kitaev Verification
Verification of the universality principle established by Clifford Generation §10.9.2.1 and Group Closure §10.9.4 is based on the following protocols:
- Base Net Construction: Enumerate the unique determinant-one single-qubit words generated by (, ) up to length in .
- Recursive Refinement: Run the Dawson-Nielsen balanced-commutator Solovay-Kitaev recursion across depths on a seeded target and verify exact primitive word reconstruction against .
- Multi-Qubit Compilation: Compile Haar-random targets across qubits (, , ) into primitive gate sequences via recursive Quantum Shannon Decomposition combined with depth- Solovay-Kitaev synthesis, evaluating the phase-aligned operator-norm distance .
# §10.9.4.1 — Solovay-Kitaev SU(2) refinement and SU(2^n) QSD synthesis
import numpy as np
import qutip as qt
import scipy.linalg as sl
H_MAT = 1j / np.sqrt(2) * np.array([[1, 1], [1, -1]], dtype=complex)
T_MAT = np.exp(-1j * np.pi / 8) * np.diag([1, np.exp(1j * np.pi / 4)])
GENS = (H_MAT, H_MAT.conj().T, T_MAT, T_MAT.conj().T)
INV = {0: 1, 1: 0, 2: 3, 3: 2}
PAULI = (
np.array([[0, 1], [1, 0]], dtype=complex),
np.array([[0, -1j], [1j, 0]], dtype=complex),
np.array([[1, 0], [0, -1]], dtype=complex),
)
def su2_to_quat(u):
"""Map SU(2) matrix to unit quaternion (w, x, y, z) on S^3."""
return np.array(
[u[0, 0].real, -u[0, 1].imag, -u[0, 1].real, -u[0, 0].imag],
dtype=float,
)
def build_base_net(max_len=18):
"""Enumerate unique SU(2) gate words up to max_len using BFS."""
seen = {tuple(np.round(su2_to_quat(np.eye(2)), 10)): ()}
mats = [np.eye(2, dtype=complex)]
quats = [np.array([1.0, 0.0, 0.0, 0.0])]
frontier = [(mats[0], ())]
for _ in range(max_len):
nxt = []
for u, w in frontier:
for gi, g in enumerate(GENS):
if w and w[-1] == INV[gi]:
continue
u2 = g @ u
q = su2_to_quat(u2)
key = tuple(np.round(q, 10))
if key not in seen:
w2 = w + (gi,)
seen[key] = w2
mats.append(u2)
quats.append(q)
nxt.append((u2, w2))
frontier = nxt
return np.array(quats), np.array(mats), list(seen.values())
QUATS, NET_MATS, NET_WORDS = build_base_net(18)
def gc_decompose(delta):
"""Balanced group commutator delta = V W V^dag W^dag in SU(2)."""
q = su2_to_quat(delta)
w0 = np.clip(q[0], -1.0, 1.0)
vec = q[1:]
vnorm = np.linalg.norm(vec)
if vnorm < 1e-13:
eye = np.eye(2, dtype=complex)
return eye, eye
n_hat = vec / vnorm
s = ((1.0 - w0) / 2.0) ** 0.25
c = np.sqrt(max(0.0, 1.0 - s * s))
v0 = c * np.eye(2, dtype=complex) - 1j * s * PAULI[0]
w0_m = c * np.eye(2, dtype=complex) - 1j * s * PAULI[1]
q0 = su2_to_quat(v0 @ w0_m @ v0.conj().T @ w0_m.conj().T)
m_hat = q0[1:] / np.linalg.norm(q0[1:])
mid = m_hat + n_hat
mid_n = np.linalg.norm(mid)
if mid_n < 1e-12:
orth = np.cross(m_hat, [1.0, 0.0, 0.0])
if np.linalg.norm(orth) < 1e-6:
orth = np.cross(m_hat, [0.0, 1.0, 0.0])
axis = orth / np.linalg.norm(orth)
else:
axis = mid / mid_n
rot = -1j * sum(axis[i] * PAULI[i] for i in range(3))
return rot @ v0 @ rot.conj().T, rot @ w0_m @ rot.conj().T
def sk_compile(u, depth):
"""Recursive Dawson-Nielsen Solovay-Kitaev approximation in SU(2)."""
if depth == 0:
idx = int(np.argmax(QUATS @ su2_to_quat(u)))
return NET_WORDS[idx], NET_MATS[idx]
w_p, u_p = sk_compile(u, depth - 1)
v, w = gc_decompose(u @ u_p.conj().T)
w_v, v_a = sk_compile(v, depth - 1)
w_w, w_a = sk_compile(w, depth - 1)
inv_v = tuple(INV[g] for g in reversed(w_v))
inv_w = tuple(INV[g] for g in reversed(w_w))
word = w_p + inv_w + inv_v + w_w + w_v
mat = v_a @ w_a @ v_a.conj().T @ w_a.conj().T @ u_p
return word, mat
def walsh_hadamard(angles):
"""Compute normalized inverse Walsh-Hadamard transform of rotation angles."""
phi = np.array(angles, dtype=float)
m = len(phi)
step = 1
while step < m:
for i in range(0, m, 2 * step):
for j in range(step):
a, b = phi[i + j], phi[i + j + step]
phi[i + j], phi[i + j + step] = a + b, a - b
step *= 2
return phi / m
def emit_ucg(angles, pauli_idx, qubits, depth, ops):
"""Compile uniformly controlled SU(2) rotation into {H, T, CZ} ops."""
target, ctrls = qubits[0], qubits[1:]
k = len(ctrls)
m = 1 << k
phi = walsh_hadamard(angles)
for s_idx in range(m):
g = s_idx ^ (s_idx >> 1)
ang = phi[g]
if abs(ang) > 1e-13:
rot = np.cos(ang / 2) * np.eye(2, dtype=complex) - 1j * np.sin(ang / 2) * PAULI[pauli_idx]
word, _ = sk_compile(rot, depth)
for gi in word:
ops.append((gi, target))
g_next = (s_idx + 1) ^ ((s_idx + 1) >> 1) if s_idx + 1 < m else 0
diff = g ^ g_next
bit = (diff & -diff).bit_length() - 1
c_q = ctrls[k - 1 - bit]
# CNOT = H_hat CZ H_hat^dag cancels extra scalar phases cleanly
ops.extend([(0, target), ("CZ", c_q, target), (1, target)])
def demultiplex(a_blk, b_blk, qubits, depth, ops):
"""Factor block-diagonal diag(A, B) into sub-blocks and controlled R_z."""
t_mat, v_mat = sl.schur(a_blk @ b_blk.conj().T, output="complex")
lam = np.angle(np.diag(t_mat))
d_diag = np.exp(0.5j * lam)
w_mat = (d_diag.conj()[:, None]) * (v_mat.conj().T @ a_blk)
qsd_compile(w_mat, qubits[1:], depth, ops)
emit_ucg(-lam, 2, qubits, depth, ops)
qsd_compile(v_mat, qubits[1:], depth, ops)
def qsd_compile(u, qubits, depth, ops):
"""Compile n-qubit unitary into primitive {H, H^dag, T, T^dag, CZ} ops."""
if len(qubits) == 1:
u_su2 = u / np.sqrt(np.linalg.det(u))
word, _ = sk_compile(u_su2, depth)
for gi in word:
ops.append((gi, qubits[0]))
return
half = u.shape[0] // 2
(u1, u2), theta, (v1h, v2h) = sl.cossin(u, p=half, q=half, separate=True)
demultiplex(v1h, v2h, qubits, depth, ops)
emit_ucg(2.0 * theta, 1, qubits, depth, ops)
demultiplex(u1, u2, qubits, depth, ops)
def evaluate_ops(ops, n_qubits):
"""Multiply primitive gate list sequentially, contracting 1q runs."""
dim = 1 << n_qubits
total = np.eye(dim, dtype=complex)
i2 = np.eye(2, dtype=complex)
def embed1(mat, q):
res = mat if q == 0 else i2
for i in range(1, n_qubits):
res = np.kron(res, mat if i == q else i2)
return res
def cz_mat(q1, q2):
diag = np.ones(dim, dtype=complex)
for b in range(dim):
if ((b >> (n_qubits - 1 - q1)) & 1) and ((b >> (n_qubits - 1 - q2)) & 1):
diag[b] = -1.0
return np.diag(diag)
run_q, run_mat = None, None
for op in ops:
if op[0] == "CZ":
if run_q is not None:
total = embed1(run_mat, run_q) @ total
run_q = None
total = cz_mat(op[1], op[2]) @ total
else:
gi, q = op
if run_q == q:
run_mat = GENS[gi] @ run_mat
else:
if run_q is not None:
total = embed1(run_mat, run_q) @ total
run_q, run_mat = q, GENS[gi]
if run_q is not None:
total = embed1(run_mat, run_q) @ total
return total
def eval_word_su2(word):
"""Reconstruct exact SU(2) product matrix from primitive indices."""
mat = np.eye(2, dtype=complex)
for gi in word:
mat = GENS[gi] @ mat
return mat
def proj_op_norm(target, approx):
"""Phase-aligned operator norm distance between two unitaries."""
phi = np.angle(np.trace(target.conj().T @ approx))
return float(np.linalg.norm(target - np.exp(-1j * phi) * approx, 2))
# 1. Single-qubit SU(2) Dawson-Nielsen refinement on seeded U_target
u_raw = qt.rand_unitary(2, seed=42).full()
u_su2_target = u_raw / np.sqrt(np.linalg.det(u_raw))
print(f"SU(2) base net size (L0 <= 18): {len(NET_MATS)}")
print("depth | gate_count | ||U - U_n||_op | word_check")
for d in range(6):
w_d, u_d = sk_compile(u_su2_target, d)
err_d = float(np.linalg.norm(u_su2_target - u_d, 2))
w_chk = float(np.linalg.norm(u_d - eval_word_su2(w_d), 2))
assert w_chk < 1e-12
if d == 5:
assert err_d < 1e-6
print(f"{d:5d} | {len(w_d):10d} | {err_d:14.3e} | {w_chk:10.2e}")
# 2. Multi-qubit SU(2^n) compilation into {H, T, CZ} (QSD + SK depth 4)
rng = np.random.default_rng(42)
print("qubits | group | CZ_gates | 1q_gates | projective_error")
for nq in (1, 2, 3):
dim = 1 << nq
raw = rng.normal(size=(dim, dim)) + 1j * rng.normal(size=(dim, dim))
q_mat, r_mat = np.linalg.qr(raw)
q_mat *= np.sign(np.diag(r_mat))
u_nq = q_mat / (np.linalg.det(q_mat) ** (1.0 / dim))
ops = []
qsd_compile(u_nq, list(range(nq)), 4, ops)
assert all(op[0] in (0, 1, 2, 3, "CZ") for op in ops)
u_approx = evaluate_ops(ops, nq)
err_nq = proj_op_norm(u_nq, u_approx)
assert err_nq < 1e-3
cz_count = sum(1 for op in ops if op[0] == "CZ")
oneq_count = len(ops) - cz_count
grp = f"SU({dim})"
print(f"{nq:6d} | {grp:<6s} | {cz_count:8d} | {oneq_count:10d} | {err_nq:16.3e}")
Simulation Results:
SU(2) base net size (L0 <= 18): 27544
depth | gate_count | ||U - U_n||_op | word_check
0 | 16 | 2.883e-02 | 0.00e+00
1 | 78 | 5.556e-02 | 7.19e-16
2 | 400 | 1.273e-02 | 1.83e-15
3 | 1692 | 6.395e-04 | 9.01e-15
4 | 8716 | 2.653e-05 | 5.13e-14
5 | 40900 | 2.944e-07 | 2.95e-13
qubits | group | CZ_gates | 1q_gates | projective_error
1 | SU(2) | 0 | 8275 | 3.374e-05
2 | SU(4) | 6 | 86793 | 2.497e-04
3 | SU(8) | 36 | 445113 | 5.907e-04
Conclusion: Using the -word base net () over , recursive Dawson-Nielsen Solovay-Kitaev refinement reduces the operator-norm error on the seeded target from at depth to at depth (with exact gate-word agreement within ). Coupling the depth- single-qubit compiler with recursive Quantum Shannon Decomposition and entanglers compiles Haar-random targets across qubits directly into primitive gate sequences, achieving phase-aligned operator-norm errors of for , for ( gates, single-qubit gates), and for ( gates, single-qubit gates). These compiled sequences verify constructive Solovay-Kitaev universality for the admitted gate set modulo global phase.
In Plain English:
Section 10.9.4.1 formalizes the properties of the QBD calculation regarding solovay-kitaev verification.
10.9.5.1 Calculation: Shor's Algorithm
Demonstration of the computational power and fault tolerance established in the Group Closure §10.9.4 and the Solovay-Kitaev Density §10.9.3.1 is based on the following protocols:
- Circuit Compilation: Construct the gate-level Beauregard (-qubit) quantum modular multiplication and semiclassical IQFT circuits strictly from elementary one- and two-qubit operations (
H,X,RZ,CNOT,CP), verifying thatCNOTand decompose into and checking exact reversible modular multiplication on with . - Multi-Semiprime Factoring: Run noiseless circuit sampling across (), (), and (), extracting periods and prime factors via continued fractions (
limit_denominator(N)), two-shot LCM aggregation, and . - Gate-Noise Sweep: Inject stochastic Pauli depolarizing faults after every one- and two-qubit gate on the -qubit circuit across to measure harmonic peak lock, single-shot recovery, and two-shot LCM recovery.
# §10.9.5.1 — Gate-compiled Beauregard Shor factoring across N=15, 21, 35
import math
from fractions import Fraction
import numpy as np
H_MAT = np.array([[1, 1], [1, -1]], dtype=np.complex128) / np.sqrt(2.0)
X_MAT = np.array([[0, 1], [1, 0]], dtype=np.complex128)
Y_MAT = np.array([[0, -1j], [1j, 0]], dtype=np.complex128)
Z_MAT = np.array([[1, 0], [0, -1]], dtype=np.complex128)
PAULIS = (X_MAT, Y_MAT, Z_MAT)
class Circuit2Q:
"""Statevector simulator restricted to 1-qubit gates and 2-qubit entanglers."""
def __init__(self, n_qubits):
self.n = n_qubits
idx = np.arange(1 << n_qubits)
self.q0 = [idx[((idx >> (n_qubits - 1 - q)) & 1) == 0] for q in range(n_qubits)]
self.q1 = [idx[((idx >> (n_qubits - 1 - q)) & 1) == 1] for q in range(n_qubits)]
self.pair11 = {
(a, b): idx[
(((idx >> (n_qubits - 1 - a)) & 1) == 1)
& (((idx >> (n_qubits - 1 - b)) & 1) == 1)
]
for a in range(n_qubits)
for b in range(n_qubits)
if a != b
}
self.cx0 = {
(c, t): idx[
(((idx >> (n_qubits - 1 - c)) & 1) == 1)
& (((idx >> (n_qubits - 1 - t)) & 1) == 0)
]
for c in range(n_qubits)
for t in range(n_qubits)
if c != t
}
self.cx1 = {
(c, t): idx[
(((idx >> (n_qubits - 1 - c)) & 1) == 1)
& (((idx >> (n_qubits - 1 - t)) & 1) == 1)
]
for c in range(n_qubits)
for t in range(n_qubits)
if c != t
}
def apply_1q(self, v, q, mat):
i0, i1 = self.q0[q], self.q1[q]
a, b = v[i0].copy(), v[i1].copy()
v[i0] = mat[0, 0] * a + mat[0, 1] * b
v[i1] = mat[1, 0] * a + mat[1, 1] * b
def inject_noise(self, v, p, rng, *qs):
if p <= 0.0:
return
if len(qs) == 1:
if rng.random() < p:
self.apply_1q(v, qs[0], PAULIS[int(rng.integers(3))])
elif rng.random() < p:
code = int(rng.integers(1, 16))
p1, p2 = code >> 2, code & 3
if p1:
self.apply_1q(v, qs[0], PAULIS[p1 - 1])
if p2:
self.apply_1q(v, qs[1], PAULIS[p2 - 1])
def g1(self, v, q, mat, p=0.0, rng=None):
self.apply_1q(v, q, mat)
self.inject_noise(v, p, rng, q)
def rz(self, v, q, phase, p=0.0, rng=None):
v[self.q1[q]] *= phase
self.inject_noise(v, p, rng, q)
def cnot(self, v, c, t, p=0.0, rng=None):
c0, c1 = self.cx0[(c, t)], self.cx1[(c, t)]
v[c0], v[c1] = v[c1].copy(), v[c0].copy()
self.inject_noise(v, p, rng, c, t)
def cphase(self, v, q1, q2, phase, p=0.0, rng=None):
v[self.pair11[(q1, q2)]] *= phase
self.inject_noise(v, p, rng, q1, q2)
def verify_primitive_identities():
"""Confirm CNOT and CR_k decompose exactly into {H, CZ, R_z}."""
cz = np.diag([1.0, 1.0, 1.0, -1.0])
ih = np.kron(np.eye(2), H_MAT)
cnot_ref = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], dtype=float)
assert np.linalg.norm(ih @ cz @ ih - cnot_ref, 2) < 1e-13
for k in (2, 3, 4, 8):
ang = np.pi / (1 << (k - 1))
cp_ref = np.diag([1.0, 1.0, 1.0, np.exp(1j * ang)])
rz_p = np.diag([np.exp(-0.25j * ang), np.exp(0.25j * ang)])
rz_m = np.diag([np.exp(0.25j * ang), np.exp(-0.25j * ang)])
synth = np.exp(0.25j * ang) * np.kron(rz_p, rz_p) @ cnot_ref @ np.kron(np.eye(2), rz_m) @ cnot_ref
assert np.linalg.norm(synth - cp_ref, 2) < 1e-13
def emit_ccphase(c1, c2, t, phi, ops):
if abs(phi) < 1e-14:
return
hp, hm = np.exp(0.5j * phi), np.exp(-0.5j * phi)
ops.extend([("CP", c2, t, hp), ("CNOT", c1, c2), ("CP", c2, t, hm), ("CNOT", c1, c2), ("CP", c1, t, hp)])
def emit_qft(b, ops):
nb = len(b)
for j in range(nb):
ops.append(("H", b[j]))
for k in range(j + 1, nb):
ops.append(("CP", b[k], b[j], np.exp(1j * np.pi / (1 << (k - j)))))
def emit_iqft(b, ops):
nb = len(b)
for j in range(nb - 1, -1, -1):
for k in range(nb - 1, j, -1):
ops.append(("CP", b[k], b[j], np.exp(-1j * np.pi / (1 << (k - j)))))
ops.append(("H", b[j]))
def emit_phi_add(b, val, sign, ctrls, ops):
nb = len(b)
for j, q in enumerate(b):
ang = sign * 2.0 * np.pi * val / (1 << (nb - j))
if abs(ang) < 1e-14:
continue
if not ctrls:
ops.append(("RZ", q, np.exp(1j * ang)))
elif len(ctrls) == 1:
ops.append(("CP", ctrls[0], q, np.exp(1j * ang)))
else:
emit_ccphase(ctrls[0], ctrls[1], q, ang, ops)
def emit_cc_add_mod(c1, c2, b, anc, val, mod_n, ops):
msb = b[0]
emit_phi_add(b, val, +1, (c1, c2), ops)
emit_phi_add(b, mod_n, -1, (), ops)
emit_iqft(b, ops)
ops.append(("CNOT", msb, anc))
emit_qft(b, ops)
emit_phi_add(b, mod_n, +1, (anc,), ops)
emit_phi_add(b, val, -1, (c1, c2), ops)
emit_iqft(b, ops)
ops.extend([("X", msb), ("CNOT", msb, anc), ("X", msb)])
emit_qft(b, ops)
emit_phi_add(b, val, +1, (c1, c2), ops)
def emit_cc_sub_mod(c1, c2, b, anc, val, mod_n, ops):
msb = b[0]
emit_phi_add(b, val, -1, (c1, c2), ops)
emit_iqft(b, ops)
ops.extend([("X", msb), ("CNOT", msb, anc), ("X", msb)])
emit_qft(b, ops)
emit_phi_add(b, val, +1, (c1, c2), ops)
emit_phi_add(b, mod_n, -1, (anc,), ops)
emit_iqft(b, ops)
ops.append(("CNOT", msb, anc))
emit_qft(b, ops)
emit_phi_add(b, mod_n, +1, (), ops)
emit_phi_add(b, val, -1, (c1, c2), ops)
def build_mult_ops(c, x, b, anc, a_val, mod_n):
m = len(x)
ops = []
emit_qft(b, ops)
for j in range(m):
emit_cc_add_mod(c, x[j], b, anc, (a_val * (1 << (m - 1 - j))) % mod_n, mod_n, ops)
emit_iqft(b, ops)
for j in range(m):
xq, bq = x[j], b[1 + j]
ops.extend([("CNOT", bq, xq), ("H", bq)])
emit_ccphase(c, xq, bq, np.pi, ops)
ops.extend([("H", bq), ("CNOT", bq, xq)])
a_inv = pow(a_val, -1, mod_n)
emit_qft(b, ops)
for j in range(m - 1, -1, -1):
emit_cc_sub_mod(c, x[j], b, anc, (a_inv * (1 << (m - 1 - j))) % mod_n, mod_n, ops)
emit_iqft(b, ops)
return ops
def run_ops(circ, v, ops, p, rng):
for op in ops:
k = op[0]
if k == "H":
circ.g1(v, op[1], H_MAT, p, rng)
elif k == "X":
circ.g1(v, op[1], X_MAT, p, rng)
elif k == "RZ":
circ.rz(v, op[1], op[2], p, rng)
elif k == "CNOT":
circ.cnot(v, op[1], op[2], p, rng)
else:
circ.cphase(v, op[1], op[2], op[3], p, rng)
def verify_multiplier_unitary(mod_n, a_val, circ):
"""Verify exact reversible modular multiplication on x in {1, N-2}."""
m = mod_n.bit_length()
x = list(range(1, m + 1))
b = list(range(m + 1, 2 * m + 2))
ops = build_mult_ops(0, x, b, 2 * m + 2, a_val, mod_n)
for y_in in (1, mod_n - 2):
v = np.zeros(1 << (2 * m + 3), dtype=np.complex128)
v[(1 << (2 * m + 2)) | (y_in << (m + 2))] = 1.0
run_ops(circ, v, ops, 0.0, None)
idx_exp = (1 << (2 * m + 2)) | (((a_val * y_in) % mod_n) << (m + 2))
assert abs(abs(v[idx_exp]) - 1.0) < 1e-11
def build_stage_table(mod_n, a_base, t_bits):
m = mod_n.bit_length()
x = list(range(1, m + 1))
b = list(range(m + 1, 2 * m + 2))
anc = 2 * m + 2
return [build_mult_ops(0, x, b, anc, pow(a_base, 1 << (t_bits - 1 - s), mod_n), mod_n) for s in range(t_bits)]
def shor_shot(mod_n, t_bits, stages, circ, p, rng):
m = mod_n.bit_length()
n_tot = 2 * m + 3
v = np.zeros(1 << n_tot, dtype=np.complex128)
v[1 << (m + 2)] = 1.0 # c=0, x=1, b=0, anc=0
bits = []
half = 1 << (n_tot - 1)
gates_run = 0
for s in range(t_bits):
circ.g1(v, 0, H_MAT, p, rng)
run_ops(circ, v, stages[s], p, rng)
gates_run += len(stages[s]) + 2
rot = -sum(bits[j] * np.pi / (1 << (s - j)) for j in range(s))
if abs(rot) > 1e-14:
circ.rz(v, 0, np.exp(1j * rot), p, rng)
gates_run += 1
circ.g1(v, 0, H_MAT, p, rng)
p1 = float(np.sum(np.abs(v[half:]) ** 2))
bit = 1 if rng.random() < p1 else 0
bits.append(bit)
if bit == 1:
v[:half] = 0.0
v /= math.sqrt(max(p1, 1e-30))
circ.g1(v, 0, X_MAT, p, rng)
gates_run += 1
else:
v[half:] = 0.0
v /= math.sqrt(max(1.0 - p1, 1e-30))
return sum(bits[j] << j for j in range(t_bits)), gates_run
def cf_period(x_meas, t_bits, mod_n):
return 1 if x_meas <= 0 else Fraction(x_meas, 1 << t_bits).limit_denominator(mod_n).denominator
def extract_factors(mod_n, a_base, r_cand):
for mult in (r_cand, 2 * r_cand):
if mult > 0 and mult % 2 == 0 and pow(a_base, mult, mod_n) == 1:
g = math.gcd(pow(a_base, mult // 2, mod_n) - 1, mod_n)
if 1 < g < mod_n:
return mult, (min(g, mod_n // g), max(g, mod_n // g))
return None
def is_harmonic(x_meas, t_bits, r_true):
"""True when measurement x_meas lies within +-1.5 bins of s * 2^t / r."""
scale = 1 << t_bits
return any(abs(x_meas - (s * scale) / r_true) <= 1.5 for s in range(r_true + 1))
verify_primitive_identities()
rng = np.random.default_rng(42)
# 1. Noiseless Beauregard factoring benchmark across N=15, 21, 35
print("N | a | t | qubits | mean_gates | r_est | factors | peak_lock | single_P | lcm2_P")
n21_noiseless = []
cases = [(15, 7, 8, 4, 40), (21, 2, 9, 6, 40), (35, 2, 11, 12, 10)]
for mod_n, a_base, t_bits, r_true, shots in cases:
m = mod_n.bit_length()
assert (1 << t_bits) >= mod_n * mod_n and (1 << (t_bits - 1)) < mod_n * mod_n
circ = Circuit2Q(2 * m + 3)
verify_multiplier_unitary(mod_n, pow(a_base, 2, mod_n), circ)
stages = build_stage_table(mod_n, a_base, t_bits)
runs = [shor_shot(mod_n, t_bits, stages, circ, 0.0, rng) for _ in range(shots)]
meas = [r[0] for r in runs]
mean_g = int(round(np.mean([r[1] for r in runs])))
if mod_n == 21:
n21_noiseless = meas
lock_p = float(np.mean([is_harmonic(xm, t_bits, r_true) for xm in meas]))
assert lock_p > 0.70
single_hits = []
r_found = None
factors_found = None
for xm in meas:
res = extract_factors(mod_n, a_base, cf_period(xm, t_bits, mod_n))
single_hits.append(res is not None)
if res is not None and factors_found is None:
r_found, factors_found = res
pair_hits = []
for i in range(0, len(meas) - 1, 2):
r1 = cf_period(meas[i], t_bits, mod_n)
r2 = cf_period(meas[i + 1], t_bits, mod_n)
res = extract_factors(mod_n, a_base, math.lcm(r1, r2))
pair_hits.append(res is not None)
if res is not None and factors_found is None:
r_found, factors_found = res
assert factors_found is not None
f_str = f"{factors_found[0]}x{factors_found[1]}"
print(
f"{mod_n:<2d} | {a_base} | {t_bits:<2d} | {2*m+3:<6d} | {mean_g:<10d} "
f"| {r_found:<5d} | {f_str:<7s} | {lock_p:9.2f} | {np.mean(single_hits):8.2f} | {np.mean(pair_hits):6.2f}"
)
# 2. Per-gate depolarizing noise sweep on N=21 (13 qubits, ~18.3k gates/shot)
c21 = Circuit2Q(13)
s21 = build_stage_table(21, 2, 9)
print("p_gate | shots | peak_lock | single_P | lcm2_P")
for p in (0.0, 3e-5, 1e-4, 3e-4, 1e-3):
draws = n21_noiseless if p == 0.0 else [shor_shot(21, 9, s21, c21, p, rng)[0] for _ in range(36)]
lock_p = float(np.mean([is_harmonic(xm, 9, 6) for xm in draws]))
s_hits = [extract_factors(21, 2, cf_period(xm, 9, 21)) is not None for xm in draws]
p_hits = [
extract_factors(21, 2, math.lcm(cf_period(draws[i], 9, 21), cf_period(draws[i + 1], 9, 21))) is not None
for i in range(0, len(draws) - 1, 2)
]
print(f"{p:8.1e} | {len(draws):5d} | {lock_p:9.2f} | {np.mean(s_hits):8.2f} | {np.mean(p_hits):6.2f}")
Simulation Results:
N | a | t | qubits | mean_gates | r_est | factors | peak_lock | single_P | lcm2_P
15 | 7 | 8 | 11 | 10321 | 4 | 3x5 | 1.00 | 0.62 | 0.75
21 | 2 | 9 | 13 | 18287 | 6 | 3x7 | 0.90 | 0.57 | 0.85
35 | 2 | 11 | 15 | 32881 | 12 | 5x7 | 0.80 | 0.60 | 1.00
p_gate | shots | peak_lock | single_P | lcm2_P
0.0e+00 | 40 | 0.90 | 0.57 | 0.85
3.0e-05 | 36 | 0.67 | 0.50 | 0.67
1.0e-04 | 36 | 0.39 | 0.33 | 0.44
3.0e-04 | 36 | 0.14 | 0.19 | 0.28
1.0e-03 | 36 | 0.06 | 0.19 | 0.33
Conclusion: Executing the gate-compiled Beauregard architecture strictly with one- and two-qubit operations recovers the true periods and factors across all three benchmarks ( with over gates; with non-dyadic over gates; and with over gates), with two-shot LCM pairing lifting noiseless recovery on from to and reaching on the pairs. Under per-gate depolarizing trajectories on , harmonic peak lock drops from at to at , at , and at , demonstrating quantitatively why unencoded gate sequences of depth require sub- logical error rates supplied by fault-tolerant encoding.
In Plain English:
Section 10.9.5.1 formalizes the properties of the QBD calculation regarding shor's algorithm.