Go to file
Erik Davis e0fc0f135b
Release v1.0.1 (#582)
* release v1.0.1

* add release note

* Fix backslash error

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
2025-02-19 17:23:45 +00:00
.github Merge pull request #570 from hodgestar/lint/update-black-to-24-10 2025-01-08 11:38:36 -05:00
ast_releasenotes/releasenotes Release v1.0.1 (#582) 2025-02-19 17:23:45 +00:00
examples Correct integer division in `pow` modifiers (#529) 2024-04-30 17:33:40 +01:00
releasenotes/notes Merge pull request #519 from mbhealy/mbh-separate-reno-dirs 2024-05-15 11:50:11 -04:00
source Release v1.0.1 (#582) 2025-02-19 17:23:45 +00:00
spec_releasenotes/releasenotes update spec to clarify array inputs (#2) 2025-01-16 14:39:56 -08:00
.gitignore .gitignore publush_build dir 2023-02-28 11:30:41 -05:00
.pylintrc Conformance tests and contributing section (#18) 2017-09-19 22:24:15 -04:00
CODE_OF_CONDUCT.md change references to master for references to main 2022-03-14 12:14:02 +01:00
CONTRIBUTING.md Add TSC Statements of Intent to main branch 2024-06-26 14:34:58 -04:00
LICENSE Update copyright years. 2023-11-15 16:39:08 +01:00
Makefile Monkeypatch docutils to fix bibliography output 2023-03-15 17:32:43 +00:00
README.md - Call for TSC candidates 2024-11-23 09:44:12 -07:00
WG.md Reboot the profiles working group, focusing on a hardware vendor basic profile. 2024-10-30 17:28:20 +01:00
ast_release.md Release v1.0.1 (#582) 2025-02-19 17:23:45 +00:00
buildPublishable.sh Completely remove build folder while building versions, fixes a problem with release notes 2024-04-03 12:10:35 -04:00
constraints.txt Monkeypatch docutils to fix bibliography output 2023-03-15 17:32:43 +00:00
contributors.md Add TSC Statements of Intent to main branch 2024-06-26 14:34:58 -04:00
convert2pdf.py Add utils for converting from tex to pdf then svg for postprocessing tikz images 2020-12-11 16:58:56 -05:00
convert2svg.py Add utils for converting from tex to pdf then svg for postprocessing tikz images 2020-12-11 16:58:56 -05:00
governance.md Update TSC Membership History 2025-01-24 11:10:49 -07:00
make.bat Add infrastructure and first text for OpenQASM live spec (#58) 2020-11-03 15:58:34 -05:00
requirements.txt Fix incorrect dependency 2024-04-09 17:56:42 +01:00
tsc_statements_of_intent.md Add TSC Statements of Intent to main branch 2024-06-26 14:34:58 -04:00

README.md

OpenQASM

OpenQASM is an imperative programming language for describing quantum circuits. It is capable of describing universal quantum computing using the circuit model, measurement-based model, and near-term quantum computing experiments.

This repo contains the OpenQASM specification, examples, and tools for the OpenQASM intermediate representation.

OpenQASM started as a Qiskit project

‼️ Call for Candidates for TSC Membership! ‼️

The OpenQASM Technical Steering Committee has called an election opening 2024-12-15 and ending 2025-01-15. The electors will be directed to an online election platform for their votes. At this time, all three (3) members with expiring terms have indicated they are candidates for re-election. An Issue is open in the OpenQASM Github repository soliciting further candidates

‼️ Call for Applicants for TSC Secretary! ‼️

We are searching for candidates for the role of TSC Secretary. The TSC will select a new Secretary during a TSC meeting in April, 2025. Candidates should familiarize themselves with the responsibilties of the role. If you are interested in presenting yourself as a candidate, please contact Jack Woehr, the current Secretary, at jack.woehr@procern.com before April, 2025.

Current version: 3.1

About this project

In this repository, you'll find all the documentation related to OpenQASM, some useful OpenQASM examples, and a reference grammar.

Language specs

The live language documentation specification.

Examples

An example of OpenQASM 3.0 source code is given below. Several more examples may be found in the examples folder.

/*
 * Repeat-until-success circuit for Rz(theta),
 * cos(theta-pi)=3/5, from Nielsen and Chuang, Chapter 4.
 */
OPENQASM 3;
include "stdgates.inc";

/*
 * Applies identity if out is 01, 10, or 11 and a Z-rotation by
 * theta + pi where cos(theta)=3/5 if out is 00.
 * The 00 outcome occurs with probability 5/8.
 */
def segment qubit[2] anc, qubit psi -> bit[2] {
  bit[2] b;
  reset anc;
  h anc;
  ccx anc[0], anc[1], psi;
  s psi;
  ccx anc[0], anc[1], psi;
  z psi;
  h anc;
  measure anc -> b;
  return b;
}

qubit input;
qubit[2] ancilla;
bit[2] flags = "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

Citation format

For research papers, we encourage authors to reference.

  • [Version 3.0] Andrew W. Cross, Ali Javadi-Abhari, Thomas Alexander, Niel de Beaudrap, Lev S. Bishop, Steven Heidel, Colm A. Ryan, John Smolin, Jay M. Gambetta, Blake R. Johnson "OpenQASM 3: A broader and deeper quantum assembly language" [arxiv:2104.14722].
  • [Previous Version: 2.0] Andrew W. Cross, Lev S. Bishop, John A. Smolin, Jay M. Gambetta "Open Quantum Assembly Language" [arXiv:1707.03429].

Governance

The OpenQASM project has a process for accepting changes to the language and making decisions codified in its governance model.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

If you'd like to help please take a look to our contribution guidelines. This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.

Release Notes

See the section on Release Notes contribution guidelines.