page_type | languages | products | description | urlFragment | jupyter | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
Visualizing quantum programs in Q# notebooks. |
visualization |
|
This sample demonstrates:
- Using
%trace
to visualize the execution path of a Q# program. - Using
%debug
to step through the execution of a Q# program.
In this sample, you can use the %trace
and %debug
magic commands provided in Q# notebooks to visualize the execution path of a Q# program and to analyze the state of the quantum registers at each step of the program.
- The Microsoft Quantum Development Kit.
This sample is designed to be run from Jupyter Notebook. To set up your development environment to run Jupyter Notebooks, follow the steps explained in the Q# Quickstart: Jupyter guide.
Once this is set up, from the terminal, you can run the following command:
jupyter notebook
- Visualizing Quantum Programs.ipynb: Main Q# notebook for this sample.