Skip to content

Commit d75a1f6

Browse files
committed
Deploying to main from @ openqasm/openqasm@87b5b7e 🚀
1 parent 5504a3f commit d75a1f6

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

_sources/language/directives.rst.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,19 @@ variable:
187187
188188
// Estimate the expectation value and store in an output variable
189189
190+
The above example could also be written using an input array:
191+
192+
.. code-block::
193+
194+
input array[angle[32], 2] params;
195+
qubit q;
196+
197+
// Build an ansatz using the above free parameters, eg.
198+
rx(params[0]) q;
199+
ry(params[1]) q;
200+
201+
// Estimate the expectation value and store in an output variable
202+
190203
The following Python pseudocode illustrates the differences between using and
191204
not using parameterized circuits in a quantum program for the case of the VQE:
192205

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h1>OpenQASM Live Specification<a class="headerlink" href="#openqasm-version-spe
134134
</li>
135135
<li class="toctree-l1"><a class="reference internal" href="grammar/index.html">OpenQASM 3.0 Grammar</a></li>
136136
<li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a><ul>
137-
<li class="toctree-l2"><a class="reference internal" href="release_notes.html#spec-v3-1-0-27">spec/v3.1.0-27</a><ul>
137+
<li class="toctree-l2"><a class="reference internal" href="release_notes.html#spec-v3-1-0-28">spec/v3.1.0-28</a><ul>
138138
<li class="toctree-l3"><a class="reference internal" href="release_notes.html#new-features">New Features</a></li>
139139
<li class="toctree-l3"><a class="reference internal" href="release_notes.html#upgrade-notes">Upgrade Notes</a></li>
140140
<li class="toctree-l3"><a class="reference internal" href="release_notes.html#bug-fixes">Bug Fixes</a></li>

language/directives.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ <h1>Input/output<a class="headerlink" href="#input-output" title="Link to this h
190190
<span class="nf">rx</span><span class="p">(</span><span class="n">param1</span><span class="p">)</span><span class="w"> </span><span class="n">q</span><span class="p">;</span>
191191
<span class="nf">ry</span><span class="p">(</span><span class="n">param2</span><span class="p">)</span><span class="w"> </span><span class="n">q</span><span class="p">;</span>
192192

193+
<span class="c1">// Estimate the expectation value and store in an output variable</span>
194+
</pre></div>
195+
</div>
196+
<p>The above example could also be written using an input array:</p>
197+
<div class="highlight-qasm3 notranslate"><div class="highlight"><pre><span></span><span class="kt">input</span><span class="w"> </span><span class="kt">array</span><span class="p">[</span><span class="kt">angle</span><span class="p">[</span><span class="m">32</span><span class="p">],</span><span class="w"> </span><span class="m">2</span><span class="p">]</span><span class="w"> </span><span class="n">params</span><span class="p">;</span>
198+
<span class="kt">qubit</span><span class="w"> </span><span class="n">q</span><span class="p">;</span>
199+
200+
<span class="c1">// Build an ansatz using the above free parameters, eg.</span>
201+
<span class="nf">rx</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="m">0</span><span class="p">])</span><span class="w"> </span><span class="n">q</span><span class="p">;</span>
202+
<span class="nf">ry</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="m">1</span><span class="p">])</span><span class="w"> </span><span class="n">q</span><span class="p">;</span>
203+
193204
<span class="c1">// Estimate the expectation value and store in an output variable</span>
194205
</pre></div>
195206
</div>

objects.inv

0 Bytes
Binary file not shown.

release_notes.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434

3535
<section id="release-notes">
3636
<h1>Release Notes<a class="headerlink" href="#release-notes" title="Link to this heading"></a></h1>
37-
<section id="spec-v3-1-0-27">
38-
<span id="release-notes-spec-v3-1-0-27"></span><h2>spec/v3.1.0-27<a class="headerlink" href="#spec-v3-1-0-27" title="Link to this heading"></a></h2>
37+
<section id="spec-v3-1-0-28">
38+
<span id="release-notes-spec-v3-1-0-28"></span><h2>spec/v3.1.0-28<a class="headerlink" href="#spec-v3-1-0-28" title="Link to this heading"></a></h2>
3939
<section id="new-features">
40-
<span id="release-notes-spec-v3-1-0-27-new-features"></span><h3>New Features<a class="headerlink" href="#new-features" title="Link to this heading"></a></h3>
40+
<span id="release-notes-spec-v3-1-0-28-new-features"></span><h3>New Features<a class="headerlink" href="#new-features" title="Link to this heading"></a></h3>
4141
<ul class="simple">
4242
<li><p>The types <code class="docutils literal notranslate"><span class="pre">bool</span></code> and (scalar) <code class="docutils literal notranslate"><span class="pre">bit</span></code> are now explicitly described as being completely
4343
interchangeable in expression (r-value) positions, and that <code class="docutils literal notranslate"><span class="pre">bit</span></code> and <code class="docutils literal notranslate"><span class="pre">bit[1]</span></code> are distinct
@@ -56,7 +56,7 @@ <h1>Release Notes<a class="headerlink" href="#release-notes" title="Link to this
5656
</ul>
5757
</section>
5858
<section id="upgrade-notes">
59-
<span id="release-notes-spec-v3-1-0-27-upgrade-notes"></span><h3>Upgrade Notes<a class="headerlink" href="#upgrade-notes" title="Link to this heading"></a></h3>
59+
<span id="release-notes-spec-v3-1-0-28-upgrade-notes"></span><h3>Upgrade Notes<a class="headerlink" href="#upgrade-notes" title="Link to this heading"></a></h3>
6060
<ul class="simple">
6161
<li><p>It has been clarified that arrays and registers of size zero are
6262
allowed; however, integers and angles must have size greater than
@@ -70,7 +70,10 @@ <h1>Release Notes<a class="headerlink" href="#release-notes" title="Link to this
7070
</ul>
7171
</section>
7272
<section id="bug-fixes">
73-
<span id="release-notes-spec-v3-1-0-27-bug-fixes"></span><h3>Bug Fixes<a class="headerlink" href="#bug-fixes" title="Link to this heading"></a></h3>
73+
<span id="release-notes-spec-v3-1-0-28-bug-fixes"></span><h3>Bug Fixes<a class="headerlink" href="#bug-fixes" title="Link to this heading"></a></h3>
74+
<ul class="simple">
75+
<li><p>Clarify that array type variables are supported as inputs.</p></li>
76+
</ul>
7477
<ul class="simple">
7578
<li><p>Some minor mathematical errors in the descriptions of the explicit gate
7679
actions in <a class="reference internal" href="language/standard_library.html#sdg" title="language/standard_library"><code class="xref oq oq-gate docutils literal notranslate"><span class="pre">sdg</span></code></a>, <a class="reference internal" href="language/standard_library.html#rx" title="language/standard_library"><code class="xref oq oq-gate docutils literal notranslate"><span class="pre">rx</span></code></a>, <a class="reference internal" href="language/standard_library.html#ry" title="language/standard_library"><code class="xref oq oq-gate docutils literal notranslate"><span class="pre">ry</span></code></a>, <a class="reference internal" href="language/standard_library.html#rz" title="language/standard_library"><code class="xref oq oq-gate docutils literal notranslate"><span class="pre">rz</span></code></a>, <a class="reference internal" href="language/standard_library.html#crx" title="language/standard_library"><code class="xref oq oq-gate docutils literal notranslate"><span class="pre">crx</span></code></a> and
@@ -103,7 +106,7 @@ <h3>Navigation</h3>
103106
<li class="toctree-l1"><a class="reference internal" href="language/index.html">Language</a></li>
104107
<li class="toctree-l1"><a class="reference internal" href="grammar/index.html">OpenQASM 3.0 Grammar</a></li>
105108
<li class="toctree-l1 current"><a class="current reference internal" href="#">Release Notes</a><ul>
106-
<li class="toctree-l2"><a class="reference internal" href="#spec-v3-1-0-27">spec/v3.1.0-27</a><ul>
109+
<li class="toctree-l2"><a class="reference internal" href="#spec-v3-1-0-28">spec/v3.1.0-28</a><ul>
107110
<li class="toctree-l3"><a class="reference internal" href="#new-features">New Features</a></li>
108111
<li class="toctree-l3"><a class="reference internal" href="#upgrade-notes">Upgrade Notes</a></li>
109112
<li class="toctree-l3"><a class="reference internal" href="#bug-fixes">Bug Fixes</a></li>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)