Skip to content

Circuit Diagrams from Q# Code

Mine Starks edited this page Mar 26, 2024 · 9 revisions

The VS Code extension and qsharp Python package both provide the ability to synthesize circuit diagrams from Q# code.

These diagrams capture the quantum operations (gates) that have been applied during the execution of a Q# program.

VS Code

Circuit diagram for a Q# program

You can use the "Circuit" Code Lens to synthesize a circuit diagram for a Q# program.

Circuit diagrams for operations

You can use the "Circuit" Code Lens above an operation declaration to synthesize a circuit for that operation.

Python

See circuits.ipynb for a walkthrough of circuit diagrams in Python. (Note that the GitHub web viewer does not display the circuit images in this notebook. Open the notebook in VS Code or Jupyter to display the circuits).

Troubleshooting

Clone this wiki locally