Skip to content

Azure Quantum

Run benchmarks on quantum computers through Microsoft Azure Quantum.

Prerequisites

  • An Azure account
  • An Azure Quantum workspace
  • Azure Quantum connection string

Setup

1. Create an Azure Quantum Workspace

  1. Log in to the Azure Portal
  2. Create a new Azure Quantum workspace
  3. Add providers (IonQ, Quantinuum, Rigetti, etc.) to your workspace

2. Get Connection String

  1. Navigate to your Azure Quantum workspace
  2. Go to Overview > Connection string
  3. Copy the connection string

3. Configure Environment

Add to your .env file:

AZURE_QUANTUM_CONNECTION_STRING="<your-connection-string>"

The connection string format is:

SubscriptionId=xxx;ResourceGroupName=xxx;WorkspaceName=xxx;Location=xxx

Discovering Devices

Azure Quantum provides access to multiple hardware providers (IonQ, Quantinuum, Rigetti). Available devices depend on your workspace configuration.

To see currently available devices:

from qbraid.runtime import load_provider

provider = load_provider("azure")
for device in provider.get_devices():
    print(f"{device.id}: {device.status}")

Or check your workspace in the Azure Portal under Providers.

Note

Enable providers in your Azure Quantum workspace to access their devices.

Usage

Dispatch to Azure Quantum Hardware

mgym job dispatch metriq_gym/schemas/examples/wit.example.json \
    --provider azure --device ionq.qpu.aria-1

Dispatch to Azure Quantum Simulator

mgym job dispatch metriq_gym/schemas/examples/wit.example.json \
    --provider azure --device ionq.simulator

Poll Results

mgym job poll <JOB_ID>

Pricing

See Azure Quantum Pricing for current rates.

Troubleshooting

Connection Errors

Verify your connection string:

from azure.quantum import Workspace

workspace = Workspace(
    subscription_id="...",
    resource_group="...",
    name="...",
    location="..."
)
print(workspace.get_targets())

Provider Not Available

Ensure the provider is:

  1. Enabled in your workspace
  2. Available in your region
  3. Accessible with your subscription tier

Job Failures

Check job status in the Azure Portal under your workspace's Job management section for detailed error messages.