Skip to content

Compilers and languages

QWIRE

Maintained by jpaykin

This is a Coq implementation of the QWIRE quantum programming language, described in the following papers by Jennifer Paykin, Robert Rand, Dong-Ho Lee and Steve Zdancewic: [QWIRE: a core language for quantum...

CoqMIT
QWIRE illustration

Resource snapshot

Category

Compilers and languages

Stars

109

Last pushed

May 11, 2025Updated 1y ago

Open issues

1

What it is

QWIRE is maintained by jpaykin and sits in the Compilers and languages lane of the open-source quantum map.

This is a Coq implementation of the QWIRE quantum programming language, described in the following papers by Jennifer Paykin, Robert Rand, Dong-Ho Lee and Steve Zdancewic: [QWIRE: a core language for quantum...

Last verified by Qtangl generator on May 27, 2026

Who it's for

Developers who want to understand the representations and compilers that sit between high-level code and runnable circuits.

What you can build or learn

  • Compare IRs, DSLs, transpilers, and compiler assumptions across ecosystems.
  • Understand how high-level code becomes something a backend can execute.
  • Spot tools that matter when interoperability and compilation quality are important.

License

MIT

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~459 words · about 2 min readOpen on GitHub

QWIRE

This is a Coq implementation of the QWIRE quantum programming language, described in the following papers by Jennifer Paykin, Robert Rand, Dong-Ho Lee and Steve Zdancewic:

Rennela and Staton's Classical Control, Quantum Circuits and Linear Logic in Enriched Category Theory provides a categorical semantics for QWIRE.

This version of QWIRE is compatible with Coq version 8.19.

This project depends on QuantumLib version 1.6.0, which you can install with:

opam pin coq-quantumlib 1.6.0 https://github.com/inQWIRE/QuantumLib.git

Run make to compile the core (preliminary and implementation) files and make all to compile proofs of QWIRE programs. Run make qasm to compile the files that convert QWIRE to QASM. We recommend using Company Coq with QWIRE in light of its support for unicode.

Files in this repository

Preliminaries

  • Monad.v : An implementation of some basic monads
  • Monoid.v : A typeclass and solver for commutative monoids, modified from LinearTypingContexts

Implementation of QWIRE

  • Contexts.v : Defines wire types and typing contexts
  • HOASCircuits.v : Defines QWIRE circuits using higher-order abstract syntax
  • DBCircuits.v : Compiling HOAS to De Bruijin style circuits
  • TypeChecking.v : Circuit notations and tactics for proving well-typedness
  • Denotation.v : Defines the denotational semantics of QWIRE circuits and proves its (quantum mechanical) validity
  • HOASLib.v : A library of basic circuits used in QWIRE programming
  • SemanticLib.v : Proves the semantic properties of HOASLib circuits
  • HOASExamples.v : Additional examples of HOAS circuits
  • Composition.v : States and admits compositionality lemmas (used in the following five files)
  • Ancilla.v : Defines the correctness of circuits using ancilla assertions
  • Symmetric.v : Syntactic conditions for guaranteeing the validity of assertions
  • Oracles.v : Compilation of boolean expressions to QWIRE circuits

Verification of QWIRE circuits

  • Arithmetic.v : Verification of a quantum adder
  • Deutsch.v : Variants on Deutsch's Algorithm
  • Equations.v : Equalities on small circuits
  • HOASProofs.v : Additional proofs, including coin flips and teleportation

Compilation to QASM (i.e., OpenQASM 2.0)

  • QASM.v : Compilation from QWIRE to QASM
  • QASMPrinter.v : A printer for compiled circuits, for execution on a quantum computer/simulator
  • QASMExamples.v : Examples of circuit compilation

The QWIRE project has benefited from the support of the Air Force Office of Scientific Research under the MURI grant number FA9550-16-1-0082 entitled, “Semantics, Formal Reasoning, and Tool Support for Quantum Programming” and the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Quantum Testbed Pathfinder Program under Award Number DE-SC0019040.

Read on GitHub

Activity

Latest release

—

Watchers

19

Python support

—

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

NVIDIA

cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows

C++Apache-2.0Flagship

1,048 stars · Updated 3mo ago

QISKit

openqasm

Quantum assembly language for extended quantum circuits

PythonApache-2.0

1,468 stars · Updated 3mo ago

Quantomatic

pyzx

Python library for quantum circuit rewriting and optimisation using the ZX-calculus

OpenQASMApache-2.0Flagship

524 stars · Updated 3mo ago

QISKit

qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0FlagshipQtangl relevant

7,412 stars · Updated 3mo ago

Microsoft

QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing

Jupyter NotebookMITFlagshipArchive

4,862 stars · Updated 2y ago

CQCL

tket

Source code for the TKET quantum compiler, Python bindings and utilities

C++Apache-2.0FlagshipQtangl relevant

308 stars · Updated 3mo ago