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¶
- Log in to the Azure Portal
- Create a new Azure Quantum workspace
- Add providers (IonQ, Quantinuum, Rigetti, etc.) to your workspace
2. Get Connection String¶
- Navigate to your Azure Quantum workspace
- Go to Overview > Connection string
- Copy the connection string
3. Configure Environment¶
Add to your .env file:
The connection string format is:
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¶
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:
- Enabled in your workspace
- Available in your region
- 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.