Releases: Mc-Zen/quill
Version 0.5.0 (October 23, 2024)
Version 0.4.0 (September 07, 2024)
With this release, an alternative way of specifying quantum circuits is introduced. Similar to Qiskit (the well-known quantum computing framework written in Python), a circuit can now also be constructed by successively entering instructions. The circuit is then layed out automatically. This gives less control about the precise positioning of gates but allows for faster construction and also composition of sub-circuits. Moreoever, it is now easy to create templates for generic types of circuits.
For this, the submodule Tequila has been added to Quill. Tequila also features two built-in templates: tq.graph-state()
and tq.qft()
.
#import "@preview/quill:0.4.0": *
#import tequila as tq
#quantum-circuit(
..tq.graph-state((0, 1), (1, 2)),
..tq.build(y: 3,
tq.p($pi$, 0),
tq.cx(0, (1, 2)),
),
..tq.graph-state(x: 6, y: 2, invert: true, (0, 1), (0, 2)),
gategroup(x: 1, 3, 3),
gategroup(x: 1, y: 3, 3, 3),
gategroup(x: 6, y: 2, 3, 3),
slice(x: 5)
)
Version 0.3.0 (May 20, 2024)
This release contains a complete rewrite of the layout algorithm, finally allowing for transparent gates. Also, it is now possible to place gates and co. explicitly, similar to table.cell()
.
Changelog:
- New features
- Enable manual placement of gates,
gate($X$, x: 3, y: 1)
, similar to built-intable()
in addition to automatic placement. This works for most elements, not only gates. - Add parameter
pad
tolstick()
andrstick()
. - Add parameter
fill-wires
toquantum-circuit()
. All wires are filled unto the end (determined by the longest wire) by default (breaking change⚠️ ). This behavior can be reverted by settingfill-wires: false
. gategroup()
slice()
andannotate()
can now be placed above or below the circuit withz: "above"
andz: "below"
.help()
command for quickly displaying the documentation of a given function, e.g.,help("gate")
. Powered by [tidy][tidy].
- Enable manual placement of gates,
- Improvements:
- Complete rework of circuit layout implementation
- allows transparent gates since wires are not drawn through gates anymore. The default fill is now
auto
and usingnone
sets the background to transparent. midstick
is now transparent by default.
- allows transparent gates since wires are not drawn through gates anymore. The default fill is now
setwire()
can now be used to override only partial wire settings, such as wire colorsetwire(1, stroke: blue)
, widthsetwire(1, stroke: 1pt)
or wire distance, all separately. Before, some settings were reset.
- Complete rework of circuit layout implementation
- Fixes:
- Fixed
lstick
/rstick
when equation numbering is turned on.
- Fixed
- Removed:
- The already deprecated
scale-factor
(usescale
instead)
- The already deprecated
Version 0.2.1 (March 11, 2024)
- Improvements:
- Add
fill
parameter tomidstick()
. - Add
bend
parameter topermute()
. - Add
separation
parameter topermute()
.
- Add
- Fixes:
- With Typst 0.11.0,
scale()
now takes into account outer alignment. This broke the positioning of centered/right-aligned circuits, e.g., ones put into afigure()
. - Change wires to be drawn all through
ctrl()
, making it consistent toswap()
andtarg()
.
- With Typst 0.11.0,
Version 0.2.0 (September 27, 2023)
- New features:
- Add arbitrary labels to any
gate
(also derived gates such asmeter
,ctrl
, ...),gategroup
orslice
that can be anchored to any of the nine 2d alignments. - Add optional gate inputs and outputs for multi-qubit gates (see gallery).
- Implicit gates (breaking change
⚠️ ): a content item automatically becomes a gate, so you can just type$H$
instead ofgate($H$)
(of course, thegate()
function is still important in order to use the many available options).
- Add arbitrary labels to any
- Other breaking changes
⚠️ :slice()
has nodx
anddy
parameters anymore. Instead, labels are handled throughlabel
exactly as ingate()
. Also thewires
parameter is replaced withn
for consistency with other multi-qubit gates.- Swap order of row and column parameters in
annotate
to make it consistent with built-in Typst functions.
- Improvements:
- Improve layout (allow row/column spacing and min lengths to be specified in em-lenghts).
- Automatic bounds computation, even for labels.
- Improve meter (allow multi-qubit gate meters and respect global (per-circuit) gate padding).d
- Fixes:
lstick
/rstick
braces broke with Typst 0.7.0.lstick
/rstick
bounds.
- Documentation
- Add section on creating custom gates.
- Add section on using labels.
- Explain usage of
slice()
andgategroup()
.
Version 0.1.0 (June 28, 2023)
This is the initial release for Quill, a Typst package for creating quantum circuit diagrams.