CQuIC / qcircuit

A quantum circuit drawing application
GNU General Public License v2.0
164 stars 42 forks source link

Add \barrier command to draw circuit barriers #33

Closed mtreinish closed 5 years ago

mtreinish commented 5 years ago

This commit adds a new \barrier command that enables support for drawing barriers. It takes a single parameter the number of bits downward to span. (0 means just a barrier for the local bit)

Travis-S commented 5 years ago

@mtreinish Read your comment on Qiskit/qiskit-terra#764. We could do another CTAN release next week, if that works for you all. Or do you only need a Github release?

mtreinish commented 5 years ago

@Travis-S it would need to be a CTAN release, the issue is if we start using it in qiskit and the updated package with the new command isn't available via tlmgr (or however people install latex pacakges) then the qiskit latex functions will fail.

That being said, I've just found a bug in this command. I think I need to add a second parameter for the horizontal offset. The current fixed offset is assuming constant sized boxes for gates, but there are larger boxes in the circuits (like measurements) and the barrier clips those. I'll push a patch up adding that in a bit.

Travis-S commented 5 years ago

@mtreinish Thanks for the information. I don't want to hold you all up in your own releases of qiskit, so once this is figured out, I'll do a CTAN release.

After you've addressed the bug you noted, would you mind including an example in Qtutorial.tex?

mtreinish commented 5 years ago

ok, pushed a fix and added documentation in #34