

Q# standalone notebook: Write Q# code directly in your notebook and make use of Azure Quantum-specific magic commands installed with the QDK.You can also use the %%qsharp magic command to write Q# code directly in a notebook cell. Python + Q# notebook: Write your program in Python, importing Q# operations and functions from a separate Q# file.Select Python 3 (ipykernel) for a Python + Q# notebook, and Q# for a Q# standalone notebook. You select the kernel type when you create a new notebook: Installing the QDK extends the Juptyer Notebooks' Python kernel, ipykernel, with the qsharp Python package, and also adds the IQ# kernel, which allows you to create standalone Q# notebooks. Notebooks can also be created directly in the Azure Quantum portal, which has the qsharp Python package preinstalled and offers features such as sample notebooks and preloaded connection information. Jupyter NotebooksĪ Jupyter Notebook is a document that contains both rich text and code and can run in your browser, and can run Q# and Python code in Azure Quantum. While you can use Q# with Python in any IDE to write your Python program and call Q# operations, we recommend using either Jupyter Notebooks or Visual Studio Code (VS Code) for your Q# + Python applications. Set up a Python environment, or configure your existing Python environment, to use the Microsoft QDK and Jupyter Notebooks following the steps in Set up the Quantum Development Kit. qs) files located in the same folder as the Python code itself. The Python host program can also import Q# operations from any Q# (. You can use any Python environment, including Python-based Jupyter Notebooks, to write the Python program and call Q# operations. A Python host program is just a normal Python program.
