| name | quon-2d-latex-graphs |
| description | Use when plotting 2D Quon-language diagrams in LaTeX/TikZ, especially dot-based tensor-leg encoders, Majorana dot rules, planar tensor operations, Clifford/matchgate generators, or demos inspired by arXiv:2505.06336. |
2D Quon LaTeX Graphs
Overview
Use this skill to draw the 2D Quon language from arXiv:2505.06336 in LaTeX/TikZ. The reusable asset is assets/quon2d.sty, with a Table I dictionary layer for clean Majorana glyphs and compatibility helpers for dot-based encoders. The skill also exposes lib.typ as a Typst mirror harness for screening LaTeX/TikZ plot geometry against the Typst implementation.
The compatibility layer keeps the paper's "dots instead of index" convention for tensor-leg bit values.
Quick Start
\input{skills/quon-2d-latex-graphs/assets/quon2d.sty}
\qtdTableIdentity
\qtdTableMajorana
\qtdTablePositiveBraid
Use the Typst mirror library when an agent needs quick visual screening or a Typst-side comparison sheet:
#import "skills/quon-2d-latex-graphs/lib.typ": *
#qtd-three-qubit-vgqec-graph()
#qtd-five-qubit-vgqec-graph()
Follow reports/quon-2d-latex-demo.tex for a complete report.
Diagram Families
- Table I Majorana dictionary:
\qtdTableIdentity, \qtdTableMajorana, \qtdTableParity, \qtdTableGlobalParity, \qtdTableKetVac, \qtdTableKetState, \qtdTableBraVac, \qtdTableBraState, \qtdTablePairCreation, \qtdTablePairAnnihilation, \qtdTablePositiveBraid, \qtdTableNegativeBraid, \qtdTableScattering
- basis encoders:
\qtdBasisEncoder, \qtdBasisDictionary
- Majorana dot rules:
\qtdMajoranaDotDictionary, \qtdPairDotsToBraid, \qtdTimeDirectionDots
- elementary tensors:
\qtdOneLegZero, \qtdTwoLegIdentity, \qtdTwoLegX, \qtdTwoLegZRotation, \qtdParityTensor
- planar tensor operations:
\qtdPlanarTensor, \qtdLegBending, \qtdTensorContraction
- matchgate topology:
\qtdPuncturedMatchgate
- noisy-circuit sketches:
\qtdNoisyCircuitSlice, \qtdSyndromeExtraction, \qtdRepetitionCodeTimeline, \qtdSurfaceCodePatch
- VGQEC paper-exact figures from arXiv:2410.02608v2:
\qtdPaperVGQECOverview, \qtdPaperFiveQubitEncodingCircuit
- VGQEC code tutorials:
\qtdQuonBasisPrimer, \qtdQuonCrossingPrimer, \qtdThreeQubitRepetitionGraph, \qtdThreeQubitChargedGraph, \qtdThreeQubitCycleStabilizer, \qtdThreeQubitVGQECGraph, \qtdFiveQubitCodeGraph, \qtdFiveQubitCycleLone, \qtdFiveQubitVGQECGraph, \qtdFiveQubitEncodingCircuit
Source Cues
Consult references/2d-dot-notation.md when you need the paper-derived conventions. The important constraints are:
- Table I dictionary glyphs should stay sparse: black worldlines, dots, caps, cups, crossings, labels, and no colored manifold frame.
- A full 2D Quon diagram can add a background manifold plus a Majorana diagram.
- Four Majoranas at an open interval or basis encoder encode one qubit.
- Dots represent Majorana operator actions and can encode tensor-leg bit values.
- With dots present, the time direction matters; do not rotate a dotted diagram without tracking the scalar convention.
- Matchgate diagrams emphasize boundary-tracking Majoranas, drawn in red in the paper.
Application Tutorial Rules
For noisy circuits and QEC codes, use application plotters as semantic sketches:
- black strands are Majorana worldlines;
- red dots or tracks are faults, error histories, or boundary-tracking Majoranas;
- blue open circles are syndrome defects;
- gray boxes or dashed bands are stabilizer checks, measurement slices, or classical readout.
Reserve label zones before drawing dense strand regions. Strand labels, syndrome labels, and code labels must not touch dots, caps, cups, crossings, frame borders, or each other. If a diagram is crowded, widen the coordinate system or the report page before shrinking text.
For VGQEC tutorials based on arXiv:2410.02608v2 and 42005_2026_2681_MOESM1_ESM.pdf, prefer the code-graph vocabulary from the paper source: blue physical-qubit discs, short blue start marks, black charges, orange stabilizer cycles, and red variable-crossing parameters. Use the paper-exact PDF macros when reproducing Fig. 1 or the five-qubit encoding circuit. For redrawn TikZ graphs, keep formulas in surrounding prose or captions rather than inside the graph canvas. Do not draw syndrome extraction as many unlabeled red strands fanning into an ancilla.
When a tutorial has both LaTeX and Typst versions, compile both PDFs, render PNG previews at 300 DPI or higher, and compare each corresponding graph before claiming the output is readable.
For LaTeX-to-Typst tuning, treat the TikZ output as the geometry reference: node-disc size, clipped curve endpoints, dot sites, and red parameter labels should be checked in a rendered comparison sheet such as reports/quon-2d-plot-comparison-latex.tex.
Validation
python3 skills/quon-2d-latex-graphs/scripts/check-2d-latex-plotting.py
python3 skills/quon-2d-latex-graphs/scripts/build-harness.py
ion --json --pretty validate skills/quon-2d-latex-graphs
PATH=/Library/TeX/texbin:$PATH pdflatex -interaction=nonstopmode -halt-on-error -output-directory reports reports/quon-2d-latex-demo.tex
PATH=/Library/TeX/texbin:$PATH pdflatex -interaction=nonstopmode -halt-on-error -output-directory reports reports/quon-2d-noisy-qec-latex-tutorial.tex
PATH=/Library/TeX/texbin:$PATH pdflatex -interaction=nonstopmode -halt-on-error -output-directory reports reports/quon-2d-plot-comparison-latex.tex
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=/private/tmp/quon-2d-noisy-qec-latex-page-%d.png reports/quon-2d-noisy-qec-latex-tutorial.pdf
Use /Library/TeX/texbin explicitly on this machine when compiling with TeX Live/BasicTeX.