Skip to main content
QUICK REVIEW

[Paper Review] Tutorial on the Quantikz Package

Alastair Kay|ArXiv.org|Sep 10, 2018
Quantum Computing Algorithms and Architecture4 citations
TL;DR

This tutorial introduces Quantikz, a LaTeX package built on TikZ for creating high-quality quantum circuit diagrams, offering improved usability and enhanced features over QCircuit. It enables intuitive typesetting of quantum circuits with support for controlled gates, measurement, labeling, styling, and externalization, while ensuring backward compatibility with QCircuit syntax and providing a web-based editor for easy prototyping.

ABSTRACT

This tutorial introduces (and provides, via the document source) the Quantikz LaTeX package for typesetting quantum circuit diagrams. This takes advantage of tikz to give greater control over the circuit options. Those familiar with the excellent QCircuit package will recognise much of the notation, although it has evolved a bit (hopefully simplified!).

Motivation & Objective

  • To provide a comprehensive tutorial for the Quantikz LaTeX package, designed as a modern alternative to QCircuit.
  • To address limitations of QCircuit and Xy-pic by offering a more intuitive, extensible, and visually consistent interface for quantum circuit diagrams.
  • To support both classical and quantum wires on equal footing, improving flexibility and clarity in circuit representation.
  • To enable seamless integration with LaTeX workflows, including Beamer, externalization, and compatibility with common packages.
  • To offer a web-based interface for interactive circuit design and code generation, lowering the barrier to entry for new users.

Proposed method

  • Leverages TikZ and the quantikz2 library to render quantum circuits using a matrix-based syntax with & for column separation and \\ for row breaks.
  • Introduces a unified wire type system (q, c, b, n) where quantum and classical wires are treated equivalently, improving consistency and layout control.
  • Supports gate commands with optional parameters for gate span, labels in math mode, and per-gate styling via optional arguments.
  • Enables controlled gates using \ctrl{d} and \targ{} commands, with support for multiple controls and targets via vertical wire extensions.
  • Provides high-level commands like \lstick, \rstick, \gate[2]{...}, and \setwiretype for labeling, multi-wire gates, and wire type changes.
  • Includes advanced features such as slicing, gate grouping, externalization for PDF output, and a web-based editor for real-time code generation.

Experimental results

Research questions

  • RQ1How can quantum circuit diagrams be typeset more intuitively and consistently in LaTeX compared to QCircuit?
  • RQ2What improvements can be made to wire type handling to support both quantum and classical wires with equal semantics?
  • RQ3How can a web-based interface enhance accessibility and usability for creating and sharing quantum circuit diagrams?
  • RQ4What are the key challenges in ensuring backward compatibility and package interoperability when redesigning a LaTeX package?
  • RQ5How can advanced features like externalization and per-gate styling be implemented efficiently within a LaTeX package?

Key findings

  • The Quantikz package successfully replaces QCircuit with a more maintainable, extensible, and semantically consistent interface for quantum circuit diagrams.
  • The introduction of first-class classical wires (via c-type wires) resolves prior asymmetries and improves visual clarity in hybrid quantum-classical circuits.
  • The web-based interface enables real-time circuit editing and automatic code generation, significantly lowering the barrier to entry for new users.
  • Externalization support allows for efficient PDF generation of circuits, which is particularly useful for journal submissions requiring image-based figures.
  • The package supports complex features such as multi-qubit gates, controlled gates with multiple targets, and customizable gate styling through TikZ-based syntax.
  • Despite major internal refactoring (version 1.x), backward compatibility is preserved for most existing circuits, though visual output may vary slightly due to wire type redefinition.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.