AzureQuantumProvider
Runtime integration for streamlined access to Azure Quantum supported devices.
API Reference: qbraid.runtime.azure
Installation & Setup
To interface with Azure Quantum supported devices, install the azure
extra:
Then, follow the Azure Quantum setup instructions to create a workspace and get your credentials.
Authentication Methods
The AzureQuantumProvider
can be initialized in several ways:
Using Environment Variables
The simplest method is to set environment variables that will be used to automatically create an Azure Workspace:
You can then create the provider without any arguments:
Using Azure Authentication Objects
For more control over authentication, you can directly pass Azure credential or workspace objects:
The ClientSecretCredential
requires:
- A tenant ID (Azure Active Directory tenant)
- A client ID (Application ID)
- A client secret (Application secret)
These values can be obtained by creating an App Registration in your Azure Active Directory. See the Azure authentication documentation for more details on setting up service principal authentication.
Choose the authentication method that best fits your use case and security requirements.
Basic Usage
Submit a Quantum Task to an Azure Quantum device using the AzureQuantumProvider
:
Now that we’ve instantiated our device, in this case the IonQ simulator on Azure Quantum, we can construct a quantum circuit and submit a task using the .run
method:
We now have job
which is of type AzureQuantumTask
, which inherits from QuantumJob
. To see the results:
See how to visualize these results in the Visualization section.
Supported Providers
Azure Quantum provides access to quantum hardware and simulators from several providers:
- IonQ
- Quantinuum
- Rigetti
- QCI
Each provider may have different requirements and capabilities. Refer to the Azure Quantum documentation for more details about specific providers.