I want to insert vertical dashed lines between parts of the following circuit to make some comments:
\documentclass{amsart}
\usepackage[matrix,frame,arrow]{xy}
\input{Qcircuit}
\vfuzz2pt % Don't report over-full v-boxes if over-edge is small
\begin{document}
\[
\Qcircuit @C=1em @R=1em {
\lstick{\ket{x}} & \qw & \ctrl{1} & \qw & \rstick{\ket{x}} \qw \\
\lstick{\ket{y}} & \gate{H} & \gate{\pi} & \gate{H} & \rstick{\ket{y \oplus x}} \qw
}
\]
\end{document}
Output:
I have found a similar question (xypic: How to typeset the dashed line in this diagram? ) concerning xy-pic, it is the same idea, it should be the same solution. But it's not working, I don't know why.
Note: Q-circuit is a Qcircuit.tex macro package for drawing quantum circuit diagrams in LaTeX

\documentclass{...}and ending with\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Aug 07 '13 at 07:10[H]?. The answers to your linked Q will work if you remove the\input{Qcircuit}macro which is specifically defined for\Qcircuit. Those answers need only pure xy-pic\usepackage[all]{xy}– texenthusiast Aug 07 '13 at 07:33