Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circuit visualization #1085

Open
minestarks opened this issue Jan 29, 2024 · 1 comment
Open

Circuit visualization #1085

minestarks opened this issue Jan 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@minestarks
Copy link
Member

We'd like to add the ability to generate circuit diagrams from a Q# program.

These can appear in:

  • VS Code
  • Python notebooks
  • Python command line (ascii art)

Small programs without classical constructs (e.g. the Bell State sample) are fairly easy to generate diagrams for, but we'll have to figure how best to visualize more complex cases.

Design considerations:

  • How to represent classical constructs, such as loops, visually
  • Whether the circuit should map to the hardware behavior (i.e. closer to the generated QIR, showing auxiliary qubits, unrolled loops etc), or to the high level input Q# program
  • UI to visually map parts of the circuit to source code

For reference, Q# notebooks in the classic QDK had the ability to generate diagrams using the %trace magic and the quantum_viz Python package.

@minestarks minestarks added enhancement New feature or request needs triage labels Jan 29, 2024
@sezna sezna removed the needs triage label Mar 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 21, 2024
Circuit generation for Q# programs and operations.

This PR covers the native code bits - the implementation of the circuit
generation itself.

I decided to make the UX parts (VS Code and Python) into a separate PR,
since the feature is large enough as is.

Implements part of #1085

---------

Co-authored-by: orpuente-MS <156957451+orpuente-MS@users.noreply.github.com>
@minestarks
Copy link
Member Author

minestarks commented May 16, 2024

More bells and whistles after v1:

  • Allow specifying qubit register width for operation circuits (instead of hardcoded 2)
  • State annotations on the circuit
  • Q# variable names for qubit wire labels instead of q0, q1, etc.
  • When running with simulator, annotate measurement results on circuit
  • Run multiple shots for dynamic circuits and display multiple outcomes in some way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants