qcircuit is how you insert quantum circuits in \(\LaTeX\).

Naturally, I use org-mode for notes (org-brain to be specific), and I wanted to insert qcircuit fragments inside org-mode.

Turns out, it is fairly simple. You will need to add the following in your org file:

#+LATEX_HEADER \usepackage{qcircuit}

Having this, you can simply embed your LaTeX fragments so:

* Hadamard gate:
  #+BEGIN_EXPORT latex
  \[ \Qcircuit @C=1em @R=.7em {
      & \gate{X} & \qw
    }
  \]
  #+END_EXPORT

Refer to LaTeX Export org-mode docs to look at more options.

It is very nice that the setup Just Worked with org-mode, I had set aside 2 hours for it and ended up winding up in 20min.