Skip to content

Commit

Permalink
Docs preview for PR #1027.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Jan 11, 2024
1 parent dfaf7d5 commit 670d9c5
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 40 deletions.
7 changes: 4 additions & 3 deletions pr-1027/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ configured by the settings in the [sphinx/conf.py](./sphinx/conf.py) file.
defining these bindings in C++. To incorporate the API documentation, the
`cudaq` Python package needs to be built and installed prior to generating the
CUDA Quantum documentation. The [build_docs.sh](../scripts/build_docs.sh)
script will automatically do that if necessary. We use the [AutoDoc
extension](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html)
for Sphinx to incorporate Python documentation.
script will automatically do that if necessary. This project generates
ReStructuredText documentation from Python `docstrings` using `autodoc`.
The generated `.rst` files are in `docs/source/apidoc`. The files are
generated automatically by `doc-build` and `doc-clean` will remove them.

## Sphinx Extensions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ is written:
If you don't specify any measurements in your kernel and allow the :code:`nvq++`
compiler to perform passes that introduce ancilla qubits into your kernel, it
may be difficult to discern which qubits are the ancilla qubits vs which ones
are your qubits. In this case, it is recommend that you provide explicit
are your qubits. In this case, it is recommended that you provide explicit
measurements in your kernel in order to only receive measurements from your
qubits and silently discard the measurements from the ancillary qubits.
Expand Down
18 changes: 9 additions & 9 deletions pr-1027/_sources/specification/cudaq/patterns.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ control :math:`V`. The CUDA Quantum specification requires the following syntax

.. code-block:: cpp
// Will invoke U V U^dag
cudaq::compute_action (
[&](){
/*U_code*/
},
[&]() {
/*V_code*/
}
);
// Will invoke U V U^dag
cudaq::compute_action (
[&](){
/*U_code*/
},
[&]() {
/*V_code*/
}
);
Compiler implementations must add the uncompute segment
and optimize on any controlled versions of this block of code.
2 changes: 1 addition & 1 deletion pr-1027/_sources/specification/quake-dialect.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ other on the same qubit---visually:
└───┘ └───┘ └───┘
```

Where `I` is the identity operator. Now note that a naive implemention of
Where `I` is the identity operator. Now note that a naive implementation of
this optimization for Quake would optimize away both `quake.h` operators
being applied to `%q0`. Such an implementation would have missed the fact
that a measurement is being applied to the vector, `%veq`, which contains
Expand Down
22 changes: 11 additions & 11 deletions pr-1027/api/languages/cpp_api.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pr-1027/api/languages/python_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -3709,7 +3709,7 @@ <h2>Data Types<a class="headerlink" href="#data-types" title="Permalink to this
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cudaq.SpinOperator.random" title="Permalink to this definition">¶</a></dt>
<dd><dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1276301319</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.SpinOperator" title="cudaq.SpinOperator"><span class="pre">cudaq.SpinOperator</span></a></span></span></dt>
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">113636678</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.SpinOperator" title="cudaq.SpinOperator"><span class="pre">cudaq.SpinOperator</span></a></span></span></dt>
<dd></dd></dl>

<p>Return a random <a class="reference internal" href="#cudaq.SpinOperator" title="cudaq.SpinOperator"><code class="xref py py-class docutils literal notranslate"><span class="pre">SpinOperator</span></code></a> on the given number of qubits (<code class="code docutils literal notranslate"><span class="pre">qubit_count</span></code>) and composed of the given number of terms (<code class="code docutils literal notranslate"><span class="pre">term_count</span></code>). An optional seed value may also be provided.</p>
Expand Down
2 changes: 1 addition & 1 deletion pr-1027/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pr-1027/specification/cudaq/algorithmic_primitives.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ <h1><span class="section-number">12. </span>Quantum Algorithmic Primitives<a cla
<p>If you don’t specify any measurements in your kernel and allow the <code class="code docutils literal notranslate"><span class="pre">nvq++</span></code>
compiler to perform passes that introduce ancilla qubits into your kernel, it
may be difficult to discern which qubits are the ancilla qubits vs which ones
are your qubits. In this case, it is recommend that you provide explicit
are your qubits. In this case, it is recommended that you provide explicit
measurements in your kernel in order to only receive measurements from your
qubits and silently discard the measurements from the ancillary qubits.</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pr-1027/specification/quake-dialect.html
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ <h2>Motivation<a class="headerlink" href="#motivation" title="Permalink to this
└───┘ └───┘ └───┘
</pre></div>
</div>
<p>Where <code class="docutils literal notranslate"><span class="pre">I</span></code> is the identity operator. Now note that a naive implemention of
<p>Where <code class="docutils literal notranslate"><span class="pre">I</span></code> is the identity operator. Now note that a naive implementation of
this optimization for Quake would optimize away both <code class="docutils literal notranslate"><span class="pre">quake.h</span></code> operators
being applied to <code class="docutils literal notranslate"><span class="pre">%q0</span></code>. Such an implementation would have missed the fact
that a measurement is being applied to the vector, <code class="docutils literal notranslate"><span class="pre">%veq</span></code>, which contains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ is written:
If you don't specify any measurements in your kernel and allow the :code:`nvq++`
compiler to perform passes that introduce ancilla qubits into your kernel, it
may be difficult to discern which qubits are the ancilla qubits vs which ones
are your qubits. In this case, it is recommend that you provide explicit
are your qubits. In this case, it is recommended that you provide explicit
measurements in your kernel in order to only receive measurements from your
qubits and silently discard the measurements from the ancillary qubits.
Expand Down
18 changes: 9 additions & 9 deletions pr-1027/sphinx/specification/cudaq/patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ control :math:`V`. The CUDA Quantum specification requires the following syntax

.. code-block:: cpp
// Will invoke U V U^dag
cudaq::compute_action (
[&](){
/*U_code*/
},
[&]() {
/*V_code*/
}
);
// Will invoke U V U^dag
cudaq::compute_action (
[&](){
/*U_code*/
},
[&]() {
/*V_code*/
}
);
Compiler implementations must add the uncompute segment
and optimize on any controlled versions of this block of code.
2 changes: 1 addition & 1 deletion pr-1027/sphinx/specification/quake-dialect.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ other on the same qubit---visually:
└───┘ └───┘ └───┘
```

Where `I` is the identity operator. Now note that a naive implemention of
Where `I` is the identity operator. Now note that a naive implementation of
this optimization for Quake would optimize away both `quake.h` operators
being applied to `%q0`. Such an implementation would have missed the fact
that a measurement is being applied to the vector, `%veq`, which contains
Expand Down

0 comments on commit 670d9c5

Please sign in to comment.