-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DumpOperation support in Q# (#1885)
This enables Q# code to call 'DumpOperation' which will output to console/debugger as text, or Jupyter notebooks as a LaTeX matrix. e.g. from a notebook cell ``` %%qsharp open Microsoft.Quantum.Diagnostics; operation Foo(qs: Qubit[]) : Unit { H(qs[0]); CX(qs[0], qs[1]); } operation Main() : Unit { use qs = Qubit[2]; Foo(qs); DumpMachine(); Message("About to dump operation Foo"); DumpOperation(2, Foo); ResetAll(qs); } Main() ``` Output is: <img width="783" alt="image" src="https://github.com/user-attachments/assets/48e94c91-d291-4a4f-9d88-ae374472641b"> --------- Co-authored-by: Stefan J. Wernli <swernli@microsoft.com> Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com> Co-authored-by: DmitryVasilevsky <60718360+DmitryVasilevsky@users.noreply.github.com>
- Loading branch information
1 parent
f3071dc
commit c8c1338
Showing
26 changed files
with
836 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.