Skip to content

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

There are two possible modes of operation:

  • Running through Classiq-Azure integration. In this mode you don't need to provide credentials nor location.
  • Executing on your private Azure Quantum Workspace by providing the needed credentials. For more details, see Executing on Your Quantum Workspace.
from classiq.execution import (
    AzureCredential,
    AzureBackendPreferences,
)

# Running through Classiq-Azure integration:
preferences = AzureBackendPreferences(
    backend_name="Name of requsted simulator or hardware",
)

# Running through private Azure account:
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",
)

Opening info tab

For academic users, backends will be run through Classiq-Azure integration by default. This configuration can be overridden by switching on "Run with my own credentials" option in the backends summary section on Execution page like so:

Config run with own credentials

Executing on Your Quantum Workspace

Execution on your private Azure Quantum Workspace requires an Azure account with an active subscription. You will need to provide these details in order to authenticate:

  • Resoucre 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.

Here we briefly describe the steps to configure and achieve these details:

  1. Create an Azure Quantum Workspace (see Azure documentation). At the workspace overview you can find its Location and Resoucre ID.

  2. Register a new application in Azure, including creating a client secret (see Azure documentation). At the end of this step you will have 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).

  4. Add the Jobs.ReadWrite permission (under Azure Quantum) to the application (see Azure documentation).