Skip to content

Commit

Permalink
Update docs for stim target (NVIDIA#2449)
Browse files Browse the repository at this point in the history
* Update docs for stim target
* Spelling
* Slight rewording
---------
Signed-off-by: Ben Howe <[email protected]>
  • Loading branch information
bmhowe23 authored Dec 6, 2024
1 parent 9d7e20a commit bee25dc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 35 deletions.
1 change: 1 addition & 0 deletions .github/workflows/config/spelling_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ SLED
SLES
SLURM
SVD
Stim
Superpositions
TBI
TCP
Expand Down
77 changes: 42 additions & 35 deletions docs/sphinx/using/backends/simulators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,41 +300,6 @@ use the following commands:
nvq++ --target qpp-cpu program.cpp [...] -o program.x
./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 Expand Up @@ -479,6 +444,48 @@ Specific aspects of the simulation can be configured by defining the following e
The parallelism of Jacobi method (the default `CUDAQ_MPS_SVD_ALGO` setting) gives GPU better performance on small and medium size matrices.
If you expect a large number of singular values (e.g., increasing the `CUDAQ_MPS_MAX_BOND` setting), please adjust the `CUDAQ_MPS_SVD_ALGO` setting accordingly.

Clifford-Only Simulator
==================================

Stim (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
.. note::
CUDA-Q currently executes kernels using a "shot-by-shot" execution approach.
This allows for conditional gate execution (i.e. full control flow), but it
can be slower than executing Stim a single time and generating all the shots
from that single execution.

Fermioniq
==================================

Expand Down

0 comments on commit bee25dc

Please sign in to comment.