-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add DumpOperation support in Q# #1885
Conversation
Change in memory usage detected by benchmark. Memory Report for 01c28ed
|
* Updated general code so that 0 is recognized in Cartesian form. Also propagated parameter to render 1 explicitly out of inner functions. * Added function write_latex_for_complex_number for rendering a standalone complex number. It differs from write_latex_for_term in handling of special cases such as 0, 1, -1. * Changed get_matrix_latex to call this new function. This reduced a number of special cases, so I removed them from get_latex_for_simple_term. Eventually all these special cases should go away. * Added tests for write_latex_for_complex_number. Also added test for get_matrix_latex to check that rendering hasn't changed in the process. * The following can still be improved in general case: * i could be used directly in a fraction. Example: $\frac{1}{2}i$ could be rendered as $\frac{i}{2}$. * Brackets are not needed for standalone rendering. Example: $-\left(1+i\right)$ could be rendered as $-1-i$ * No need to rationalize the denominator. Example: $\frac{\sqrt{2}}{2}$ could be rendered as $\frac{1}{\sqrt{2}}$ Co-authored-by: Dmitry Vasilevsky <[email protected]>
Change in memory usage detected by benchmark. Memory Report for e56359e
|
Change in memory usage detected by benchmark. Memory Report for 0d67e36
|
Change in memory usage detected by benchmark. Memory Report for 35d0967
|
Change in memory usage detected by benchmark. Memory Report for dce2394
|
Co-authored-by: Stefan J. Wernli <[email protected]>
Change in memory usage detected by benchmark. Memory Report for a6f8ae4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though there is still the feedback from Mine to resolve.
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
Output is: