Papers
Topics
Authors
Recent
Search
2000 character limit reached

Code Transformation Graph (CTG)

Updated 22 March 2026
  • 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 n,k,d\llbracket n,k,d \rrbracket, 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 C\mathcal{C} be the class of all CSS codes. The CTG is given by CTG=(V,E)CTG=(V,E) with

  • V={CCC has parameters n,k,d for some n,k,d}V = \{ C \in \mathcal{C}\,|\,C\text{ has parameters }\llbracket n,k,d \rrbracket \text{ for some } n,k,d\},
  • E={(C1C2,R)R is a sequence of ZX-diagram rewrites converting EC1EC2}E = \{ (C_1 \to C_2, R)\,|\,R \text{ is a sequence of ZX-diagram rewrites converting } E_{C_1} \mapsto E_{C_2}\}.

For each vertex CVC \in V, EC:C2kC2nE_C: \mathbb{C}^{2^k} \to \mathbb{C}^{2^n} is the encoding isometry of code CC, specified in ZX normal form. This ZX diagram is composed of mm Z-spiders (one for each X-type stabilizer generator SiXS^X_i), kk blue Z-spiders (for the logical X operators Xj\overline{X}_j), all connected to nn 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 EC1E_{C_1} to EC2E_{C_2}. 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 LL on the kk logical wires, the relation

ECL=PECE_C \circ L = P \circ E_C

holds, where PP is the unique “push-through” ZX subdiagram on the nn physical qubits, determined using strong complementarity and the ZX-normal form of ECE_C. This rule, denoted (BR), guarantees that any logical operation implementable by LL admits an explicit, generally non-transversal, physical realization PP in the code. In the CTG, such edges from CC 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 RR of its physical qubits. In ZX graphical terms:

  • In ECparentE_{C_\text{parent}}, a subset RR of X-spiders (physical qubits) is selected.
  • All Z-spiders with support on both RR and its complement R\overline{R} are “unfused.”
  • Identity X-spiders are inserted on newly formed edges, and wires entirely in RR are “cut.”

The excised subdiagram yields EC(R)E_{C(R)} (a “child code”), and the remainder is the morphed code ECRE_{C\setminus R}. Both inherit certain logical structure from the parent, with kk preserved in CRC_{\setminus R} and transversal gates inherited accordingly. In the CTG, these “(morph)” edges are recorded as

C=n,k,morph on RC(R),CRCR.C=\llbracket n,k,\ldots\rrbracket \xrightarrow{\text{morph on }R} C(R), \qquad C \xrightarrow{\setminus R} C_{\setminus R}.

A concrete instance is the transformation from the Steane code 7,1,3\llbracket 7,1,3 \rrbracket with R={2,3,6,7}R=\{2,3,6,7\} resulting in C(R)=4,3,1C(R)=\llbracket 4,3,1 \rrbracket and CR=6,1,1C_{\setminus R}=\llbracket 6,1,1 \rrbracket (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 Csub=15,1;3C_\text{sub}=\llbracket 15,1;3 \rrbracket with r=3r=3 gauge qubits, generating two associated codes: the extended Steane code CexC_\text{ex} and the quantum Reed-Muller code CqrmC_\text{qrm}. The transformation proceeds as:

  • ZX-normal form for ECsubE_{C_\text{sub}} includes Z-spiders for X-stabilizers, Z-spiders for gauge-X operators giXg^X_i (i=1,2,3i=1,2,3), and a blue Z-spider for the logical X.
  • The (π-copy)(\pi\text{-copy}) rule is applied to gauge Z-spiders based on syndrome outcomes ki{0,1}k_i \in \{0,1\}, converting them to X-phase π\pi spiders.
  • The push-through rule (BR) maps these phases back to the logical-gauge layer.
  • Measurement (collapsing Z-spiders to +|+\rangle or 0|0\rangle) and, if necessary, Pauli recovery, yields either CexC_\text{ex} or CqrmC_\text{qrm} as encoded in edges:

Csub+ (measure giX,apply (giZ)ki)Cex,C_{\mathrm{sub}} \xrightarrow{+\ \text{(measure }g^X_i,\, \text{apply }(g^Z_i)^{k_i})} C_{\mathrm{ex}},

Csub+ (measure giZ,apply (giX)i)Cqrm.C_{\mathrm{sub}} \xrightarrow{+\ \text{(measure }g^Z_i,\, \text{apply }(g^X_i)^{\ell_i})} C_{\mathrm{qrm}}.

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 7,1,3\llbracket 7,1,3 \rrbracket (Steane), 15,1,3ex\llbracket 15,1,3 \rrbracket_\text{ex} (extended Steane), 15,1,3qrm\llbracket 15,1,3 \rrbracket_\text{qrm} (QRM), and 15,1;3sub\llbracket 15,1;3 \rrbracket_\text{sub} (subsystem code), with the following transformations:

Transformation Source Target CTG Edge Label
Ancilla embedding 7,1,3\llbracket 7,1,3 \rrbracket 15,1;3sub\llbracket 15,1;3 \rrbracket_\text{sub} add gauge qubits
Gauge-fix X 15,1;3sub\llbracket 15,1;3 \rrbracket_\text{sub} 15,1,3ex\llbracket 15,1,3 \rrbracket_\text{ex} gauge-fix X
Gauge-fix Z 15,1;3sub\llbracket 15,1;3 \rrbracket_\text{sub} 15,1,3qrm\llbracket 15,1,3 \rrbracket_\text{qrm} gauge-fix Z
Remove ancillas (reverse) 15,1,3\llbracket 15,1,3 \rrbracket_{\ast} 7,1,3\llbracket 7,1,3 \rrbracket 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 TT gate, via the sequence: Steane \rightarrow Subsystem (add ancillas) \rightarrow 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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Code Transformation Graph (CTG).