diff --git a/Qtutorial.tex b/Qtutorial.tex index 8920fb0..d2e027e 100644 --- a/Qtutorial.tex +++ b/Qtutorial.tex @@ -483,6 +483,23 @@ \subsection{Non-gate inserts, forcing space, and swap \label{S:inserts}} & \qw & \qw & \qw & \ctrl{-4} & \qw \\ }\end{verbatim}} +To do the same without wires, you could use the \verb=\ncds= command. +\[\Qcircuit @C=1em @R=.7em { + & \targ & \targ & \qw & \ncds{4}{\cdots} + && \targ & \qw\\ + & \ctrl{-1} & \qw & \qw & && \qw & \qw \\ + & \qw & \ctrl{-2} & \qw & && \qw & \qw \\ + & & & && & \\ + & \qw & \qw & \qw & && \ctrl{-4} & \qw \\ +}\] +{\small \begin{verbatim}\Qcircuit @C=1em @R=.3em { + & \targ & \targ & \qw & \ncds{4}{\cdots} + && \targ & \qw\\ + & \ctrl{-1} & \qw & \qw & && \qw & \qw \\ + & \qw & \ctrl{-2} & \qw & && \qw & \qw \\ + & & & && & \\ + & \qw & \qw & \qw & && \ctrl{-4} & \qw \\ +}\end{verbatim}} \subsection{Barriers} @@ -753,7 +770,8 @@ \section{Table of Commands} @!C \\ @! \\ \char92 push\{\#1\} \\ - \char92 cds\{\#1\}\{\#2\}}\\ + \char92 cds\{\#1\}\{\#2\} \\ + \char92 ncds\{\#1\}\{\#2\}}\\ Wires & \parbox[t]{6cm}{\tt \char92 qw[\#1] \\ \char92 qwx[\#1] \\ diff --git a/qcircuit.sty b/qcircuit.sty index 1b93638..4ff1508 100644 --- a/qcircuit.sty +++ b/qcircuit.sty @@ -76,6 +76,8 @@ \newcommand{\cds}[2]{*+<1em,.9em>{\hphantom{#2}} \POS [0,0].[#1,0]="e",!C *{#2};"e"+ R \qw} % Allows the insertion of text without a box and exands circuit around this text. % This is useful for such things as ... to indicate a generalized circuit. +\newcommand{\ncds}[2]{{\hphantom{#2}} \POS [0,0].[#1,0]="e",!C *{#2};"e"+ R} + % As \cds without incoming wire and extra space. \newcommand{\barrier}[2][-0.95em]{\ar @{--}[#2,1]+<#1, -1em>;[0,1]+<#1, 1em>} % Defines a barrier that is represented by a horizontal dashed line. % It takes a a single argument to specify how many bits to cover