> ## Documentation Index
> Fetch the complete documentation index at: https://prod-mint.classiq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Execution on Classiq simulators

Classiq offers execution on simulators that are located at the Classiq backend.

<Tip>
  These simulators don't require an account on a different cloud, and are usually
  fast to execute.
</Tip>

## Simulator Usage

<Tabs>
  <Tab title="SDK">
    [comment]: DO_NOT_TEST

    ```python theme={null}
    from classiq import ClassiqBackendPreferences

    preferences = ClassiqBackendPreferences(
        backend_name="Name of requested quantum simulator"
    )
    ```
  </Tab>

  <Tab title="IDE">
    <img src="https://mintcdn.com/classiq/xLAFEkBDpT-na34E/user-guide/resources/execution_classiq_simulators.png?fit=max&auto=format&n=xLAFEkBDpT-na34E&q=85&s=1c6af1c4b1c1107dd104990789abd77d" alt="Opening info tab" width="804" height="396" data-path="user-guide/resources/execution_classiq_simulators.png" />
  </Tab>
</Tabs>

Classiq supports following simulators:

1. `simulator`: A general-purpose quantum simulator capable of handling circuits with up to 25 qubits.

2. `simulator_statevector`: Returns he full state vector, including phase information of the output state produced by the quantum circuit. Due to the exponential growth of the state vector, this simulator is suitable only for circuits with up to 18 qubits.

3. `simulator_density_matrix`: Uses density matrices to simulate open quantum circuits and supports simulations for circuits containing up to 25 qubits.

4. `simulator_matrix_product_state`: Efficiently simulates quantum circuits of up to 25 qubits, especially suited for circuits exhibiting low entanglement.

You can access these simulators through `ClassiqSimulatorBackendNames`.

## Nvidia Simulator Usage

Execution on Nvidia simulators requires specific license permissions.
Before first use, contact [Classiq support](mailto:support@classiq.io).

Classiq supports two types of Nvidia simulators, with the same inputs and outputs but different underlying infrastructure, capable of simulating circuits with up to 29 qubits:

1. The backends `ClassiqNvidiaBackendNames.SIMULATOR` and `ClassiqNvidiaBackendNames.SIMULATOR_STATEVECTOR` are better suited when multiple circuits need to be executed in sequence.
2. The backends `ClassiqNvidiaBackendNames.BRAKET_NVIDIA_SIMULATOR` and `ClassiqNvidiaBackendNames.BRAKET_NVIDIA_SIMULATOR_STATEVECTOR` are executed using Amazon Braket's infrastructure, and provide faster execution for single circuits. Credentials for AWS are not needed.

Both `ClassiqNvidiaBackendNames.SIMULATOR_STATEVECTOR` and `ClassiqNvidiaBackendNames.braket_nvidia_simulator_statevector` return the state vector at the end of the circuit's execution (analogous to the
above `simulator_statevector`).

**Precision:** Nvidia and Braket Nvidia simulators use **double precision** (float64) by default. Set `use_single_precision=True` in `ClassiqBackendPreferences` to use single precision (float32), which can be faster and use less memory at the cost of numerical precision.

<Tabs>
  <Tab title="SDK">
    ```python theme={null}
    from classiq import ClassiqBackendPreferences, ClassiqNvidiaBackendNames

    preferences = ClassiqBackendPreferences(
        backend_name=ClassiqNvidiaBackendNames.SIMULATOR
    )

    # Optional: use single precision (float32) instead of default double (float64)
    preferences_single = ClassiqBackendPreferences(
        backend_name=ClassiqNvidiaBackendNames.BRAKET_NVIDIA_SIMULATOR,
        use_single_precision=True,
    )
    ```
  </Tab>

  <Tab title="IDE">
    <img src="https://mintcdn.com/classiq/xLAFEkBDpT-na34E/user-guide/resources/execution_nvidia_simulator.png?fit=max&auto=format&n=xLAFEkBDpT-na34E&q=85&s=89f973a5cec3d6e2885462c8f9897e1a" alt="Opening info tab" width="1046" height="796" data-path="user-guide/resources/execution_nvidia_simulator.png" />
  </Tab>
</Tabs>

<Note>
  The number of execution requests to the NVIDIA simulator may be limited.
  If you encounter any problem, contact
  [Classiq support](mailto:support@classiq.io).
</Note>

## Supported Backends

Included simulators:

* "nvidia\_simulator\_statevector"
* "simulator"
* "simulator\_statevector"
* "simulator\_density\_matrix"
* "nvidia\_simulator"
* "braket\_nvidia\_simulator"
* "simulator\_matrix\_product\_state"
* "braket\_nvidia\_simulator\_statevector"
