Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add \ncds to do the same as \cds without wire. #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
20 changes: 19 additions & 1 deletion Qtutorial.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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] \\
Expand Down
2 changes: 2 additions & 0 deletions qcircuit.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down