% 
% File:   test3.qasm
% Date:   22-Mar-04
% Author: I. Chuang <ichuang@mit.edu>
%
% Sample qasm input file - swap circuit
%
%         qubit 	q0
%         qubit 	q1
% 
% 	cnot	q0,q1
% 	cnot	q1,q0
% 	cnot	q0,q1

%  Time 01:
%    Gate 00 cnot(q0,q1)
%  Time 02:
%    Gate 01 cnot(q1,q0)
%  Time 03:
%    Gate 02 cnot(q0,q1)

% Qubit circuit matrix:
%
% q0: gAA, gBA, gCA, n  
% q1: gAB, gBB, gCB, n  

\documentclass[11pt]{article}
\input{xyqcirc.tex}

% definitions for the circuit elements

\def\gAA{\b\w\A{gAA}}
\def\gAB{\o\w\A{gAB}}
\def\gBB{\b\w\A{gBB}}
\def\gBA{\o\w\A{gBA}}
\def\gCA{\b\w\A{gCA}}
\def\gCB{\o\w\A{gCB}}

% definitions for bit labels and initial states

\def\bA{ \q{q_{0}}}
\def\bB{ \q{q_{1}}}

% The quantum circuit as an xymatrix

\xymatrix@R=5pt@C=10pt{
    \bA & \gAA &\gBA &\gCA &\n  
\\  \bB & \gAB &\gBB &\gCB &\n  
%
% Vertical lines and other post-xymatrix latex
%
\ar@{-}"gAB";"gAA"
\ar@{-}"gBA";"gBB"
\ar@{-}"gCB";"gCA"
}

\end{document}
