-
Notifications
You must be signed in to change notification settings - Fork 90
Submitting jobs to Azure Quantum
The VS Code extension supports integration with the Azure Quantum service to submit jobs to hardware and simulators from various providers. You can see the list of current providers in the Azure Quantum documentation at https://learn.microsoft.com/en-us/azure/quantum/qc-target-list. This extension can only submit jobs to provider 'targets' that support QIR. See the QIR wiki page for more information.
Integration with Azure Quantum is done via a section added to the Explorer view of the VS Code sidebar. Ensure this is open via Cmd/Ctrl+Shift+E
or the View
menu, then expand the QUANTUM WORKSPACES
section. Before sign-in, it will appear as shown below:
To submit to real quantum environments, or to use a specific vendor's simulator, you can submit your Q# file to Azure Quantum. Note that only base-profile-compliant quantum programs can be submitted to Azure Quantum. In the VS Code status bar, if you see an indicator stating "Unrestricted", click on it and switch the QIR profile to Base before proceeding.
Follow the following steps to submit your base-profile-compliant Q# file to Azure Quantum:
- Sign in to an Azure Quantum Workspace.
- From the VS Code Command Palette, run the "Q#: Add an Azure Quantum Workspace" command and follow the instructions provided. (Note: This may prompt several times for permission as it requests access to the Azure subscription and Quantum workspace).
- Select a provider.
-
Ensure you have a Q# file selected and open.
-
Find the "Quantum Workspaces" section
-
Select the provider you want to submit to.
-
Either click the ⏵︎ (Play) button to the right of the provider, or run the "Q#: Submit current Q# program" command from the Command Palette while a provider is selected. (Note: These will only be available if the provider selected supports jobs targeting the QIR Base profile, which not all do currently).
-
Enter a friendly name and the number of shots for the job submission in the input boxes that appear.
-
After a short while, if submitted successfully, the new job should appear in the Jobs list for the workspace. Currently you need to manually refresh using the Refresh icon in the tree view to update this list.
-
If the job completed successfully, you will see an icon to the right of the job in the tree view to download the results. (Currently a histogram in text format).
-