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
integrates with Azure Quantum via the azure-quantum
package. It connects to an Azure Quantum Workspace, which manages your quantum resources.
Using a Connection String
You can authenticate using an Azure connection string, which provides a direct way to access your workspace. First, retrieve your connection string by following these instructions. Then, use it to initialize a Workspace
object and pass it to AzureQuantumProvider
:
Using Environment Variables
To avoid hardcoding credentials in your code, you can store the connection string as an environment variable instead:
Then, initialize AzureQuantumProvider
without passing explicit credentials:
Related Content
- Access Keys - Azure Quantum | Microsoft Learn
- Connect to your Azure Quantum workspace with the azure-quantum Python package
- Authenticate Python apps to Azure services by using the Azure SDK for Python
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.