# How to draw quantum circuits?

We need an easy way to draw quantum circuits as these are fundamental to programming a quantum computer. Ideally, there was some library (like mathjax for LaTeX-like math) that translates a text representation into a decent quantum circuit.

Also, it would be convenient if some LaTeX-like commands (like \ket{0} to produce $\left| 0 \right>$) could be enabled.

A trivial example of a quantum circuit (a true random number generator), to illustrate the need:

|0> -----H----(measure)

• Maybe we could request the devs to add a LaTeX package to draw quantum circuits, like this one or maybe Quirk (which is apparently easier to use) – Sanchayan Dutta Mar 29 '18 at 17:56
• @Blue I think an inline specialized drawing tool would be better, similar to the one on User Experience, as more LaTeX packages make the pages render slower. Simple images don't. Alternatively, use another program to draw circuits (I think Inkscape, Ipe or Visio would be decent) – Discrete lizard Mar 29 '18 at 18:54
• As for the LaTeX commands and the one requested in particular, see quantumcomputing.meta.stackexchange.com/a/50 . – Discrete lizard Mar 29 '18 at 18:56
• @Blue - Quirk looks interesting but at the bottom of the page the author mentions alternatives, of which LIQ𝑈𝑖⏐〉 looks to be most useful and best supported: stationq.github.io/Liquid - with that the examples/question/answer will actually be runnable on simulators or hardware. – Rob Mar 31 '18 at 13:43
• There's also the suggestion to use Qcircuit, offered over in Nat's MathJax Q&A: quantumcomputing.meta.stackexchange.com/a/152/278 – Rob Apr 1 '18 at 14:24