Skip to content

Commit

Permalink
Docs preview for PR #2509.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Jan 17, 2025
1 parent ee74594 commit 6e52ca9
Show file tree
Hide file tree
Showing 89 changed files with 262 additions and 7 deletions.
40 changes: 39 additions & 1 deletion pr-2509/_sources/using/backends/dynamics.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,42 @@ backend target.
If the output is a '`None`' string, it indicates that your Torch installation does not support CUDA.
In this case, you need to install a CUDA-enabled Torch package via other mechanisms, e.g., building Torch from source or
using their Docker images.


Multi-GPU Multi-Node Execution
+++++++++++++++++++++++++++++++

.. _cudensitymat_mgmn:

CUDA-Q ``dynamics`` target supports parallel execution on multiple GPUs.
To enable parallel execution, the application must initialize MPI as follows.


.. tab:: Python

.. literalinclude:: ../../snippets/python/using/backends/dynamics.py
:language: python
:start-after: [Begin MPI]
:end-before: [End MPI]

.. code:: bash
mpiexec -np <N> python3 program.py
By initializing the MPI execution environment (via `cudaq.mpi.initialize()`) in the application code and
invoking it via an MPI launcher, we have activated the multi-node multi-GPU feature of the ``dynamics`` target.
Specifically, it will detect the number of processes (GPUs) and distribute the computation across all available GPUs.


.. note::
The number of MPI processes must be a power of 2, one GPU per process.

.. note::
Not all integrators are capable of handling distributed state. Errors will be raised if parallel execution is activated
but the selected integrator does not support distributed state.

.. warning::
As of cuQuantum version 24.11, there are a couple of `known limitations <https://docs.nvidia.com/cuda/cuquantum/24.11.0/cudensitymat/index.html>`__ for parallel execution:

- Computing the expectation value of a mixed quantum state is not supported. Thus, `collapse_operators` are not supported if expectation calculation is required.

- Some combinations of quantum states and quantum many-body operators are not supported. Errors will be raised in those cases.
1 change: 1 addition & 0 deletions pr-2509/api/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/api/default_ops.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/api/languages/cpp_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/api/languages/python_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/afqmc.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/bernstein_vazirani.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/cost_minimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
5 changes: 3 additions & 2 deletions pr-2509/applications/python/deutschs_algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down Expand Up @@ -805,7 +806,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="daf7914b90fe4a6f9cef076e51cedf02" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p><img alt="e23dcd640d434486bfce0028d1dc91a3" 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 logical 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 @@ -853,7 +854,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-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="1a31271b00ff4643a35c6bb615ce62da" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<p><img alt="755f26ddca104b3c93a713225b7143ab" 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
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/hadamard_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/hybrid_qnns.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/krylov.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/logical_aim_sqale.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/qaoa.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/quantum_fourier_transform.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/quantum_teleportation.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/quantum_volume.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/readout_error_mitigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/shors.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
1 change: 1 addition & 0 deletions pr-2509/applications/python/trotter.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#operator">Operator</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#time-dependent-dynamics">Time-Dependent Dynamics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#numerical-integrators">Numerical Integrators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../using/backends/dynamics.html#multi-gpu-multi-node-execution">Multi-GPU Multi-Node Execution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../using/install/install.html"> Installation</a><ul>
Expand Down
Loading

0 comments on commit 6e52ca9

Please sign in to comment.