Overview

Set up the Microsoft Quantum Development Kit

Prerequisites#

  • The latest version of VS Code.
  • If you want to submit jobs to Azure Quantum, you need an Azure account with a quantum workspace. See What is Azure Quantum? for how workspaces fit in.
1
Install the QDK extension

To use the QDK in VS Code, install the QDK extension. You can also use the QDK in VS Code for the Web without installing the extension, though you won't have all the features of VS Code Desktop.

You can now write, debug, and run Q# programs against the built-in quantum simulator. Or, if you have an Azure account, you can connect and submit Q# programs to quantum hardware, all from VS Code.

2
Install the QDK Python package

With Python support in VS Code, you can embed or call Q# code from your Python programs or Jupyter notebooks, and run them on the built-in quantum simulators. You can also connect to your Azure Quantum workspace and submit jobs to run on real quantum hardware.

Prerequisites: a Python environment (3.10 or greater, 3.11 recommended), plus the QDK extension in VS Code.

Install the Python and Jupyter extensions for VS Code, then install the qdk Python package with the azure extra:

python -m pip install "qdk[azure]"

For Qiskit version 1 and version 2 support, install the qiskit extra:

python -m pip install "qdk[qiskit]"

To work in Jupyter Notebook and display visualizations, install:

python -m pip install "qdk[jupyter]" ipykernel ipympl jupyterlab
3
Add support for the Azure CLI

You have the option to use the Azure CLI to submit quantum jobs from a terminal window in VS Code.

  1. Install the Azure CLI.

  2. Open a Windows command prompt or a terminal in VS Code.

  3. Run the following command to update to the latest Azure CLI quantum extension:

    az extension add --upgrade -n quantum

Next step#

With the QDK installed, write your first program: Create your first Q# program.

Updated

Was this page helpful?