diff --git a/docs/sphinx/install.rst b/docs/sphinx/install.rst index b8ee7e0628..0b2272656c 100644 --- a/docs/sphinx/install.rst +++ b/docs/sphinx/install.rst @@ -663,7 +663,7 @@ To run the example, execute the command: python examples/python/bernstein_vazirani.py --size 5 -This will execute the program on the default simulator, which will use GPU-acceleration if +This will execute the program on the :ref:`default simulator `, which will use GPU-acceleration if a suitable GPU has been detected. To confirm that the GPU acceleration works, you can increase the size of the secret string, and pass the target as a command line argument: @@ -711,5 +711,3 @@ a long time for the CPU-only backend to simulate 28+ qubits! Cancel the executio You are now all set to start developing quantum applications using CUDA Quantum! Please proceed to :doc:`Using CUDA Quantum ` to learn the basics. - -See :doc:`Default Simulator ` for information on default target. diff --git a/docs/sphinx/using/simulators.rst b/docs/sphinx/using/simulators.rst index 7012d327ca..4ab6e0a92c 100644 --- a/docs/sphinx/using/simulators.rst +++ b/docs/sphinx/using/simulators.rst @@ -266,6 +266,8 @@ Specific aspects of the simulation can be configured by defining the following e Setting random seed, via :code:`cudaq::set_random_seed`, is not supported for this backend due to a limitation of the :code:`cuTensorNet` library. This will be fixed in future release once this feature becomes available. +.. _default-simulator: + Default Simulator ================================== If no explicit target is set, i.e. if the code is compiled without any :code:`--target` flags, then CUDA Quantum makes a default choice for the simulator. @@ -279,9 +281,19 @@ This environment variable can be set to any non-hardware backend. Any invalid va For CUDA Quantum Python API, the environment variable at the time when `cudaq` module is imported is relevant, not the value of the environment variable at the time when the simulator is invoked. For example, -.. code:: bash - CUDAQ_DEFAULT_SIMULATOR=density-matrix-cpu nvq++ src.cpp +.. tab:: C++ + + .. code:: bash + + CUDAQ_DEFAULT_SIMULATOR=density-matrix-cpu nvq++ program.cpp [...] -o program.x + ./program.x + +.. tab:: Python + + .. code:: bash + + CUDAQ_DEFAULT_SIMULATOR=density-matrix-cpu python3 program.py [...] This will use the density matrix simulator target.