---
title: 'Discard ZX-Calculus: A Mixed-State Extension'
url: https://www.emergentmind.com/topics/discard-zx-calculus
type: topic
---

# Discard ZX-Calculus: A Mixed-State Extension

Searching arXiv for the cited work and closely related discard ZX-calculus papers.
Discard ZX-calculus is a graphical calculus for mixed-state quantum mechanics obtained from the pure ZX-calculus by a CPM construction in which every pure morphism is doubled into ket and bra wires and a new generator, the discard map, models partial trace. In the formulation used in “Infrared Safety from ZX-Diagrams” [2606.29804], it is a diagrammatic language for completely positive trace-preserving maps, Schur channels, Lindblad evolution, and non-Markovian process tensors; related work also presents discard extensions that are complete for mixed-state stabiliser quantum mechanics in odd prime dimensions [2204.12531] and studies a decohered fragment that is universal and complete for affinely supported probability distributions over $\mathbb{F}_2^n$ [2508.04296].

## 1. Definition and categorical setting

In the CPM/discard setting, the underlying category is a $^\dagger$-compact closed category: the ordinary pure ZX-calculus provides objects as wires and morphisms as spiders and their compositions, and the CPM construction passes to a category $\mathrm{CPM}(C)$ whose objects are the same wires but whose morphisms are completely positive maps [2606.29804]. In diagrammatic language, each pure morphism is doubled, one copy for ket and one for bra, and a special discard map $\varepsilon:A\to I$ is introduced on each wire.

The categorical interpretation given in the source material makes the discard operation structurally constrained. It obeys naturality,
$\varepsilon_A\circ(f\otimes f^\ast)=\varepsilon_B$ for any isometry or unitary $f:A\to B$, and monoidality,
$\varepsilon_{A\otimes B}=\varepsilon_A\otimes\varepsilon_B$ [2606.29804]. In this setting, spiders, cups, caps, and unitaries all lift to CP maps via the doubling construction.

A closely related generalization appears in odd prime dimensions, where the extended syntax adds a discard or environment node
$\ground:1\to 0$ interpreted as partial trace in $\mathrm{CPM}(\mathrm{Stab}_p)$ [2204.12531]. There, the extended PROP is described as the free environment structure over the pure part, and completeness for mixed-state stabiliser quantum mechanics follows by a discard construction once the pure calculus is complete and there are enough isometries. This suggests that discard ZX-calculus is not merely an ad hoc augmentation of pure ZX, but a systematic categorical passage from pure to mixed-state process theories.

## 2. Generators, syntax, and denotational semantics

The generators presented in the mixed-state setting include Z-spiders, X-spiders, wires, cups, caps, and the discard spider [2606.29804]. A green Z-spider with phase $\alpha$ and arity $(n\text{ in},m\text{ out})$ is interpreted as the linear map
\[
\bigl|x_1\ldots x_n\bigr\rangle\mapsto
\sum_{y\in\{0,1\}}\delta_{x_1\ldots x_n,y}\,
e^{i\alpha\,y}\,\bigl|y^{\otimes m}\bigr\rangle ,
\]
where $\delta_{x_1\ldots x_n,y}=1$ iff all $x_i=y$ [2606.29804]. The red X-spider is identical but in the $\lvert \pm\rangle$ basis, with $\lvert \pm\rangle=(\lvert 0\rangle\pm\lvert 1\rangle)/\sqrt2$.

Cups and caps provide the compact-closed structure. The cap is
$\eta:\mathbb C\to H\otimes H$, $\eta(1)=\sum_i\lvert i,i\rangle$, and the cup is
$\varepsilon:H\otimes H\to\mathbb C$, $\varepsilon(\lvert i,i\rangle)=1$ [2606.29804]. The discard spider is diagrammatically a blue dot with one input on the ket wire and one on the bra wire; semantically it is the trace map $\varepsilon:\rho\mapsto \mathrm{Tr}\,\rho$, and in doubled-wire notation it joins the top and bottom wires of a density operator. The semantic assignment also includes the explicit tensor form
\[
\varepsilon:\lvert i\rangle\otimes\lvert j\rangle\mapsto \delta_{ij}.
\]

A more general prop presentation additionally lists identities, swaps, cups, caps, Hadamard, discard $d:1\to 0$, and global scalars, with arrows denoting CP maps between Hilbert spaces of dimension $2^n$ [2508.04296]. In that semantics, $\llbracket d\rrbracket=\rho\mapsto\mathrm{Tr}(\rho)$, and soundness means that each rewrite rule denotes the same CP map on both sides.

