/asi:zx-calculusfrom asi
Reasoning about quantum circuits using ZX-calculus string diagrams. Provides rewrite rules, spiders, and integration with DisCoPy and PyZX for circuit simplification and optimization.
Ships in asi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Trit: -1 (MINUS - foundational/classical notation) Origin: Coecke & Duncan (2008) Principle: Quantum computation via string diagram rewriting
ZX-calculus is a graphical language for quantum computing where:
Z-spider (green): X-spider (red): Hadamard:
│ │ ╲ ╱
┌─┴─┐ ┌─┴─┐ ─
│ α │ = e^{iα}|0⟩⟨0| │ α │ = H·Z(α)·H ─
└─┬─┘ + |1⟩⟨1| └─┬─┘ ╱ ╲
│ │
| 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 ✓
│ │ │
┌─┴─┐ ┌─┴─┐ ┌─┴─┐
│ α │───│ β │ = │α+β│
└─┬─┘ └─┬─┘ └─┬─┘
│ │ │
╲ ╱ │ │
X = │ │
╱ ╲ │ │
┌───┐ ┌───┐
│ Z │──H──│ X │
└───┘ └───┘
from discopy.quantum.zx import Z, X, H, Id, SWAP, Cap, Cup
# Bell state preparation
bell = Cap(Z(0), Z(0)) >> (Id(1) @ H) >> CNOT
# ZX diagram
diagram = Z(1, 2, phase=0.5) >> (X(1, 1, phase=0.25) @ Z(1, 1))
# Simplify via rewrite rules
simplified = diagram.normal_form()
# Extract circuit
circuit = simplified.to_circuit()
From Abdyssagin & Coecke's "Bell" composition:
Staff 1 (Piano): Staff 2 (Quantum Guitar):
┌─Z─┐ ┌─X─┐
│ │ │ │
────┴───┴──── ─────┴───┴─────
Bell pair Measurement
import pyzx as zx
# Create circuit
circuit = zx.Circuit(2)
circuit.add_gate("H", 0)
circuit.add_gate("CNOT", 0, 1)
# Convert to ZX graph
graph = circuit.to_graph()
# Simplify
zx.simplify.full_reduce(graph)
# Extract optimized circuit
optimized = zx.extract_circuit(graph)
print(f"T-count: {optimized.tcount()}")
ZX-calculus as musical notation:
| ZX Element | Musical Meaning |
|---|---|
| Z-spider | Sustained note (computational) |
| X-spider | Transposed note (Hadamard) |
| Wire | Time/voice continuation |
| H-edge | Key change |
| Cup/Cap | Entanglement (Bell pair) |
| Component | Trit | Role |
|---|---|---|
| zx-calculus | -1 | Notation |
| quantum-guitar | 0 | Performance |
| discopy | +1 | Computation |
Conservation: (-1) + (0) + (+1) = 0 ✓
Skill Name: zx-calculus Type: Quantum Computing / Diagrammatic Reasoning Trit: -1 (MINUS)
Condition: μ(n) ≠ 0 (Möbius squarefree)
This skill is qualified for non-backtracking geodesic traversal:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (plurigrid/asi) — no native marketplace selected
npx claudepluginhub p/plurigrid-asi-plugins-asi1,393 skills in this plugin
/abductive-replHypothesis-Test Loops via REPL for Exploratory Abductive Inference/academic-researchSearch academic papers across arXiv, PubMed, Semantic Scholar, bioRxiv, medRxiv, Google Scholar, and more. Get BibTeX citations, download PDFs, analyze citation networks. Use for literature reviews, finding papers, and academic research./accept-no-substitutesThis skill should be used when agents generate placeholder tokens like "pseudo-", "mock-", "temporary", "TODO", "demo-", or similar incompleteness markers. Detects substitution patterns in agent OUTPUT and triggers mandatory user interview instead of accepting incomplete work. Activates automatically on any output containing forbidden tokens.Other plugins' skills for the same job