2

I have prepared the following

\begin{equation}
\Qcircuit @C=1em @R=.7em {
& \gate{H} & \ctrl{1} & \gate{H} & \qw \\
& \gate{H} & \targ & \gate{H} & \qw }= \Qcircuit @C=1em @R=.7em {
& \targ & \qw \\
& \ctrl{-1} & \qw
}
\end{equation}

which outputs the correct circuit. However, the equals sign is aligned with the top wire in the circuit. I'd like to align the equals sign in the middle of the circuits to improve the aesthetics. Could someone show how this is implemented?

For clarity I include a picture of the output, so that the current alignment can be visualized enter image description here

Torbjørn T.
  • 206,688
sunspots
  • 223

2 Answers2

4

You can use only one circuit. From the documentation we have

\Qcircuit @C=.5em @R=0em @!R {
& \ctrl{1} & \qw & & & \qw & \ctrl{1} & \qw &
\ctrl{1} & \ctrl{2} & \qw\\
& \ctrl{1} & \qw &
\push{\rule{.3em}{0em}=\rule{.3em}{0em}} & &
\ctrl{1} & \targ & \ctrl{1} & \targ & \qw &
\qw\\
& \gate{U} & \qw & & & \gate{V} & \qw &
\gate{V^\dag} & \qw & \gate{V} & \qw
}

producing

enter image description here

So you can adapt to your case.

Sigur
  • 37,330
4

You can try this:

$$
\Qcircuit @C=1em @R=.7em {
   & \gate{H} & \ctrl{1}  & \gate{H} & \qw  & \raisebox{-2.2em}{=}  & & \targ & \qw \\
   & \gate{H} & \targ  & \gate{H} & \qw & & & \ctrl{-1} & \qw 
}   
$$
egreg
  • 1,121,712
paradox
  • 41
  • 1
    Welcome to TeX.SX! Since you seem to have understood what packages are needed, you can improve your answer by making it into a complete compilable example (the question itself doesn't give many clues about what's necessary). Please, remind that $$ is deprecated in LaTeX, see Why is \[ … \] preferable to $$? – egreg May 15 '16 at 10:07