I find myself drawing a lot of quantum circuits these days, and I do them in TikZ because it produces very nice diagrams.
A quantum circuit is a lot like staff (as in music). You go from left to right, and those things that are vertically aligned are coincident. Therefore it makes more sense to write the operations in time order, by entering them a column at a time rather than by row. This enables easy tweaking, whereas by row you need to move up and down a lot to pick out the same positions.
At the moment, I am forced to write them in row order since that's the way matrices in TikZ, and LaTeX in general, work. Here's a sample:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds,matrix}
\newcommand{\ket}[1]{\ensuremath{\left|#1\right\rangle}}
\begin{tikzpicture}[thick,scale=0.75]
\tikzstyle{operator} = [shape=rectangle,draw,fill=white,minimum size=1.7em,inner sep=2]
\tikzstyle{phase} = [draw,fill,shape=circle,minimum size=5pt,inner sep=0pt]
%
\matrix[row sep=2mm, column sep=2mm] {
% First row.
\node (q1) {\ket{\psi}}; &
&
\node[operator] (CR1) {A1}; &
\node[operator] {A2}; &
\node[operator] (CR3) {A3}; &
\node[operator] {A4}; &
\node[operator] (CR5) {A5}; &
&
&
&
\node (end1) {\ket{\phi}};
\\
\node (q2) {\ket{0}}; &
\node[operator] (H1) {B1}; &
\node[phase] (CR2) {}; &
\node[operator] (H2) {B2}; &
\node[phase] (CR4) {}; &
\node[operator] (H2) {B3}; &
\node[phase] (CR6) {}; &
\node[operator] (H2) {B4}; &
\node[operator] (M1) {B5}; &
&
\node (end2) {\ket{0}};
\\
% Second row.
};
% Lines
\draw[thick] (CR1) -- (CR2);
\draw[thick] (CR3) -- (CR4);
\draw[thick] (CR5) -- (CR6);
% Behind
\begin{pgfonlayer}{background}
\draw[thick] (q1) -- (end1);
\draw[thick] (q2) -- (end2);
\end{pgfonlayer}
%
\end{tikzpicture}
\end{document}
As you can see, it's a mess of ampersands to count through, and this is only a simple circuit. The output generated is this:

My question is; is there a way to enter TikZ matrices by column rather than row, or a simple set of macros that'll do the same job?
\\and less&? – Jake Nov 4 '11 at 5:59haligninternally to lay out the contents. As far as I know, TeX doesn't have a natural vertical equivalent. So what you'd have to do is to gather in all the cells and then re-lay them out in the correct fashion. – Andrew Stacey Nov 4 '11 at 8:00