How to manage quotas in Azure Quantum
Azure Quantum quotas are provider-defined limits on the usage of QPUs targets. Quotas help prevent accidental cost overages for the user while also preserving the integrity of the provider's systems. Quotas are based on your provider plan selection and can usually be increased with a support ticket.
The usage tracked by quotas is not necessarily tied to a cost or credit, but it might be correlated.
Tip
When you create an Azure Quantum workspace you automatically get USD500 free Azure Quantum Credits for each quantum hardware provider. You can use the Azure Quantum Credits to submit your first quantum programs to real quantum hardware.
How quotas are calculated
In Azure Quantum, hardware and software providers define and control the quotas of their offerings. For detailed quota information, see each provider reference page. If a provider doesn't appear in the following list, then that provider doesn't define any quotas.
Viewing remaining quota
The Azure Quantum usage and quotas are measured in terms of each provider's unit of usage. Some providers don't define any quotas and will not have usage information to display.
Note
If you are using an Azure Quantum Credits plan, and not a billing plan, the quota information maps to your allocated credits. In that case, the quota lists the total number of credits you have received.
Track quota using Azure portal
- Sign in to the Azure portal, using the credentials for your Azure subscription.
- Select your Azure Quantum workspace.
- In the left panel, under Operations, go to the Credits and quotas tab and select the Quotas blade.
- See the consumed and the remaining quotas for each selected provider. Notice that quota information is displayed in three columns.
- Workspace usage: The usage limit for the current workspace. Each Azure Quantum workspace has a usage limit.
- Azure subscription usage: The usage for all workspaces within the current region and subscription. Not all quotas are tracked at this level.
- Cadence: The period when your quota is renewed. If monthly, the usage is reset on the 1st of every month. If one-time, usage is never reset.
In this view, Azure Quantum Credits are included as quotas. This enables the user to see the credit information expressed in terms of the units that the provider tracks, as well as the interval associated.
Track quota using Azure CLI
You can see your quotas by using the Azure Command-Line Interface (Azure CLI). For more information, see How to manage quantum workspaces with the Azure CLI.
Install the Azure CLI
quantum
extension. Open a command prompt and run the following command, which will also upgrade the extension if a previous version is already installed.az extension add --upgrade -n quantum
Log in to Azure using your credentials. You will see list of subscriptions associated with your account.
az login
Specify the Subscription that you want to use.
az account set -s <Your subscription ID>
Select the Workspace that you want to use. Note that you also need to specify the resource group and the location.
az quantum workspace set \ -g MyResourceGroup \ -w MyWorkspace \ -l MyLocation \ -o table
Use the
az quantum workspace quotas
command to display quotas information for the selected workspace.az quantum workspace quotas -o table
|Dimension | Holds | Limit | Period | ProviderId | Scope | Utilization| |--------- | ----- | --------- | -------- | ----------| ------------ | -----------| |qgs | 0.0 | 8333334.0 | Infinite | ionq | Subscription | 33334.0| |hqc | 0.0 | 800.0 | Infinite | quantinuum | Subscription | 0.0|
See the above output as an example. In this case, the qgs
row shows that the account has a limit of 8333334 qgs
with IonQ, of which 33334 qgs
have been used. The account also has a limit of 800
HQCs with Quantinuum, of which 0
have been used.
The Scope column indicates whether the quota refers to the current workspace or the subscription.
- Workspace: Quota is tracked for an individual workspace.
- Subscription: Quota is tracked together for all workspaces within the same subscription/region.
The Period column indicates the period when your quota is renewed.
- Monthly: The usage is reset on the 1st of every month.
- Infinite: The usage is never reset (also referred as one-time in the Azure portal view).
Track quota using Python SDK
Install the latest version of the
azure-quantum
Python package.Open a new Python file. Instantiate a
Workspace
object, which allows you to connect to the workspace you've previously deployed in Azure.from azure.quantum import Workspace # Copy the following settings for your workspace workspace = Workspace ( resource_id = "", # Add your resource_id location = "" # Add your workspace location (for example, "westus") )
Use the
get_quotas
method to display the quotas information for the selected workspace.quotas = workspace.get_quotas()
[{'dimension': 'qgs', 'scope': 'Subscription', 'provider_id': 'ionq', 'utilization': 33334.0, 'holds': 0.0, 'limit': 16666667.0, 'period': 'Infinite'}, {'dimension': 'hqc', 'scope': 'Subscription', 'provider_id': 'quantinuum', 'utilization': 0.0, 'holds': 0.0, 'limit': 40.0, 'period': 'Infinite'}, {'dimension': 'ehqc', 'scope': 'Subscription', 'provider_id': 'quantinuum', 'utilization': 0.0, 'holds': 0.0, 'limit': 160.0, 'period': 'Infinite'}, {'dimension': 'combined_job_hours', 'scope': 'Workspace', 'provider_id': 'Microsoft', 'utilization': 0.0, 'holds': 0.0, 'limit': 20.0, 'period': 'Monthly'}, {'dimension': 'combined_job_hours', 'scope': 'Subscription', 'provider_id': 'Microsoft', 'utilization': 0.011701412083333333, 'holds': 0.0, 'limit': 1000.0, 'period': 'Monthly'}]
See the above output as an example. In this case, the qgs
row shows that the account has a limit of 8333334 qgs
with IonQ, of which 33334 qgs
have been used. The number of concurrent jobs is the number of jobs that can be queued per workspace at any one time.
The scope
item indicates whether the quota refers to the current workspace or the subscription.
- Workspace: Quota is tracked for an individual workspace.
- Subscription: Quota is tracked together for all workspaces within the same subscription/region.
The period
item indicates the period when your quota is renewed.
- Monthly: The usage is reset on the 1st of every month.
- Infinite: The usage is never reset (also referred as one-time in the Azure portal view).
Tip
The get_quotas
method return the results in the form of a Python dictionary. For a more human-readable format, use the following code samples to print a summary of > the remaining quotas at subscription and workspace level.
Copy the following code to track quota at subscription level.
# This gathers usage against quota for the various providers (quota is set at the subscription level).
# Note that a provider may have multiple quotas, such as Quantinuum that limits usage of their Emulator.
rigetti_quota = 0
ionq_quota = 0
quantinuum_hqc_quota = 0
quantinuum_ehqc_quota = 0
rigetti_quota_utilization = 0
ionq_quota_utilization = 0
quantinuum_hqc_quota_utilization = 0
quantinuum_ehqc_quota_utilization = 0
for quota in workspace.get_quotas():
if (quota['provider_id'] == 'rigetti'):
rigetti_quota = quota['limit']
rigetti_quota_utilization = quota['utilization']
if (quota['provider_id'] == 'ionq'):
ionq_quota = quota['limit']
ionq_quota_utilization = quota['utilization']
if (quota['dimension'] == 'hqc'):
quantinuum_hqc_quota = quota['limit']
quantinuum_hqc_quota_utilization = quota['utilization']
if (quota['dimension'] == 'ehqc'):
quantinuum_ehqc_quota = quota['limit']
quantinuum_ehqc_quota_utilization = quota['utilization']
print('Rigetti quota use: ', "{:,}".format(rigetti_quota_utilization), '/', "{:,}".format(rigetti_quota))
print('IonQ quota use:', "{:,}".format(ionq_quota_utilization), '/', "{:,}".format(ionq_quota))
print('Quantinuum HQC quota use:', "{:,}".format(quantinuum_hqc_quota_utilization), '/', "{:,}".format(quantinuum_hqc_quota))
print('Quantinuum eHQC quota use:', "{:,}".format(quantinuum_ehqc_quota_utilization), '/', "{:,}".format(quantinuum_ehqc_quota))
Copy the following code to track quota at workspace level.
# This gathers usage against quota for the various providers for the current workspace
# As there can be multiple workspaces in a subscription, the quota usage for the workspace is less or equal to usage against quota at the subscription level
amount_utilized_rigetti = 0
amount_utilized_ionq = 0
amount_utilized_quantinuum_hqc = 0
amount_utilized_quantinuum_ehqc = 0
for job in workspace.list_jobs():
if (job.details.cost_estimate != None):
for event in job.details.cost_estimate.events:
if (event.amount_consumed > 0):
#print(event.amount_consumed, event.dimension_name, 'on', job.details.provider_id)
if (job.details.provider_id == 'rigetti'):
amount_utilized_rigetti += event.amount_consumed
if (job.details.provider_id == 'ionq'):
amount_utilized_ionq += event.amount_consumed
if (job.details.provider_id == 'quantinuum'):
#print(event.amount_consumed, event.dimension_name, 'on', job.details.provider_id)
#print(event)
if (event.dimension_id == 'hqc'):
amount_utilized_quantinuum_hqc += event.amount_consumed
else:
amount_utilized_quantinuum_ehqc += event.amount_consumed
print(job.id, event)
print('Rigetti quota use in current workspace: ', "{:,}".format(amount_utilized_rigetti), '/', "{:,}".format(rigetti_quota))
print('IonQ quota use in current workspace:', "{:,}".format(amount_utilized_ionq), '/', "{:,}".format(ionq_quota))
print('Quantinuum HQC quota use in current workspace:', "{:,}".format(amount_utilized_quantinuum_hqc), '/', "{:,}".format(quantinuum_hqc_quota))
print('Quantinuum eHQC quota use in current workspace:', "{:,}".format(amount_utilized_quantinuum_ehqc), '/', "{:,}".format(quantinuum_ehqc_quota))
Requesting additional quota
If you are not using an Azure Quantum Credits plan, then you can request quota increases by raising a support ticket.
Sign in to the Azure portal, using the credentials for your Azure subscription.
Select your Azure Quantum workspace.
In the left panel, under Operations, go to the Credits and quotas blade and select the Quotas tab.
Either press the Increase button on the quota page or select the New support request button on the side panel in the portal.
A support ticket will open. Follow these steps to fill out the request.
- Describe the issue as Azure Quantum Quota Override Request
- Select Technical for “Issue Type”
- Select the subscription that the workspace is in
- Select All services
- Choose Azure Quantum – Preview as “Service Type”
- Choose the workspace you want to change quota for under Resource
- Choose Other for problem type
- Advance to Solutions and then again to Details
- Fill out all fields. For Description include the following:
- Name of the provider you want to change quotas for
- Whether you want to change quotas for the subscription scope or workspace scope
- Which quotas you want to change, and by how much
- Any justification for why you are increasing your quota can help us to decide in some cases.