-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintro.html
More file actions
229 lines (184 loc) · 14.3 KB
/
intro.html
File metadata and controls
229 lines (184 loc) · 14.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Introduction — OpenQASM Live Specification documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
<link rel="stylesheet" type="text/css" href="_static/colors.css?v=3aae764c" />
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Language" href="language/index.html" />
<link rel="prev" title="OpenQASM Live Specification" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">¶</a></h1>
<p>OpenQASM is an imperative programming language designed for near-term
quantum computing algorithms and applications. Quantum
programs are described using the measurement-based quantum circuit model
with support for classical feed-forward flow control based on measurement
outcomes.</p>
<p>OpenQASM presents a parameterized set of physical logic gates and concurrent
real-time classical computations. Its main goal is to serve as an intermediate
representation for higher-level compilers to communicate with quantum hardware.
Allowances have been made for human usability. In particular, the language admits
different representations of the same program as it is transformed from a high-level
description to a pulse representation.</p>
<p>This document is draft version 3.0 of the OpenQASM specification. The Qiskit development team is
soliciting feedback on this draft for consideration prior to finalizing version 3.0.</p>
<section id="design-goals">
<h2>Design Goals<a class="headerlink" href="#design-goals" title="Link to this heading">¶</a></h2>
<p>Version 3.0 of the OpenQASM specification aims to extend OpenQASM to include:</p>
<ul class="simple">
<li><p><strong>A broader family of computation with classical logic</strong>. We introduce classical control flow,
instructions, and data types to define circuits that include real-time computations on
classical data. A <em>extern</em> mechanism allows opaque references to generic classical
computations acting upon run-time data.</p></li>
<li><p><strong>Explicit timing</strong>. We introduce a flexible mechanism to describe <em>design intent</em> of
instruction scheduling while remaining independent of specific durations determined by gate
calibrations. This enables, for example, dynamical decoupling while retaining a gate-level
description of a circuit.</p></li>
<li><p><strong>Embedded pulse-level definitions</strong>. An extensible mechanism to attach low-level definitions to
gates. This is particularly relevant to calibration tasks which optimize pulse parameters using
error amplification sequences most easily described at the gate level.</p></li>
</ul>
</section>
<section id="scope">
<h2>Scope<a class="headerlink" href="#scope" title="Link to this heading">¶</a></h2>
<p>This document defines the OpenQASM language specification while the motivation behind
its design choices is discussed in detail in <a class="reference external" href="https://arxiv.org/abs/2104.14722">arXiv:2104.14722</a>. Furthermore, the
specification does not define the execution environment that accepts OpenQASM as input.
For information about previous versions of OpenQASM, please refer to <a class="reference external" href="https://arxiv.org/abs/1707.03429">arXiv:1707.03429</a>.</p>
</section>
<section id="implementation-details">
<h2>Implementation Details<a class="headerlink" href="#implementation-details" title="Link to this heading">¶</a></h2>
<p>OpenQASM 3 is a large expansion over the previous OpenQASM 2 specification.
Many new features for classical control flow and computation are added to make writing quantum algorithms easier, and to describe classical data processing that forms part of these algorithms.
The language, however, is not designed to be used for general-purpose classical computation, and in the near term, any hardware that executes an OpenQASM 3 program is unlikely to support the full set of data manipulations the language can describe.</p>
<p>Hardware implementations of OpenQASM 3 are permitted to restrict their runtime processing to only the set of operations that they can perform efficiently and in real time.
This set of operations will differ between implementations; you should consult your hardware vendor for which language features you can expect to be possible at runtime.
Implementations are likely to become more powerful over time, as the requirements for quantum control become less onerous to achieve.</p>
<p>It is expected that <em>compilers</em> for OpenQASM 3 will support all of the classical operations specified in this document for values that can be reasonably inferred to be compile-time constants, and will perform these operations at compile time.
At a minimum, “reasonably inferred” means values declared <code class="docutils literal notranslate"><span class="pre">const</span></code>, and literals.
For example, this means that the “scientific-calculator functions” such as <code class="docutils literal notranslate"><span class="pre">sin</span></code>, <code class="docutils literal notranslate"><span class="pre">exp</span></code>, and so on will always work on expressions involving only literals and values declared <code class="docutils literal notranslate"><span class="pre">const</span></code> of compatible types, and the compiler will completely fold such expressions into a single constant.
Whether such operations can occur on run-time values is implementation-specific.
This extends further, even to which types may be declared and used.
An implementation of OpenQASM 3 is permitted to reject programs that use, for example, <code class="docutils literal notranslate"><span class="pre">int[5]</span></code> or <code class="docutils literal notranslate"><span class="pre">float[16]</span></code> declarations, if the hardware has no facilities to support them.
Similarly, even if a hardware implementation accepts values declared <code class="docutils literal notranslate"><span class="pre">complex[float[64]]</span></code>, it is not required to accept programs that use the infix <code class="docutils literal notranslate"><span class="pre">**</span></code> power operator on them at runtime, but a compiler is required to evaluate such operator expressions if the operands are compile-time known.</p>
<p>Hardware implementations that support a particular feature <em>must</em> follow the rules for it given in this specification, unless such a feature is specifically stated to be “implementation-defined”.
If they cannot, then they <em>must not</em> accept programs that use that feature.
The user can therefore expect that if an OpenQASM 3 program is accepted by two implementations, both will perform the same behaviour except in cases this document explicitly allows it to differ.</p>
</section>
<section id="contributors">
<h2>Contributors<a class="headerlink" href="#contributors" title="Link to this heading">¶</a></h2>
<p>The following individuals contributed to the OpenQASM version 3.0 specification:</p>
<p>Hossein Ajallooiean <a class="footnote-reference brackets" href="#id14" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>,
Thomas Alexander <a class="footnote-reference brackets" href="#id15" id="id2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Lev Bishop <a class="footnote-reference brackets" href="#id15" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Yudong Cao <a class="footnote-reference brackets" href="#id16" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>,
Andrew Cross <a class="footnote-reference brackets" href="#id15" id="id5" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Niel de Beaudrap <a class="footnote-reference brackets" href="#id17" id="id6" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a>,
Jay Gambetta <a class="footnote-reference brackets" href="#id15" id="id7" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Ali Javadi-Abhari <a class="footnote-reference brackets" href="#id15" id="id8" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Blake Johnson <a class="footnote-reference brackets" href="#id15" id="id9" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Moritz Kirste <a class="footnote-reference brackets" href="#id14" id="id10" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>,
Colm Ryan <a class="footnote-reference brackets" href="#id18" id="id11" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a>,
John Smolin <a class="footnote-reference brackets" href="#id15" id="id12" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>,
Ntwali Bashige Toussaint <a class="footnote-reference brackets" href="#id16" id="id13" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a></p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id14" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id1">1</a>,<a role="doc-backlink" href="#id10">2</a>)</span>
<p>Zurich Instruments</p>
</aside>
<aside class="footnote brackets" id="id15" role="note">
<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id2">1</a>,<a role="doc-backlink" href="#id3">2</a>,<a role="doc-backlink" href="#id5">3</a>,<a role="doc-backlink" href="#id7">4</a>,<a role="doc-backlink" href="#id8">5</a>,<a role="doc-backlink" href="#id9">6</a>,<a role="doc-backlink" href="#id12">7</a>)</span>
<p>IBM Quantum</p>
</aside>
<aside class="footnote brackets" id="id16" role="note">
<span class="label"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id4">1</a>,<a role="doc-backlink" href="#id13">2</a>)</span>
<p>Zapata Computing</p>
</aside>
<aside class="footnote brackets" id="id17" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id6">4</a><span class="fn-bracket">]</span></span>
<p>University of Oxford</p>
</aside>
<aside class="footnote brackets" id="id18" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id11">5</a><span class="fn-bracket">]</span></span>
<p>AWS Center for Quantum Computing</p>
</aside>
</aside>
</section>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">OpenQASM Live Specification</a></h1>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#design-goals">Design Goals</a></li>
<li class="toctree-l2"><a class="reference internal" href="#scope">Scope</a></li>
<li class="toctree-l2"><a class="reference internal" href="#implementation-details">Implementation Details</a></li>
<li class="toctree-l2"><a class="reference internal" href="#contributors">Contributors</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="language/index.html">Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="grammar/index.html">OpenQASM 3.0 Grammar</a></li>
<li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/openqasm/openqasm/">GitHub</a></li>
</ul>
<hr />
<ul>
<li class="toctree-l1"><a href="/index.html">Live Version</a></li>
<li class="toctree-l1"><a href="/versions/3.1/index.html">Version 3.1</a></li>
<li class="toctree-l1"><a href="/versions/3.0/index.html">Version 3.0</a></li>
<li class="toctree-l1"><a href="https://github.com/openqasm/openqasm/">GitHub</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">OpenQASM Live Specification</a></li>
<li>Next: <a href="language/index.html" title="next chapter">Language</a></li>
</ul></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©Copyright 2017-2025, OpenQASM Contributors..
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="_sources/intro.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>