Two spiders of the same colour joined by at least one wire fuse into one spider whose phase is the sum of theirs; together with colour change, pi-copy and the bialgebra rule these identities, with explicit scalars, are the core rewrites of the ZX calculus.
Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
Write Zαa,b and Xαa,b for the interpretations of the spiders. Then:
Fusion. If k≥1 outputs of Zαa1,b1+k are connected to k inputs of
Zβa2+k,b2, the result is Zα+βa1+a2,b1+b2. A wire joining
a spider to itself can be deleted. The same holds for X spiders.
Identity.Z01,1=X01,1=I.
Colour change.Xαa,b=H⊗bZαa,bH⊗a, and HH=I.
π-copy.Zα1,bXπ1,1=eiα(Xπ1,1)⊗bZ−α1,b,
where Xπ1,1 is the Pauli X.
Copy.Z01,b∣0⟩=∣0⟩⊗b, Z01,b∣1⟩=∣1⟩⊗b, and
X00,1=2∣0⟩.
Rules 1, 3 and 6 (each up to scalars) are among the original axioms of
Coecke and Duncan, and rule 4 follows from their two π rules
(K1, K2) together with fusion; the textbook treatment with scalars is
Coecke and Kissinger. By colour change, every rule has a version with
the colours swapped.
Holds when
Interpretation of ZX diagrams as linear maps with the unnormalised spiders defined there; scalars are stated exactly, not dropped.
since ⟨y∣x⟩k=δxy for k≥1. A self-loop contracts an output with an input of
the same term, contributing ⟨x∣x⟩=1, so it can be removed. For X spiders conjugate by
Hadamards (rule 3), which commute with contraction because H is real and symmetric, so
∑jHijHjk=δik along each internal wire.
2. Identity.Z01,1=∣0⟩⟨0∣+∣1⟩⟨1∣=I, and X01,1=∣+⟩⟨+∣+∣−⟩⟨−∣=I.
3. Colour change.H∣x⟩=∣±⟩ for x=0,1, so
H⊗bZαa,bH⊗a=∣+⟩⊗b⟨+∣⊗a+eiα∣−⟩⊗b⟨−∣⊗a,
using H†=H. And H2=I by multiplying the matrices.
4. π-copy.Xπ1,1=∣+⟩⟨+∣−∣−⟩⟨−∣ is the Pauli X, which maps
∣x⟩↦∣1−x⟩. Hence
Zα1,bX=∑xeiαx∣x⟩⊗b⟨1−x∣=∑yeiα(1−y)∣1−y⟩⊗b⟨y∣=eiαX⊗b∑ye−iαy∣y⟩⊗b⟨y∣=eiαX⊗bZ−α1,b.
5. Copy. The first two identities are immediate from the definition. For the last,
X00,1=∣+⟩+∣−⟩=2∣0⟩.
6. Bialgebra. Both sides are maps from two qubits to two qubits; compare them on basis states.
First, X02,1=∣+⟩(⟨+∣⟨+∣)+∣−⟩(⟨−∣⟨−∣) sends
∣x1x2⟩↦21[(∣+⟩+(−1)x1+x2∣−⟩)]=21∣x1⊕x2⟩,
since ⟨−∣x⟩=(−1)x/2. So the left side sends
∣x1x2⟩↦21∣x1⊕x2⟩∣x1⊕x2⟩. On the right side,
Z01,2⊗Z01,2 sends ∣x1x2⟩↦∣x1x1x2x2⟩, the middle swap reorders
this to ∣x1x2x1x2⟩, and X02,1⊗X02,1 gives
21∣x1⊕x2⟩∣x1⊕x2⟩. Multiplying by 2 matches the left side.
The same calculation shows 2(Z01,2⊗I) followed by (I⊗X02,1) is the
CNOT gate with the Z spider on the control, ∣x1x2⟩↦∣x1⟩∣x1⊕x2⟩. These
computations are the standard ones of Coecke and Kissinger.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
All six identities, with the stated scalars (sqrt 2 in copy and bialgebra, e^{i alpha} in pi-copy), checked numerically with numpy tensors (fusion with one and two connecting wires, pi-copy for b = 1..3, bialgebra, colour change for several arities); self-loop removal re-derived by hand. Attribution compared with Coecke and Duncan, arXiv 0906.4725, Figure 1 and Section 2.2 (rules S1, S2, B1, B2, K1, K2, C).
The record said the pi-copy rule (rule 4) is one of Coecke and Duncan's original axioms; their axioms are K1 (pi commutes with the other colour's copy map) and K2 (pi inverts phases), from which rule 4 follows with fusion. Reworded that attribution.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
Current revision 1e54f1b352d8163f. Source file knowledge/records/theorem/zx-spider-fusion.md in the content repository (readable there once it is public).