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

# Execution on Azure Quantum Cloud

The Classiq executor supports execution on Azure Quantum cloud simulators and hardware.

> [!TIP]
>
> Backends may sometimes be unavailable. Check the availability windows with Azure Quantum.

## Usage

To run on Azure Quantum, provide the credentials and location of your own Azure Quantum Workspace.
For the details to collect, see [Executing on Your Quantum Workspace](#executing-on-your-quantum-workspace).

> [tab] SDK
>
> [comment]: DO_NOT_TEST
>
> ```python theme={null}
> from classiq import (
>     AzureCredential,
>     AzureBackendPreferences,
> )
>
> cred = AzureCredential(
>     tenant_id="Azure Tenant ID (from Azure Active Directory)",
>     client_id="Azure Application (client) ID",
>     client_secret="Azure Client Secret",
>     resource_id="Azure Quantum Workspace Resource ID",
> )
>
> preferences = AzureBackendPreferences(
>     backend_name="Name of requsted simulator or hardware",
>     credentials=cred,
>     location="Azure region of Quantum Workspace",
> )
> ```

> [tab] IDE
>
> ![Opening info tab](https://mintcdn.com/classiq/xLAFEkBDpT-na34E/user-guide/resources/execution_azure_login.png?fit=max\&auto=format\&n=xLAFEkBDpT-na34E\&q=85\&s=ca6769dfe8ec6b905a87f0ba5cc7725d)

> [!NOTE]
>
> [Run via Classiq](https://docs.classiq.io/user-guide/execution/budget-management.md) is not available for Azure Quantum backends in the Classiq IDE, for execution or benchmarking. Jobs submitted from the SDK with Run via Classiq are rejected for Azure QPUs and all Quantinuum targets. Because `AzureBackendPreferences` runs via Classiq when `credentials` is omitted, always pass `credentials` for these targets.

## Executing on Your Quantum Workspace

Execution on your private Azure Quantum Workspace requires an Azure account with
an active subscription. To authenticate, provide these details:

* `Resource ID`: Azure Quantum Workspace resource ID.
* `Location`: Azure region of the Quantum Workspace.
* `Tenant ID`: Azure Active Directory tenant ID.
* `Client ID`: Azure client ID of a registered application.
* `Client secret`: Azure client secret of a registered application.

Following is a brief description of the steps to configure and acquire these details:

1. Create an Azure Quantum Workspace (see
   [Azure documentation](https://docs.microsoft.com/en-us/azure/quantum/how-to-create-workspace)).
   In the workspace overview are the `Location` and `Resource ID`.

2. Register a new application in Azure, including creating a client secret (see
   [Azure documentation](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-on-premises-apps?tabs=azure-portal#1---register-the-application-in-azure)).
   At the end of this step are the settings for `Client ID`, `Client secret`, and `Tenant ID`.

3. Assign the `Contributor` role to the registered application on the Quantum Workspace
   or a resource group containing the Quantum Workspace (see
   [Azure documentation](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-on-premises-apps?tabs=azure-portal#2---assign-roles-to-the-application-service-principal)).

4. Add the `Jobs.ReadWrite` permission (under `Azure Quantum`) to the application (see
   [Azure documentation](https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-add-app-roles-in-azure-ad-apps#assign-app-roles-to-applications)).

## Supported Backends

Included hardware:

* "ionq.qpu.forte-1"
* "ionq.qpu.forte-enterprise-1"

Included simulators:

* "ionq.simulator"
* "rigetti.sim.qvm"
* "quantinuum.sim.h2-1sc"
* "quantinuum.sim.h2-1e"

## IonQ Hardware Noise Simulation (emulate)

> [!WARNING]
>
> Emulation on Azure Quantum is temporarily unavailable. Setting `emulate=True` in the `config` of an `azure/...` backend raises `ValueError: emulate is currently disabled for Azure Quantum backends`. To run a circuit under an IonQ hardware noise model, use the IonQ provider with `emulate=True`, as described in [IonQ hardware noise simulation (emulate)](https://docs.classiq.io/user-guide/execution/cloud-providers/ionq-backends.md#ionq-hardware-noise-simulation-emulate).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.