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

Create command for dual of measureD objects #24

Open
Travis-S opened this issue Sep 9, 2016 · 0 comments
Open

Create command for dual of measureD objects #24

Travis-S opened this issue Sep 9, 2016 · 0 comments

Comments

@Travis-S
Copy link
Member

Travis-S commented Sep 9, 2016

Recently, I received an email in which the author asked whether there was support for providing the dual object for the \measureD command. This object would be for state preparation.

It turns out that there is some use for such a command, particularly within what appear to be tensor-network type things; see this paper, Equation 1 for an example.

Upon downloading the source file, I saw the authors of the paper defined two new commands:

% Inserts a reverse-D-shaped preparation gate with user defined text.
\newcommand{\prepareC}[1]{*{\xy*+=+<.5em>{\vphantom{#1\rule{0em}{.1em}}}*\cir{l^r};p\save*!L{#1} 
\restore\save+UC;+UC+<.5em,0em>*!L{\hphantom{#1}}+R **\dir{-} \restore\save+DC;+DC+
<.5em,0em>*!L{\hphantom{#1}}+R **\dir{-} \restore\POS+UC+<.5em,0em>*!L{\hphantom{#1}}+R;+DC+
<.5em,0em>*!L{\hphantom{#1}}+R **\dir{-} \endxy}} 
% Draws a multiple qubit reverse-D-shaped preparation gate starting at the current position
% and spanning #1 additional gates below. #2 gives the label for the gate.
% You must use an argument of the same width as #2 in \pureghost for 
% the wires to connect properly on the lower lines.

\newcommand{\multiprepareC}[2]{*+<1em,.9em>{\hphantom{#2}}\save[0,0].[#1,0];p\save !C
  *{#2},p+RU+<0em,0em>;+LU+<+.8em,0em> **\dir{-}\restore\save +RD;+RU **\dir{-}\restore\save
  +RD;+LD+<.8em,0em> **\dir{-} \restore\save +LD+<0em,.8em>;+LU-<0em,.8em> **\dir{-} \restore \POS
  !UL*!UL{\cir<.9em>{u_r}};!DL*!DL{\cir<.9em>{l_u}}\restore}

These two draw the dual of the \measureD and \multimeasureD commands, respectively.

Are we OK with folding these commands into qcircuit and releasing a new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant