Skip to content

Commit

Permalink
Docs preview for PR #2236.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Oct 1, 2024
1 parent 1ee3337 commit 6e2c719
Show file tree
Hide file tree
Showing 84 changed files with 300 additions and 104 deletions.
1 change: 1 addition & 0 deletions pr-2236/_sources/using/backends/backends.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CUDA-Q Backends
* :ref:`qpp-cpu <qpp-cpu-backend>`
* :ref:`quantinuum <quantinuum-backend>`
* :ref:`remote-mqpu <mqpu-platform>`
* :ref:`stim <stim-backend>`
* :ref:`tensornet <tensor-backends>`
* :ref:`tensornet-mps <tensor-backends>`

Expand Down
34 changes: 34 additions & 0 deletions pr-2236/_sources/using/backends/simulators.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,40 @@ use the following commands:
./program.x
Clifford-Only Simulation (CPU)
++++++++++++++++++++++++++++++++++

.. _stim-backend:

This target provides a fast simulator for circuits containing *only* Clifford
gates. Any non-Clifford gates (such as T gates and Toffoli gates) are not
supported. This simulator is based on the `Stim <https://github.com/quantumlib/Stim>`_
library.

To execute a program on the :code:`stim` target, use the following commands:

.. tab:: Python

.. code:: bash
python3 program.py [...] --target stim
The target can also be defined in the application code by calling

.. code:: python
cudaq.set_target('stim')
If a target is set in the application code, this target will override the :code:`--target` command line flag given during program invocation.

.. tab:: C++

.. code:: bash
nvq++ --target stim program.cpp [...] -o program.x
./program.x
Tensor Network Simulators
==================================

Expand Down
1 change: 1 addition & 0 deletions pr-2236/api/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/api/default_ops.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/api/languages/cpp_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
3 changes: 2 additions & 1 deletion pr-2236/api/languages/python_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down Expand Up @@ -2127,7 +2128,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">3652427492</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.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator"><span class="pre">cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.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">1105382576</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.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator"><span class="pre">cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.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
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/Divisive_clustering.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/H2-MRQKS.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/Shors.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/afqmc.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/cost_minimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
5 changes: 3 additions & 2 deletions pr-2236/examples/python/tutorials/deutschs_algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down Expand Up @@ -680,7 +681,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
</section>
<section id="Quantum-oracles">
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading">¶</a></h2>
<p><img alt="dcab44b44cb54c499d5ab33688945f3d" class="no-scaled-link" src="../../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p><img alt="d1be427705454a01a0aee1f57b1315c0" class="no-scaled-link" src="../../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p>Suppose we have <span class="math notranslate nohighlight">\(f(x): \{0,1\} \longrightarrow \{0,1\}\)</span>. We can compute this function on a quantum computer using oracles which we treat as black box functions that yield the output with an appropriate sequence of logic gates.</p>
<p>Above you see an oracle represented as <span class="math notranslate nohighlight">\(U_f\)</span> which allows us to transform the state <span class="math notranslate nohighlight">\(\ket{x}\ket{y}\)</span> into:</p>
<div class="math notranslate nohighlight">
Expand Down Expand Up @@ -728,7 +729,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
<h2>Deutschs’ Algorithm:<a class="headerlink" href="#Deutschs'-Algorithm:" title="Permalink to this heading">¶</a></h2>
<p>Our aim is to find out if <span class="math notranslate nohighlight">\(f: \{0,1\} \longrightarrow \{0,1\}\)</span> is a constant or a balanced function? If constant, <span class="math notranslate nohighlight">\(f(0) = f(1)\)</span>, and if balanced, <span class="math notranslate nohighlight">\(f(0) \neq f(1)\)</span>.</p>
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
<p><img alt="035ccfc8c0984bf0bb2d9a37bd806db4" class="no-scaled-link" src="../../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<p><img alt="5be62c04b757403cb0a615428fa13e06" class="no-scaled-link" src="../../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<div class="math notranslate nohighlight">
\[\ket{\psi_0} = \ket{01}
\tag{1}\]</div>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/hadamard_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/hybrid_qnns.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/noisy_simulations.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2236/examples/python/tutorials/qaoa.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#single-gpu">Single-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#multi-node-multi-gpu">Multi-node multi-GPU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#openmp-cpu-only">OpenMP CPU-only</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../using/backends/simulators.html#clifford-only-simulation-cpu">Clifford-Only Simulation (CPU)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../using/backends/simulators.html#tensor-network-simulators">Tensor Network Simulators</a><ul>
Expand Down
Loading

0 comments on commit 6e2c719

Please sign in to comment.