You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
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:
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%viewcommand will follow similar semantics for arguments as%simulatewith the result instead being the printing/visualization of the circuit.The circuit displayed should represent the operations invoked starting directly from the
EntryPointup tonlevels deep (wherenis a configurable attribute via%config trace.defaultDepth={n}).For certain well-known operations, we will show their custom display, such as:
Microsoft.Quantum.ArraynamespaceOther 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
ExecutionPathTracerto repo. #195)