In this article, you learn how to install the Azure Quantum Development Kit (QDK) extension for Visual Studio Code and add support for Python, Jupyter Notebooks, and the Azure CLI.
If you want to submit jobs to Azure Quantum, you also need an Azure account with a quantum workspace. For more information, see Create an Azure Quantum workspace.
Install the QDK extension
To use the QDK in Visual Studio Code, install the QDK extension. You can also use the QDK in VS Code for the Web without installing the extension, but you won't have all the features of VS Code Desktop. For more information, see Different ways to run Q# programs.
Note
If you used previous versions of the QDK, run python -m pip uninstall qsharp qsharp-core qsharp-chemistry azure-quantum to avoid package version conflicts.
You can now write, debug, and run Q# programs against the built-in quantum simulator or, if you have an Azure account, connect and submit Q# programs to quantum hardware, all from VS Code.
With Python support in Visual Studio Code, you can embed or call Q# code from your Python programs or Jupyter Notebooks and run them on the built-in quantum simulator, or connect to your Azure workspace and submit your jobs to quantum hardware.
Prerequisites
A Python environment (3.9 or greater, 3.11 recommended) with Python and Pip installed.
VS Code with the QDK extension installed.
Install the required packages
To add Python and Jupyter Notebook support:
Install the Python and Jupyter extensions for VS Code.
Open the command line.
Install the qsharp and azure-quantum packages:
python -m pip install qsharp azure-quantum
For Qiskit or Cirq support, install azure-quantum using the [qiskit] or [cirq] parameters:
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.