# Insert qcircuit inside xymatrix environment

I need to combine some quantum circuit as a node between arrows. Does everybody know how to put a quantum circuit as a point inside xymatrix?

Here is an example of the code

$\xymatrix@C+=3cm{ A \ar @{~)} @<3ex> [r] & B \Qcircuit @C=1em @R=.7em { & \multimeasureD{1}{\text{Bell}} &\\ & \ghost{\text{Bell}} \ar @2 @<-1ex> @[l] }$


I'm expecting to get something like this

but it turns out not working.

• Welcome to TeX.SE! Please take a moment to take our Tour! You may also want to look at what makes a good Minimal Working Example (MWE) – Tavrock Jan 31 '17 at 17:03

I don't think you can nest \Qcircuit in \xymatrix. You can use a box, though.

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip]{xy}
\usepackage{qcircuit}

\newsavebox{\cicabox}

\begin{document}

$\sbox\cicabox{% \Qcircuit @C=1em @R=.7em { & \multimeasureD{1}{\text{Bell}} &\\ & \ghost{\text{Bell}} }% } \xymatrix@C+=3cm@R=0pt{ A \ar@{~)}@<1ex>[r] & B \ar@{=>}@<1ex>[l] \\ &\rlap{\hspace{-1em}\usebox{\cicabox}} }$

\end{document}


• Excellent! just what I need! :) Thanks a lot! – Cica Gustiani Jan 31 '17 at 9:57