zx-calculus
Coecke's ZX-calculus for quantum circuit reasoning via string diagrams with Z-spiders (green) and X-spiders (red)
Profile →npx skills add majiayu000/claude-skill-registry --skill zx-calculus --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# ZX-Calculus **Trit**: -1 (MINUS - foundational/classical notation) **Origin**: Coecke & Duncan (2008) **Principle**: Quantum computation via string diagram rewriting --- ## Overview ZX-calculus is a graphical language for quantum computing where: - **Z-spiders** (green): Phase gates in computational basis - **X-spiders** (red): Phase gates in Hadamard basis - **Wires**: Qubits - **Rewrite rules**: Simplify circuits ## Basic Elements ``` Z-spider (green): X-spider (red): Hadamard: │ │ ╲ ╱ ┌─┴─┐ ┌─┴─┐ ─ │ α │ = e^{iα}|0⟩⟨0| │ α │ = H·Z(α)·H ─ └─┬─┘ + |1⟩⟨1| └─┬─┘ ╱ ╲ │ │ ``` ## GF(3) Color Assignment | Spider | Color | Trit | Basis | |--------|-------|------|-------| | Z | Green #26D826 | 0 | Computational | | X | Red #D82626 | +1 | Hadamard | | H-edge | Blue #2626D8 | -1 | Transition | **Conservation**: Green(0) + Red(+1) + Blue(-1) = 0 ✓ ## Core Rules ### Spider Fusion ``` │ │ │ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ │ α │───│ β │ = │α+β│ └─┬─┘ └─┬─┘ └─┬─┘ │ │ │ ``` ### Bialgebra (Hopf) ``` ╲ ╱ │ │ X = │ │ ╱ ╲ │ │ ``` ### Color Change ``` ┌───┐ ┌───┐ │ Z │──H──│ X │ └───┘ └───┘ ``` ## DisCoPy Implementation ```python from discopy.quantum.zx import Z, X, H, Id, SWAP, Cap, Cup # Bell state preparation
- Overview
- Basic Elements
- GF(3) Color Assignment
- Core Rules
- Spider Fusion
- Bialgebra (Hopf)
- Color Change
- DisCoPy Implementation
- Musical Notation (Quantum Guitar)
- PyZX Integration
- Quantum Music Score
- Applications
- GF(3) Triad
- References
What does the zx-calculus skill do?
Coecke's ZX-calculus for quantum circuit reasoning via string diagrams with Z-spiders (green) and X-spiders (red)
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill zx-calculus --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.