## 3. Rewrite theory and the role of discard

Three rules are singled out as fundamental in the treatment of soft QED: the unitarity rule, cyclicity of trace, and the discard rule [2606.29804]. Unitarity is the ordinary equation $U^\dagger U=I_H$. Cyclicity is the diagrammatic sliding of boxes around a discard loop, corresponding algebraically to $\mathrm{Tr}(AB)=\mathrm{Tr}(BA)$. The discard rule expresses trace preservation for any CPTP channel $E$:
\[
\mathrm{Tr}[E(\rho)]=\mathrm{Tr}\,\rho,
\]
or diagrammatically, discarding after $E$ is the same as discarding immediately. In one equation,
\[
\varepsilon\circ (U\otimes U^\ast)=\varepsilon,
\]
so doubling a unitary and then discarding is equivalent to direct discard.

The same theme appears in the odd-prime stabiliser extension, where discard is required to erase generating pure isometries such as the green unit, red unit, green comultiplication, red comultiplication, and Hadamard box [2204.12531]. The added equations are of the form
\[
\ground\circ f=\ground
\]
for those generators. Their semantic justification is the partial-trace identity
\[
\mathrm{Tr}(f\,\rho\,f^\dagger)=\mathrm{Tr}(\rho)
\]
whenever $f$ is an isometry.

The general mixed-state theory summarized in the decohered ZX work states that discard ZX-calculus is complete and universal for mixed-state quantum mechanics, and that every CP map admits a purification into a unitary plus discard [2508.04296]. Within the provided material, a common misconception is that discard only adds a terminal symbol to a pure graphical language. The data instead emphasize that the discard spider and the axiom $\varepsilon\circ E=\varepsilon$ for CPTP $E$ are essential for representing partial traces, enforcing trace preservation locally, and capturing decoherence as the action of discarding environmental wires [2606.29804].

## 4. Diagrammatic identities and infrared safety

The central application developed in “Infrared Safety from ZX-Diagrams” is a nonperturbative, categorical proof of the Bloch–Nordsieck cancellation of infrared divergences in QED [2606.29804]. Soft photons are treated as an open quantum system: the resolved charged particles and hard photons form the system, while photons below a detector resolution form the environment. The reduced hard channel is a CPTP map, and the soft-photon theorem replaces the full $S$-matrix by a controlled displacement operator whose Feynman–Vernon influence functional satisfies the equal-history normalization
\[
{\cal F}[J,J]=1 .
\]

In the ZX-calculus, this normalization becomes a single diagrammatic identity: the doubled displacement diagram collapses to the bare wire under unitarity, cyclicity, and discard [2606.29804]. For one fixed hard branch $\lvert a\rangle$, the algebraic content is
\[
\mathrm{Tr}\!\left[D(\alpha)\,\lvert a\rangle\langle a\rvert\,D(\alpha)^\dagger\right]
=
\mathrm{Tr}\!\left[\lvert a\rangle\langle a\rvert\right]
=1 .
\]
The derivation is explicitly decomposed into three steps: cyclicity moves $D(\alpha)^\dagger$ around the discard loop to the ket wire, unitarity fuses $D(\alpha)^\dagger D(\alpha)$ into the identity, and the remaining bare wire with discard yields trace one.

For off-diagonal hard-state elements, the same diagram produces the coherent-state overlap
\[
\mathrm{Tr}\!\left[D(\alpha_a)\,\lvert a\rangle\langle b\rvert\,D(\alpha_b)^\dagger\right]
=\langle \alpha_b\vert \alpha_a\rangle ,
\]
with modulus
\[
|\langle \alpha_b\vert \alpha_a\rangle|
=
\exp\!\bigl[-\tfrac12\|\alpha_a-\alpha_b\|^2\bigr].
\]
This is used in the paper as a first-principles account of soft-cloud decoherence. The proof is presented as a categorical consistency check on the companion open-system treatment of soft QED, confirming that the physical derivation is logically complete and free of hidden assumptions about the infrared limit.

## 5. CPTP channels, Schur maps, and Lindblad evolution

The calculus represents arbitrary channels $E:\rho\mapsto\sum_i K_i\rho K_i^\dagger$ as doubled boxes, and trace preservation can be checked locally by attaching discard and simplifying: $\varepsilon\circ E=\varepsilon$ exactly when $\sum_i K_i^\dagger K_i=I$ [2606.29804]. This local form of CPTP verification is one of the operational advantages emphasized in the source material.

The soft-shell coarse-graining of infrared modes is encoded as a CPTP Schur channel. For a shell $\Lambda_1<\omega<\Lambda_2$, the isometry is
\[
V_{21}=\sum_a \lvert a\rangle\langle a\rvert\otimes D(\alpha_a^{21}),
\]
and the channel is
\[
E_{21}[\rho]=\mathrm{Tr}_{\mathrm{shell}}\!\left[V_{21}(\rho\otimes\lvert 0\rangle\langle 0\rvert)V_{21}^\dagger\right].
\]
Projecting the input on $\lvert a\rangle\langle b\rvert$, applying $D(\alpha_a)$ and $D(\alpha_b)^\dagger$ on soft wires, and then discarding yields the scalar
\[
C_{ab}^{21}=\langle \alpha_b^{21}\vert \alpha_a^{21}\rangle ,
\]
so that
\[
(E_{21}\rho)_{ab}=C_{ab}^{21}\,\rho_{ab},
\]
that is, a Schur or entrywise map [2606.29804].

For an infinitesimal shell $d\ell$, the expansion
\[
V_{d\ell}=\sum_a\lvert a\rangle\langle a\rvert\otimes(I+d\ell\,\delta D_a+O(d\ell^2))
\]
yields, after tracing out the shell, an infinitesimal CPTP map whose limit is exactly of GKSL form [2606.29804]:
\[
\frac{d\rho}{d\ell}
= -i[H_\ell,\rho]
+\sum_{r,\hat k}\Bigl(L_{r\hat k}\,\rho\,L_{r\hat k}^\dagger
-\tfrac12\{L_{r\hat k}^\dagger L_{r\hat k},\rho\}\Bigr),
\]
with diagonal jump operators
\[
L_{r\hat k}
=\sqrt{\tfrac{e^2}{2(2\pi)^3}\sum_a q_{ar}(\hat k)\,\lvert a\rangle\langle a\rvert},
\qquad
q_{ar}(\hat k)=\omega\,J_a\!\cdot\epsilon_r^\ast(\hat k).
\]
The diagrammatic derivation is organized by term type: the $O(1)$ contribution gives the identity superoperator, cross-branch contractions through discard give the jump term $\sum L\rho L^\dagger$, and same-branch loops give the anticommutator subtraction together with a Hamiltonian phase.

## 6. Variants, fragments, and related calculi

The source material explicitly contrasts discard ZX-calculus with pure ZX-calculus [2606.29804]. Pure ZX-calculus models states as vectors $\lvert\psi\rangle$, unitaries, and pure Z/X-spiders, but it cannot directly handle mixed states or partial trace. Discard ZX-calculus is obtained by the CPM construction: every pure morphism is doubled, and a new generator $\varepsilon$ is introduced to model trace. The resulting extension is described as seamless for open quantum systems, CPTP maps, Schur channels, Lindblad dynamics, and non-Markovian process tensors, while retaining soundness and completeness.

A further development is the decohered ZX-calculus, a fragment obtained by decohering the usual generators of discard ZX-calculus [2508.04296]. In this fragment, pre- and post-composition by the decoherence map $\delta$ kills off-diagonal matrix entries in the computational basis, and generators collapse to positive matrix embeddings. The fragment is stated to be universal and complete for affinely supported probability distributions over $\mathbb{F}_2^n$, with a normal form combining an affine part implemented by a row-reduced-echelon binary matrix and a Fourier part consisting of a scalar and nonzero parameters. This clarifies how hybrid classical–quantum processes are handled inside the broader discard framework.

The odd-prime stabiliser extension provides another variant [2204.12531]. There, adding discard yields a calculus complete for mixed-state stabiliser quantum mechanics in odd prime dimensions and, after imposing an additional scalar equation, a complete axiomatization of affine co-isotropic relations. A plausible implication is that discard constructions are robust across several diagrammatic settings, not only the qubit theory emphasized in many ZX presentations.

The data also mention ZH-calculus as a distinct graphical calculus optimized for classical non-linearity, with compact encodings of AND, Toffoli, CCZ, and $N$-controlled-$Z$ operations [1805.02175]. That comparison is not a critique of discard ZX-calculus; rather, it marks a separation of tasks. Discard ZX-calculus is presented as the framework for mixed states, partial trace, decoherence, and open-system reasoning, whereas ZH-calculus is presented as especially economical when classical Boolean non-linearity is the dominant concern.

Source: https://www.emergentmind.com/topics/discard-zx-calculus