Code Transformation Graph (CTG)
- CTG is a directed graph where vertices represent CSS codes and edges denote explicit ZX-diagram rewrite sequences, ensuring precise code transformation.
- It employs bidirectional logical-to-physical rewrite rules that map phase-free logical operations to their non-transversal physical realizations for fault tolerance.
- CTG facilitates practical procedures such as code morphing and gauge fixing, providing a structured method to derive physical circuit implementations from abstract code transformations.
A Code Transformation Graph (CTG) is a directed graph whose vertices are CSS codes with parameters , and whose edges represent explicit code transformations articulated via sequences of ZX-diagram rewrites connecting code encoding maps in phase-free ZX normal form. The CTG structure provides a rigorous graphical framework for analyzing interrelations among CSS codes and implementing procedures such as code morphing and gauge fixing, as well as facilitating the derivation of physical implementations of logical operators through diagrammatic means (Huang et al., 2023).
1. Formal Definition and Construction
Let be the class of all CSS codes. The CTG is given by with
- ,
- .
For each vertex , is the encoding isometry of code , specified in ZX normal form. This ZX diagram is composed of Z-spiders (one for each X-type stabilizer generator ), blue Z-spiders (for the logical X operators ), all connected to X-spiders corresponding to each physical qubit, with diagrammatic wiring encoding support structure and operator action.
Edges of the CTG are labeled by the specific ZX-rewrite sequences that witness the transformation from to . This framework ensures that each transformation is both explicit and directly traceable in the graphical formalism of the ZX calculus (Huang et al., 2023).
2. Bidirectional Logical-to-Physical Rewrite
A key structural edge in the CTG is induced by the bidirectional rewrite rule (Proposition 3.1 in (Huang et al., 2023)). Given any phase-free ZX subdiagram on the logical wires, the relation
holds, where is the unique “push-through” ZX subdiagram on the physical qubits, determined using strong complementarity and the ZX-normal form of . This rule, denoted (BR), guarantees that any logical operation implementable by admits an explicit, generally non-transversal, physical realization in the code. In the CTG, such edges from to itself are systematically labeled (BR), and they encode the capacity to derive physical circuits or measurements corresponding to arbitrary logical phase-free ZX transformations.
3. Code Morphing Transformations
Code morphing constitutes a transformation in which a parent code is altered by the selection and operation on a subset of its physical qubits. In ZX graphical terms:
- In , a subset of X-spiders (physical qubits) is selected.
- All Z-spiders with support on both and its complement are “unfused.”
- Identity X-spiders are inserted on newly formed edges, and wires entirely in are “cut.”
The excised subdiagram yields (a “child code”), and the remainder is the morphed code . Both inherit certain logical structure from the parent, with preserved in and transversal gates inherited accordingly. In the CTG, these “(morph)” edges are recorded as
A concrete instance is the transformation from the Steane code with resulting in and (Huang et al., 2023).
4. Gauge Fixing and Code Switching
Gauge fixing (code switching) in the CTG pertains to transitions between subsystem codes and complementary CSS codes via measurement and recovery procedures. Consider a CSS subsystem code with gauge qubits, generating two associated codes: the extended Steane code and the quantum Reed-Muller code . The transformation proceeds as:
- ZX-normal form for includes Z-spiders for X-stabilizers, Z-spiders for gauge-X operators (), and a blue Z-spider for the logical X.
- The rule is applied to gauge Z-spiders based on syndrome outcomes , converting them to X-phase spiders.
- The push-through rule (BR) maps these phases back to the logical-gauge layer.
- Measurement (collapsing Z-spiders to or ) and, if necessary, Pauli recovery, yields either or as encoded in edges:
Here, denotes discarding gauge qubits and the bracketed Paulis describe conditionally enacted recoveries read off from the ZX diagram (Huang et al., 2023).
5. Example: Steane–Reed-Muller Subgraph
An explicit CTG subgraph can be constructed for the codes (Steane), (extended Steane), (QRM), and (subsystem code), with the following transformations:
| Transformation | Source | Target | CTG Edge Label |
|---|---|---|---|
| Ancilla embedding | add gauge qubits | ||
| Gauge-fix X | gauge-fix X | ||
| Gauge-fix Z | gauge-fix Z | ||
| Remove ancillas (reverse) | discard ancillas |
Each arrow corresponds to a precise ZX-rewrite process, and the reversibility (by e.g. discarding ancillas) can also be represented as edges in the CTG. This subgraph enables, for instance, algorithmic conversion from Steane to QRM code in order to access a transversal gate, via the sequence: Steane Subsystem (add ancillas) QRM (gauge-fix Z). The ZX calculus prescribes all measurement and recovery operations along this path (Huang et al., 2023).
6. Structural and Practical Implications
The CTG organizes the landscape of CSS codes and their relationships as a navigable network of explicit, diagrammatically certified transformations. All fault-tolerant transformations captured by code morphing, gauge fixing, and the bidirectional push-through rule become traceable paths. The edges encode sufficient information to extract the sequence of ZX diagram manipulations (including measurements, wire cuts, and recovery operations) corresponding to code switching or logical gate implementation in physical circuits. This formalism thus serves both as a research tool for investigating code structure and as a practical map for constructing fault-tolerant protocols for universal quantum computation between well-characterized codes (Huang et al., 2023).