Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Visualization of classically-controlled operations for %trace #158

@theRoughCode

Description

@theRoughCode

Is your feature request related to a problem? Please describe.
As a developer, I might want to visualize the circuit associated with the execution of a Q# operation at any point in time. This would make debugging easier and even allow tutorials/notebooks to be more visual.

Describe the solution you'd like
The circuit should be displayed (as an SVG/HTML/image) based on a new magic command (i.e. %trace operation_name). This %view command will follow similar semantics for arguments as %simulate with the result instead being the printing/visualization of the circuit.
The circuit displayed should represent the operations invoked starting directly from the EntryPoint up to n levels deep (where n is a configurable attribute via %config trace.defaultDepth={n}).
For certain well-known operations, we will show their custom display, such as:

  • SWAP
  • M
  • Measure
  • Operations under the Microsoft.Quantum.Array namespace
  • CNOT
  • Controlled operations (can be controlled on classical registers)
  • Adjoint operations

Other operations will just show their name as a label (with non-qubit arguments) inside a box. The boxes should increase in width to fit the label.

Additional context
Other examples of quantum circuit visualizers:

Components to implementing this feature

Metadata

Metadata

Assignees

Labels

Area-KernelIssue relates to the IQ# kernel.Kind-EnhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions