-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
latex-source (and latex) circuit drawer support for standalone (and cleaner output) #6483
Conversation
nice hack! (I just took the freedom of blacking and removing the commented lines, have a look and feel free to revert) |
Nicely done @JoshDumo . I just have one small observation. When the qc = QuantumCircuit(2)
qc.h([0])
qc.cx(0,1)
qc.draw('latex', initial_state=True) gives an output like Could you please check on that? |
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.
Hi @JoshDumo . The output looks good now. I just had a few pointers.
Thanks @JoshDumo . The fix looks great! Nice find on the scaling. Blacking should help pass the tests. |
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.
Thanks!
…conditioning (#6248) * Cbit conditional * lint fixed * q * added_tests * Added tests * lint fix * lint-fix * added extra test * latex drawer for single bit cond * fixed small errors * Minor fix * Added extra test * Added reno and a small lint fix * Fixed reno * lint fix * References refactored for #6483 * Suggested changes * Corrected failing test
Summary
fixes #6447 and some of CQuIC/qcircuit#41
Details and comments
circuit.draw("latex_source") was not using standalone, so the output was a full page. Also had some several optional lines cluttering the tex code output.
Modified latex.py to make the latex drawer use standalone. Removed any extra output lines of tex code.
To deal with cropping, hacked the output by adding nghost{} with the name of the qubit to give extra tabbing before the labels. Also added a new line at the top and the bottom of the Qcircuit.
Generated new Test tex files according to the new tex code output program.