t

typograph-zx

@preview

Add ZX-calculus and continuous-variable ZX-calculus notation to typograph.

v0.1.0
MIT

Package Information

Last Updated
Minimum Typst Version
0.15.1
Categories
visualization
Disciplines
physics

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/typograph-zx:0.1.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/typograph-zx:0.1.0": *

Version History

0.1.00.15.1
7917be87c6f9...

typograph-zx

Full documentation →

typograph-zx is ZX-calculus and continuous-variable ZX-calculus notation
for typograph: spiders,
Hadamards, multipliers, states and effects, and Pauli-web/fault-tolerance
edge highlighting. It's a normal consumer of typograph's public API — a
theme, not a fork or an extension of the engine — built entirely from
node-type(), edge-type(), and theme().

The package this notation is inspired by the workflow of
tikzit and includes notation for the
continuous-variable ZX calculus described by Shaikh, Yeh, and Gogioso in
“The Focked-up ZX Calculus: Picturing Continuous-Variable Quantum
Computation”
.

Install and import

#import "@preview/typograph:0.1.0" as typ
#import "@preview/typograph-zx:0.1.0" as zx
#let diagram = typ.diagram.with(theme: zx.theme)

Both imports are needed: this package supplies the semantic constructors
and the bundled theme value, while the diagram engine itself — diagram(),
edge(), group(), and everything else that isn't ZX-specific — comes
from typograph directly.

Quick start

#diagram({
  import zx: z, x
  let a = z(0, 0, label: $alpha$)
  let b = x(1, 0)
  typ.edge(a, b)
  typ.edge(a, (-1, 0))
  typ.edge(b, (2, 0))
})

Render output showing a diagram with a z node labelled alpha and a phaseless x node, connected by an edge

See the full documentation
for every constructor, the complete bundled palette and presets, and how
to extend this theme in a project of your own.

Testing

bash tests/run.sh

Stages a local copy of typograph (this package's own dependency) and
runs the full fixture suite plus an outline-geometry snapshot and a
documentation-figure staleness check.

License

MIT — see LICENSE.