Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
qcircuit.zip: qcircuit/qcircuit.pdf qcircuit/qcircuit.sty qcircuit/README.md
zip qcircuit.zip qcircuit/qcircuit.pdf qcircuit/qcircuit.sty qcircuit/README.md

qcircuit/qcircuit.pdf: Qtutorial.pdf
mkdir -p qcircuit
cp Qtutorial.pdf qcircuit/qcircuit.pdf

qcircuit/qcircuit.sty: qcircuit.sty
mkdir -p qcircuit
cp qcircuit.sty qcircuit/qcircuit.sty

qcircuit/README.md: README.md
mkdir -p qcircuit
cp README.md qcircuit/README.md

Qtutorial.pdf: Qtutorial.tex
pdflatex Qtutorial
Binary file modified Qtutorial.pdf
Binary file not shown.
15 changes: 11 additions & 4 deletions Qtutorial.tex
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,31 @@ \subsection{Labelling input and output states \label{S:labels}}

There are a few options for labelling multi-qubit input states, as well.


\[ \Qcircuit @C=1em @R=1.6em {
\lstick{} & \qw & \qw \\
\lstick{} & \qw & \qw \inputgroup{1}{2}{.75em}{\ket{0^k}}\\
\lstick{} & \qw & \qw \\
\lstick{} & \qw & \qw \inputgroupv{3}{4}{.8em}{.8em}{\ket{\psi}}\\
\lstick{A} & \qw & \qw \\
\lstick{B} & \qw & \qw \inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em}
\lstick{B} & \qw & \qw \inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em}\\
\lstick{A} & \qw & \qw \\
\lstick{B} & \qw & \qw \inputgroupvv{7}{8}{3.75em}{1em}{3.1em}{0.9em}{\ket{\psi}}
}\]
typeset with
{\small \begin{verbatim}\Qcircuit @C=1em @R=1.6em {
\lstick{} & \qw & \qw \\
\lstick{} & \qw & \qw
\inputgroup{1}{2}{.75em}{\ket{0^k}}\\
\lstick{} & \qw & \qw \\
\lstick{} & \qw & \qw
\lstick{} & \qw & \qw
\inputgroupv{3}{4}{.8em}{.8em}{\ket{\psi}}\\
\lstick{A} & \qw & \qw \\
\lstick{B} & \qw & \qw
\inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em}
\inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em}\\
\lstick{A} & \qw & \qw \\
\lstick{B} & \qw & \qw
\inputgroupvv{7}{8}{3.75em}{1em}{3.1em}{0.9em}
{\ket{\psi}}
}\end{verbatim}}

\section{More Complicated Circuits: Multiple Qubit Gates and Beyond}
Expand Down Expand Up @@ -778,6 +783,7 @@ \section{Table of Commands}
\char92 targ \\
\char92 qswap \\
\char92 multigate\{\#1\}\{\#2\} \\
\char92 cgate\{\#1\}\\
\char92 sgate\{\#1\}\{\#2\}\\
\char92 ghost\{\#1\} \\
\char92 cghost\{\#1\} \\
Expand Down Expand Up @@ -808,6 +814,7 @@ \section{Table of Commands}
\char92 gategroup\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\{\#6\}\\
\char92 inputgroup\{\#1\}\{\#2\}\{\#3\}\{\#4\}\\
\char92 inputgroupv\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\\
\char92 inputgroupvv\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\{\#6\}\{\#7\}\\
\char92 inputgrouph\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\\
}
\end{tabular}
Expand Down
2 changes: 2 additions & 0 deletions qcircuit.sty
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@
% BUG: \gategroup uses the four corner gates to determine the size of the bounding box. Other gates may stick out of that box. See \prop.
\newcommand{\inputgroupv}[5]{\POS"#1,1"."#2,1"."#1,1"."#2,1"!C*+<#3>\frm{\{}, \POS"#1,1"."#2,1"."#1,1"."#2,1"*!C!<1.7em,#4>=<0em>{#5}}
% Constructs an input group with label #5 and a grouping { from rows #1 to #2 with #3 and #4 controlling the spacing
\newcommand{\inputgroupvv}[7]{\POS"#1,1"."#2,1"."#1,1"."#2,1"!C*+<#3,#4>\frm{\{}, \POS"#1,1"."#2,1"."#1,1"."#2,1"*!C!<#5,#6>=<0em>{#7}}
% Constructs an input group with label #7 and a grouping { from rows #1 to #2, with #3 and #4 controlling the position and height of the curly brace, and #5 and #6 controlling the position of the label
\newcommand{\inputgroup}[4]{\POS"#1,1"."#2,1"."#1,1"."#2,1", \POS"#1,1"."#2,1"."#1,1"."#2,1"*!C!<1em,#3>=<0em>{#4}}
% Constructs an input group with label #4 from rows #1 to #2 with #3 controlling the spacing
\newcommand{\inputgrouph}[5]{\POS"#1,1"."#2,1"."#1,1"."#2,1", \POS"#1,1"."#2,1"."#1,1"."#2,1"*!C!<#5,#3>=<0em>{#4}}
Expand Down