Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

OpenQASM

From Wikipedia, the free encyclopedia
Intermediate representation for quantum instructions
This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources.
Find sources: "OpenQASM" – news ·newspapers ·books ·scholar ·JSTOR
(September 2018) (Learn how and when to remove this message)
OpenQASM
Stable release
3.1.0 / May 15, 2024; 10 months ago (2024-05-15)
Implementation languagePython
LicenseApache License 2.0
Filename extensions.qasm
Websiteopenqasm.com

Open Quantum Assembly Language (OpenQASM; pronouncedopen kazm)[1] is aprogramming language designed for describingquantum circuits andalgorithms for execution on quantum computers.

Language

[edit]

It is designed to be anintermediate representation that can be used by higher-level compilers to communicate with quantum hardware, and allows for the description of a wide range of quantum operations, as well as classical feed-forward flow control based on measurement outcomes.

The language includes a mechanism for describing explicit timing of instructions, and allows for the attachment of low-level definitions to gates for tasks such as calibration.[1] OpenQASM is not intended for general-purpose classical computation, and hardware implementations of the language may not support the full range of data manipulation described in the specification. Compilers for OpenQASM are expected to support a wide range of classical operations for compile-time constants, but the support for these operations on runtime values may vary between implementations.[2]

The language was first described in a paper published in July 2017,[1] and a reference source code implementation was released as part ofIBM's Quantum Information Software Kit (Qiskit) for use with theirIBM Quantum Experiencecloud quantum computing platform.[3] The language has similar qualities to traditionalhardware description languages such asVerilog.

OpenQASM defines its version at the head of a source file as a number, as in the declaration:

OPENQASM3;

The level of OpenQASM's original published implementations is OpenQASM 2.0. Version 3.0 of the specification is the current one and can be viewed at the OpenQASM repository onGitHub.[4]

Examples

[edit]

The following is an example of OpenQASM source code from the official library. The program adds two four-bit numbers.[5]

/* * quantum ripple-carry adder * Cuccaro et al, quant-ph/0410184 */OPENQASM3;include"stdgates.inc";gatemajoritya,b,c{cxc,b;cxc,a;ccxa,b,c;}gateunmaja,b,c{ccxa,b,c;cxc,a;cxa,b;}qubit[1]cin;qubit[4]a;qubit[4]b;qubit[1]cout;bit[5]ans;uint[4]a_in=1;// a = 0001uint[4]b_in=15;// b = 1111// initialize qubitsresetcin;reseta;resetb;resetcout;// set input statesforiin[0:3]{if(bool(a_in[i]))xa[i];if(bool(b_in[i]))xb[i];}// add a to b, storing result in bmajoritycin[0],b[0],a[0];foriin[0:2]{majoritya[i],b[i+1],a[i+1];}cxa[3],cout[0];foriin[2:-1:0]{unmaja[i],b[i+1],a[i+1];}unmajcin[0],b[0],a[0];measureb[0:3]->ans[0:3];measurecout[0]->ans[4];

See also

[edit]

References

[edit]
  1. ^abcCross, Andrew W.; Bishop, Lev S.; Smolin, John A.; Gambetta, Jay M. (2017). "Open Quantum Assembly Language".arXiv:1707.03429 [quant-ph].
  2. ^"OpenQASM Live Specification". Retrieved26 December 2022.
  3. ^qiskit-openqasm: OpenQASM specification, International Business Machines, 4 July 2017, retrieved6 July 2017
  4. ^https://github.com/openqasm/openqasm OpenQASM
  5. ^"openqasm/adder.qasm at master · openqasm/openqasm · GitHub".GitHub. 29 January 2022.

External links

[edit]
General
Theorems
Quantum
communication
Quantum cryptography
Quantum algorithms
Quantum
complexity theory
Quantum
processor benchmarks
Quantum
computing models
Quantum
error correction
Physical
implementations
Quantum optics
Ultracold atoms
Spin-based
Superconducting
Quantum
programming
History
Products
Hardware
Current
Former
Other
Business
entities
Current
Former
Facilities
Initiatives
Inventions
Terminology
CEOs
Board of
directors
Other

Retrieved from "https://en.wikipedia.org/w/index.php?title=OpenQASM&oldid=1265774477"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp