-
Notifications
You must be signed in to change notification settings - Fork 117
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
print_matrix
only prints the matix if it's the last output operation in a cell
#145
Comments
Hmm yes, maybe splitting it up into two functions, one that just returns the Label, and the other that also prints it and has this name would be the thing to do here. |
Split off a function `get_matrix_label` which only returns the Jupyter `Label`. (Also: update "AKLT hexagonal lattice.ipynb" so it no longer uses the hack of wrapping `print_matrix` with a call to `display`.) Fixes zxcalc#145.
I've added a |
Yeah I guess we don't really need the `get_matrix_label' function. If you want to change back your PR so that it always just displays, then that is fine. |
(Also: update "AKLT hexagonal lattice.ipynb" so it no longer uses the hack of wrapping print_matrix with a call to display.) Fixes zxcalc#145.
I've removed |
The function
print_matrix
returns aLabel
widget (and says so in the documentation). However, it really only prints the matrix if it's the last function called in a cell which produces any output. In particular, the following behaviour is unintutive based on the function name.This only prints the matrix of
c2
:This draws the circuit of
c
but does not print its matrix (but reversing the order works):Suggestion: either change the name of the function, or change it so it does actually print the matrix when it is run.
The text was updated successfully, but these errors were encountered: