Gate and operation specification for quantum circuits
OpenQASM is an imperative programming language for describing quantum circuits. It is capable to describe universal quantum computing using the circuit model, measurement-based model, and near-term quantum computing experiments.
Specs, examples and tools for the OpenQASM intermediate representation.
Live doc: version 3.0
For previous version see: 2.0
On this repository, you'll find all the documentation related to OpenQASM and some useful OpenQASM examples.
The live language documentation specification.
The examples can be found under the examples folder.
They are OpenQASM files, i.e.:
/* * Repeat-until-success circuit for Rz(theta), * cos(theta-pi)=3/5, from Nielsen and Chuang, Chapter 4. */ OPENQASM 3; include "stdgates.inc";/*
qubit input; qubit ancilla[2]; bit flags[2] = "11"; bit output;
reset input; h input;
// braces are optional in this case while(int(flags) != 0) { flags = segment ancilla, input; } rz(pi - arccos(3 / 5)) input; h input; output = measure input; // should get zero
For research papers, we encourage authors to reference.
This project is licensed under the Apache License 2.0 - see the [LICENSE] file for details.
If you'd like to help please take a look to our contribution guidelines.