> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# IonQ Cloud

> Access to the trapped ion devices via IonQ Cloud. 

### Overview

Adding to the available hardware platforms, IonQ Cloud is now accessible via Haiqu SDK to use IonQ's trapped-ion QPUs (Quantum Processing Units). This integration allows users to leverage the computational power of IonQ's quantum processors directly from the Haiqu SDK environment.

<Tip>
  ### Key Features of the Integration

  **Direct Access to IonQ QPUs:** Haiqu SDK users can execute quantum algorithms and experiments on IonQ's quantum hardware without needing extensive configuration.

  **Enhanced Workflow Management:** Haiqu SDK offers tools to manage and optimize jobs submitted to IonQ's QPUs, making the development and execution of quantum programs more efficient.
</Tip>

### How to Access QPUs via IonQ Cloud

The integration is designed to be user-friendly, with a focus on simplifying the process of accessing quantum resources. Below is a step-by-step guide to using Haiqu SDK for this purpose.

<Steps>
  <Step title="Obtain an IonQ Cloud API key">
    Users must acquire an access token from IonQ. Should you want to run your workloads via IonQ Cloud, make sure to create an API key on IonQ Cloud  [here](https://cloud.ionq.com/settings/keys). This token serves as a secure credential to authorize access to the quantum processors.
  </Step>

  <Step title="Configure Haiqu SDK">
    To connect Haiqu SDK with IonQ Cloud QPUs, users need to input the obtained access token into the options as `ionq_api_key`. The token can be passed as a variable directly through the SDK's API.

    <CodeGroup>
      ```python credentials in options theme={null}
      options = {
          "transpilation_options": {
              "optimization_level": 3,
          },
          "ionq_api_key": "<YOUR_TOKEN>",
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Submit Quantum Jobs">
    Once authenticated, users can submit quantum circuits or algorithms to IonQ QPUs directly through Haiqu SDK. The SDK handles all backend operations, including job queuing, execution, and result retrieval.

    <Note>
      Make sure to check which devices are available in your environment by calling `haiqu.list_devices()` first!
    </Note>

    <CodeGroup>
      ```python by device_id theme={null}
      results_qpu = haiqu.run(
          haiqu_circuit,
          shots=1000,
          device_id="ionq_qpu.forte-enterprise-1",
          options=options,
      )
      ```

      ```python by device theme={null}
      device = haiqu.get_device("ionq_qpu.forte-enterprise-1")

      results_qpu = haiqu.run(
          haiqu_circuit,
          shots=1000,
          device=device,
          options=options,
      )
      ```
    </CodeGroup>
  </Step>

  <Step title="Monitor and Retrieve Results">
    Haiqu SDK provides monitoring tools to track the status of quantum jobs in real-time. Once a job is completed, users can retrieve the results and analyze them within the SDK environment.

    ```python theme={null}
    results_qpu.retrieve_status()

    results_qpu.to_json()
    ```

    <Tip>
      ### Benefits of the Integration

      **Simplified Access**: The integration eliminates complex setup procedures and allows users to focus on quantum application development.

      **Scalability**: Whether you are a researcher, developer, or enthusiast, Haiqu SDK enables scalable access to quantum resources tailored to your needs.

      **Flexibility**: The SDK supports a wide range of quantum programming libraries, making it a versatile tool for diverse projects.
    </Tip>
  </Step>
</Steps>

### Using the IonQ Simulator

Alongside the physical QPUs, IonQ Cloud exposes a cloud simulator under the device ID `ionq_simulator`. It runs on IonQ Cloud, so it uses the same `ionq_api_key` credential as the QPUs (it is not one of the credential-free local simulators).

By default the simulator is **ideal (noiseless)**. To model the noise of a specific IonQ device, pass a `noise_model` string identifier — the name of a characterized IonQ device (e.g. `"aria-1"`) — inside `options`.

<Note>
  The `noise_model` for `ionq_simulator` must be a **string identifier** naming an IonQ device. (This differs from `aer_simulator`, which expects a `dict` or a `qiskit_aer.NoiseModel` object.) Noisy simulation is capped at **12 qubits**, enforced server-side.
</Note>

<CodeGroup>
  ```python ideal (noiseless) theme={null}
  options = {
      "ionq_api_key": "<YOUR_TOKEN>",
  }

  results_sim = haiqu.run(
      haiqu_circuit,
      shots=1000,
      device_id="ionq_simulator",
      options=options,
  )
  ```

  ```python with device noise model theme={null}
  options = {
      "ionq_api_key": "<YOUR_TOKEN>",
      "noise_model": "aria-1",
  }

  results_sim = haiqu.run(
      haiqu_circuit,
      shots=1000,
      device_id="ionq_simulator",
      options=options,
  )
  ```
</CodeGroup>

### Conclusion

Haiqu SDK's integration with IonQ's hardware marks an important step in making quantum computing more accessible and practical for a broad audience. Users can securely and efficiently access IonQ trapped ion quantum hardware, opening new possibilities in research, development, and innovation. Whether you’re an experienced quantum programmer or a curious beginner, Haiqu SDK provides the tools you need to explore the quantum frontier with ease.

 
