diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..22f9706 --- /dev/null +++ b/Makefile @@ -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 diff --git a/Qtutorial.pdf b/Qtutorial.pdf index a12248b..d4777c3 100644 Binary files a/Qtutorial.pdf and b/Qtutorial.pdf differ diff --git a/Qtutorial.tex b/Qtutorial.tex index 454041c..4fbe27d 100644 --- a/Qtutorial.tex +++ b/Qtutorial.tex @@ -278,14 +278,15 @@ \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 { @@ -293,11 +294,15 @@ \subsection{Labelling input and output states \label{S:labels}} \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} @@ -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\} \\ @@ -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} diff --git a/qcircuit.sty b/qcircuit.sty index 914f32e..544ec5c 100644 --- a/qcircuit.sty +++ b/qcircuit.sty @@ -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}}