summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/yquant/yquant-registers.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-12-28 22:48:51 +0000
committerKarl Berry <karl@freefriends.org>2021-12-28 22:48:51 +0000
commit3a8f490ec582c95b7adc117b1f8d3debb60b7f88 (patch)
tree555a386e2cd67bb1f172b2a5d65bbfe983ff60df /Master/texmf-dist/tex/latex/yquant/yquant-registers.tex
parentad334beadbb0679b7608a2d9612050802d5273d1 (diff)
yquant (28dec21)
git-svn-id: svn://tug.org/texlive/trunk@61429 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/yquant/yquant-registers.tex')
-rw-r--r--Master/texmf-dist/tex/latex/yquant/yquant-registers.tex63
1 files changed, 55 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/yquant/yquant-registers.tex b/Master/texmf-dist/tex/latex/yquant/yquant-registers.tex
index 97762cf3dde..41a472821f1 100644
--- a/Master/texmf-dist/tex/latex/yquant/yquant-registers.tex
+++ b/Master/texmf-dist/tex/latex/yquant/yquant-registers.tex
@@ -166,9 +166,56 @@
\else%
\def\idx{0}%
\fi%
- % pre-set y position
- \yquant@for \idx := \idx to \numexpr \len -1\relax {%
- \yquant@prepare@create\reg\idx\yquant@register@type@q%
+ % define text macros
+ \ifnum\len=1 %
+ \let\regidx=\reg%
+ \else%
+ \def\regidx{\reg[\idx]}%
+ \fi%
+ \numdef\yquant@circuit@operator@mintarget{\csname\yquant@prefix registers\endcsname+1}%
+ \begingroup%
+ \yquant@for \idx := \idx to \numexpr \len -1\relax {%
+ \yquant@prepare@create\reg\idx\yquant@register@type@q%
+ }%
+ \endgroup%
+ \ifx\yquant@config@register@default@lazyname\empty%
+ \expandafter\@gobble%
+ \else%
+ \expandafter\@firstofone%
+ \fi%
+ {%
+ \let\yquant@lang@attr@value=\yquant@config@register@default@lazyname%
+ % gather details about the created registers
+ \letcs\yquant@circuit@operator@maxtarget{\yquant@prefix registers}%
+ \numdef\yquant@circuit@operator@numtarget{\yquant@circuit@operator@maxtarget-\yquant@circuit@operator@mintarget+1}%
+ \edef\yquant@circuit@operator@targets{%
+ \yquant@list@range%
+ \yquant@circuit@operator@mintarget%
+ \yquant@circuit@operator@maxtarget%
+ }%
+ \let\yquant@circuit@operator@pctrls=\empty%
+ \def\yquant@circuit@operator@minpctrl{2147483647}%
+ \def\yquant@circuit@operator@maxpctrl{0}%
+ \let\yquant@circuit@operator@numpctrl=\yquant@circuit@operator@maxpctrl%
+ \let\yquant@circuit@operator@nctrls=\empty%
+ \let\yquant@circuit@operator@minnctrl=\yquant@circuit@operator@minpctrl%
+ \let\yquant@circuit@operator@maxnctrl=\yquant@circuit@operator@maxpctrl%
+ \let\yquant@circuit@operator@numnctrl=\yquant@circuit@operator@numpctrl%
+ \let\yquant@circuit@operator@minctrl=\yquant@circuit@operator@mintarget%
+ \let\yquant@circuit@operator@maxctrl=\yquant@circuit@operator@maxtarget%
+ % there are no multi inits in this context
+ \preto\yquant@attrs@remaining{internal/move label,}%
+ \def\yquant@config@operator@minimum@width{0pt}%
+ \unless\ifx\yquant@lang@attr@value\empty%
+ % make sure to immediately remove the "clear" marker again if we have a text
+ \yquant@for \i := \yquant@circuit@operator@mintarget to \yquant@circuit@operator@maxtarget {%
+ \yquant@register@execclear@lastgate{\i}{init}%
+ }%
+ \fi%
+ \expandafter\yquant@prepare%
+ \expandafter{\yquant@lang@attr@value}%
+ {/yquant/every label, /yquant/every initial label,%
+ /yquant/every qubit label}%
}%
\endgroup%
}
@@ -216,8 +263,8 @@
}
\endgroup
-\protected\def\yquant@register@get@ids@@index{}
-\protected\def\yquant@register@get@ids@@multi{}
+\let\yquant@register@get@ids@@index=\yquant@protectedempty
+\let\yquant@register@get@ids@@multi=\yquant@protectedempty
\def\yquant@register@get@ids@outerlist#1{%
\ifyquant@firsttoken\yquant@register@get@ids@@multi{#1}{%
@@ -557,8 +604,8 @@
\yquant@register@get@id#1{\trim@spaces{#2}[\trim@spaces{\trim@spaces#3}]}%
}
-\let\yquant@register@multi=\empty%
-\protected\def\yquant@register@multi@contiguous{}%
+\let\yquant@register@multi=\empty
+\let\yquant@register@multi@contiguous=\yquant@protectedempty
% splits \yquant@register@get@ids@list into a list of contiguous parts
\protected\def\yquant@register@multi@splitparts{%
@@ -738,7 +785,7 @@
}
% This plays a similar role: It must never be expanded before the tikz command is invoked (because it does not exist).
-\protected\def\nodepart{}
+\let\nodepart=\yquant@protectedempty
\def\yquant@register@get@y@unprotected#1{%
\ifcsname\yquant@prefix registermap@#1\endcsname%