| name | quon-2d-typst-graphs |
| description | Use when plotting 2D Quon-language diagrams in Typst/CeTZ, especially dot-based basis encoders, Majorana dot rules, planar tensor operations, Clifford/matchgate generator sketches, or arXiv:2505.06336-style demos. |
2D Quon Typst Graphs
Overview
Use this skill to draw 2D Quon diagrams in Typst. The public library is lib.typ; it wraps the internal assets/quon2d.typ CeTZ module for the paper's Table I Majorana dictionary and compatibility helpers for dot-based tensor-leg notation from arXiv:2505.06336.
Quick Start
#import "skills/quon-2d-typst-graphs/lib.typ": *
#qtd-table-identity()
#qtd-table-majorana()
#qtd-table-positive-braid()
Follow reports/quon-2d-typst-demo.typ for a complete report. Compile scripts/harness.typ through scripts/build-harness.py for a minimal check of the public plotting library.
Diagram Families
- Table I Majorana dictionary:
qtd-table-identity, qtd-table-majorana, qtd-table-parity, qtd-table-global-parity, qtd-table-ket-vac, qtd-table-ket-state, qtd-table-bra-vac, qtd-table-bra-state, qtd-table-pair-creation, qtd-table-pair-annihilation, qtd-table-positive-braid, qtd-table-negative-braid, qtd-table-scattering
- basis encoders:
qtd-basis-encoder, qtd-basis-dictionary
- Majorana dot rules:
qtd-majorana-dot-dictionary, qtd-pair-dots-to-braid, qtd-time-direction-dots
- elementary tensors:
qtd-one-leg-zero, qtd-two-leg-identity, qtd-two-leg-x, qtd-two-leg-z-rotation, qtd-parity-tensor
- planar tensor operations:
qtd-planar-tensor, qtd-leg-bending, qtd-tensor-contraction
- matchgate topology:
qtd-punctured-matchgate
- noisy-circuit sketches:
qtd-noisy-circuit-slice, qtd-syndrome-extraction, qtd-repetition-code-timeline, qtd-surface-code-patch
- VGQEC paper-exact figures from arXiv:2410.02608v2:
qtd-paper-vgqec-overview, qtd-paper-five-qubit-encoding-circuit
- VGQEC code tutorials:
qtd-quon-basis-primer, qtd-quon-crossing-primer, qtd-three-qubit-repetition-graph, qtd-three-qubit-charged-graph, qtd-three-qubit-cycle-stabilizer, qtd-three-qubit-vgqec-graph, qtd-five-qubit-code-graph, qtd-five-qubit-cycle-l-one, qtd-five-qubit-vgqec-graph, qtd-five-qubit-encoding-circuit
Source Cues
The companion LaTeX skill quon-2d-latex-graphs contains references/2d-dot-notation.md. Use the same semantic conventions in Typst:
- Table I dictionary glyphs use sparse black worldlines, dots, caps, cups, crossings, labels, and no colored manifold frame.
- Full 2D examples can use blue manifold boundary, pale planar region, gray tensor legs;
- thin black Majorana worldlines, red boundary-tracking worldlines;
- filled dots for Majorana actions and open placeholder dots when showing the two basis cases side by side;
- explicit time-arrow cues whenever dots affect the scalar convention.
Layout Rules
- Keep Typst output vector-first: deliver the PDF, and render inspection PNGs at 300 DPI or higher.
- For paper-faithful VGQEC code graphs, screen against the LaTeX/TikZ reference before changing aesthetics. The physical-qubit discs use the TikZ node scale, roughly
0.31cm radius at a 10mm CeTZ canvas unit.
- Draw graph interiors first and draw the white blue-outlined qubit discs afterward. TikZ clips edges to node boundaries; drawing discs last is the Typst/CeTZ way to avoid black lines crossing node labels.
- When matching TikZ
to[out=..., in=...] curves, prefer boundary-clipped Bezier coordinates extracted from the LaTeX render over eyeballed center-to-center curves. After tuning, check that black dots and open circles still sit on the intended edge or crossing.
- Table I glyphs need reserved label zones. Scalars such as
$2^{-n/4}$, occupancy labels such as $p_1$, and strand labels such as $j+1$ must not touch caps, cups, dots, table borders, or each other.
- Prefer larger canvas defaults and wider diagram columns over shrinking text. If a cell is cramped, widen the table/page or split the demo rather than accepting overlap.
- After any coordinate change, compile and inspect a high-resolution raster preview before claiming the table is readable.
- For noisy-circuit and QEC tutorials, black strands are Majorana worldlines, red marks are faults or error histories, blue open circles are syndrome defects, and gray boxes/dashed bands are checks or measurement slices.
- Match the LaTeX tutorial before polishing Typst aesthetics. If Typst compresses labels such as
2n-1, j+1, s_2, or data Majoranas, widen the canvas/page or move the label into reserved whitespace.
- For VGQEC tutorials based on arXiv:2410.02608v2 and
42005_2026_2681_MOESM1_ESM.pdf, use the paper source vocabulary: blue physical-qubit discs, short blue start marks, black charges, orange stabilizer cycles, red variable-crossing parameters, and formulas beside the graphs.
- Use
qtd-paper-vgqec-overview and qtd-paper-five-qubit-encoding-circuit when exact paper fidelity is required. The source archive ships those plots as vector PDFs, so the Typst skill includes the same assets.
- Keep formulas out of dense CeTZ graph canvases; put them beside or below the graph in Typst prose. This avoids the label overlap that happens when long equations are forced into small canvases.
- Do not draw syndrome extraction as many unlabeled red strands fanning into an ancilla. In Typst this almost always reads as accidental overplotting rather than an explanation.
Validation
python3 skills/quon-2d-typst-graphs/scripts/check-2d-typst-plotting.py
python3 skills/quon-2d-typst-graphs/scripts/build-harness.py
ion --json --pretty validate skills/quon-2d-typst-graphs
/private/tmp/typst-0.14.2/typst-aarch64-apple-darwin/typst compile --root . reports/quon-2d-typst-demo.typ reports/quon-2d-typst-demo.pdf
/private/tmp/typst-0.14.2/typst-aarch64-apple-darwin/typst compile --root . reports/quon-2d-noisy-qec-typst-tutorial.typ reports/quon-2d-noisy-qec-typst-tutorial.pdf
/private/tmp/typst-0.14.2/typst-aarch64-apple-darwin/typst compile --root . reports/quon-2d-plot-comparison-typst.typ reports/quon-2d-plot-comparison-typst.pdf
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=/private/tmp/quon-2d-typst-demo-page-%d.png reports/quon-2d-typst-demo.pdf
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=/private/tmp/quon-2d-noisy-qec-typst-page-%d.png reports/quon-2d-noisy-qec-typst-tutorial.pdf
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=/private/tmp/quon-2d-plot-comparison-typst-page-%d.png reports/quon-2d-plot-comparison-typst.pdf
These macros are schematic plotters, not a symbolic Quon evaluator.