# Q-circuit

Q-circuit is a macro package for drawing quantum circuit diagrams in LaTeX. On this page you'll find everything you need to start making quantum circuit diagrams of your own.

## Installation

Q-circuit requires both Xy-pic and the ifpdf package. Some distributions of LaTeX come with these packages and some do not. You can find information regarding Xy-pic at http://www.tug.org/applications/Xy-pic/. Information about the ifpdf package is available at http://www.ctan.org/pkg/ifpdf.

To install Q-circuit simply place the file Qcircuit.tex in the tex/latex subdirectory of your TeX tree and execute the command that updates the tree. I recommend putting it in \$TEXMFLOCAL/tex/latex/Qcircuit if possible.

For my installation of TeX (MiKTeX on Windows XP) this corresponds to placing the file in C:\Program Files\texmf\tex\latex\Qcircuit and executing the command initexmf --update-fndb.

If you're running TeXShop on Mac OS X and your login is Steve (like Steve Flammia), the indicated directory is /users/Steve/Library/texmf/tex/latex/Qcircuit. No update is required.

Linux users will need to locate the appropriate base tex directory, which can be tricky. Try locate texmf. The update command is simply texhash, though depending on the directory that you use it may be necessary to run this as root, e.g. executing sudo texhash in a terminal. For my installation of TeXLive in Ubuntu, I've found it simplest just to place Qcircuit.tex in ~/texmf/tex/latex/Qcircuit (which is /home/beastin/texmf/tex/latex/Qcircuit for me) and to execute texhash from a terminal.

If installing is too much trouble, you can just put Qcircuit.tex in the same directory as the tex file you're compiling. This is also what you need to do for submission to the arXiv.

## Use

To actually use Q-circuit in a document simply place the command \input{Qcircuit} in the preamble.

## Getting started

Q-circuit is distributed with a full fledged tutorial that teaches you how to typeset practically any quantum circuit. While a great deal of material is covered, it is presented in a tiered fashion that makes it easy to learn just enough to get the job done.

Still having problems? Check the FAQ.

## Copyleft

Q-circuit was written by Steve Flammia and Bryan Eastin and is distributed under the GNU General Public License. Basically, this means you are free to use it in any way that doesn't defraud us or limit other people's rights.

Q-circuit is now very well known among those who typeset quantum circuit diagrams, so Steve and I no longer ask that you acknowledge your use of the package. Thanks to everyone who mentioned us in the past!