diff options
Diffstat (limited to 'graphics/pgf')
-rw-r--r-- | graphics/pgf/contrib/yquant/doc/yquant-doc.pdf | bin | 1015316 -> 1017482 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/yquant/doc/yquant-doc.tex | 14 | ||||
-rw-r--r-- | graphics/pgf/contrib/yquant/tex/yquant-config.tex | 10 | ||||
-rw-r--r-- | graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex | 45 | ||||
-rw-r--r-- | graphics/pgf/contrib/yquant/tex/yquant-shapes.tex | 12 | ||||
-rw-r--r-- | graphics/pgf/contrib/yquant/tex/yquant.sty | 4 |
6 files changed, 52 insertions, 33 deletions
diff --git a/graphics/pgf/contrib/yquant/doc/yquant-doc.pdf b/graphics/pgf/contrib/yquant/doc/yquant-doc.pdf Binary files differindex 20229feff7..53c70133e7 100644 --- a/graphics/pgf/contrib/yquant/doc/yquant-doc.pdf +++ b/graphics/pgf/contrib/yquant/doc/yquant-doc.pdf diff --git a/graphics/pgf/contrib/yquant/doc/yquant-doc.tex b/graphics/pgf/contrib/yquant/doc/yquant-doc.tex index 3af9c17196..17b105cb92 100644 --- a/graphics/pgf/contrib/yquant/doc/yquant-doc.tex +++ b/graphics/pgf/contrib/yquant/doc/yquant-doc.tex @@ -219,7 +219,7 @@ This document outlines the scope and usage of the \Yquant{} package. It contains both a reference and a huge number of examples. \Yquant{} is a package that makes typesetting quantum circuits easy; the package is available on CTAN. - This beta version~0.7 \emph{should} be stable and interfaces are not very likely to change in an incompatible way in the future. + This beta version~0.7.1 \emph{should} be stable and interfaces are not very likely to change in an incompatible way in the future. \compat{New in 0.4}Sometimes, backwards\hyp incompatible changes are required or advisable, in which case a compatibility setting will allow to revert back to the old behavior (rather, to maximize compatibility, this is an opt\hyp in setting: unless you choose the new behavior, you will get the old one). Please do report all issues and desirable additions on \href{https://github.com/projekter/yquant/issues}{GitHub}. @@ -904,10 +904,14 @@ IndexSingle = ?number? | ( [ ?number? ], "-", [ ?number? ] ); This is a shorthand that modifies the appearance of both the current operator and any controls or control lines. \end{option} - \begin{option}[New in 0.1.2]{operator/multi as single}!/yquant/every multi line/.style=/yquant/every control line! + \begin{option}[Changed in 0.7.1\\New in 0.1.2]{operator/multi as single}!/yquant/every multi line/.style=/yquant/every control line! This style is automatically set for certain gates such as the \gate{swap} or the \gate{zz} gate. For those gates, neighboring registers will be treated as discontiguous; and this style will enforce their connecting line to have the style used by control lines. + \compat{New in 0.7.1}This style actually checks whether control lines are present in the gate and in this case, it is equal to \tex!draw=none!, i.e., it suppresses the multi\hyp register line. + This is due to the fact that this line would be drawn on top of (a segment of) the control line with an identical style, so that it cannot be seen unless there were some bug in the renderer. + Note that the check for control lines is embedded into the style (the default value shown here is a simplification); so if you change it, you will overwrite the style for \emph{all} cases, not only when there is no control line. + The default \style{/yquant/every multi line} is a wavy line; this allows to distinguish discontiguous multi\hyp qubit gates from multiple single\hyp qubit gates when using controls. Still, some gates have such an established appearance that---despite being logically misleading---we rather use the same style as for a control line. \end{option} @@ -5302,7 +5306,7 @@ $=$ This new behavior is compatibility\hyp protected. \\ Bugfix: \gate{output}s can now be named. \\ Bugfix: Border angles of \texttt{yquant-ellipse} now work properly. \\ - New configuration: \style{/yquant/register/default lazy name} \\ + New configuration: \style{/yquant/register/default lazy name}. \\ Documentation: Replace the wishlist by a section on integration with other packages. \\ Documentation: Include the examples of \pkg{qpic} in this manual. @@ -5313,5 +5317,9 @@ $=$ Fix \href{https://github.com/projekter/yquant/issues/18}{\#18}: Subcircuit boxes don't render in \texttt{groups} environment. Now, styles can properly modify the \style{/yquant/operators/this subcircuit box} style without affecting the content of the subcircuit, only the box. \\ New: Support for a simplified drawing pipeline without clipping paths. + + \subsection*{2022-05-07: Version 0.7.1} + Fix issues with using handlers for attributes. \\ + Fix \href{https://github.com/projekter/yquant/issues/21}{\#21}: CSWAP scaling problems. Now the clipping of the \gate{swap} and \gate{slash} gate scale appropriately when scaling canvas transformations are in effect (no guarantee with rotations!). Multi-register lines in the same style as control lines (\style{/yquant/operator/multi as single}) will be automatically hidden if control lines are present---they would be drawn on top of each other in the exact same style. %END_FOLD \end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/yquant/tex/yquant-config.tex b/graphics/pgf/contrib/yquant/tex/yquant-config.tex index ab07830929..6da9a4be66 100644 --- a/graphics/pgf/contrib/yquant/tex/yquant-config.tex +++ b/graphics/pgf/contrib/yquant/tex/yquant-config.tex @@ -234,8 +234,14 @@ {/yquant/this operator/.append style={#1},% /yquant/every control line/.append style={#1},% /yquant/this control/.append style={#1}},% - operator/multi as single/.style=% - {/yquant/every multi line/.style=/yquant/every control line},% + operator/multi as single/.code=% + {\ifnum\yquant@draw@@currentcontroltype=0 % + \pgfkeysalso{/yquant/every multi line/.style=/yquant/every control line}% + \else% + % #21: we don't need to double-draw the line in the same style as a control line if controls are present - then, the control line will already encompass all the registers + \pgfkeysalso{/yquant/every multi line/.style={draw=none}}% + \fi% + },% operator/if multi/.code=% {\ifyquant@config@operator@multi\pgfkeysalso{#1}\fi},% circuit/seamless/.is if=yquant@config@circuit@seamless,% diff --git a/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex b/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex index 56b671fb85..c8b96250dd 100644 --- a/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex +++ b/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex @@ -52,40 +52,33 @@ % we need to capture every non-attribute (which means filtering them out). \expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/attrs/}{% % the key is in /yquant/attrs. Does it actually exist (but not as a handler, which would define non-existing keys)? - \if\pgfkeyscasenumber1% - \pgfkeysfiltercontinuetrue% - \else% - \if\pgfkeyscasenumber2% + \ifnum\pgfkeyscasenumber=3 % handler + % handlers are tricky. The existence does not rely on the question whether the key itself exists, but the handler. This is not what we want for attributes. We strip the handler (the handler is in \pgfkeyscurrentname, while the original key is fully contained in \pgfkeyscurrentpath) and check whether it existed (think of handlers such as .expanded, which for sure should be valid, while we don't want to define new arguments). + \pgfkeysifassignable{\pgfkeyscurrentkey}{% + % case 1 and 2 \pgfkeysfiltercontinuetrue% - \else% - % 0 or 3 for our case means non-existing - now we need to check whether we can find it in the global attributes. - \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}{% + }{% + % don't have to worry about option 3, so this is 0. But maybe this was actually a global attribute? Again, we have to discard our handler. Note that this change to the current-macros will affect further processing! + \edef\pgfkeyscurrentkey{/yquant/global attrs/\pgfkeyscurrentkeyRAW}% + \pgfkeyssplitpath% + \pgfkeysifassignable{\pgfkeyscurrentpath}{% \pgfkeysfiltercontinuetrue% }{% - % it is not, so it is not a known attribute for this operator. Filter. \pgfkeysfiltercontinuefalse% }% - \fi% - \fi% - }{% - % the key is not in /yquant/attrs. Is it a global attribute (usually, the user should not access this explicitly, but let's be tolerant here)? - \expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/global attrs/}{% - % the key is in /yquant/global attrs. Does it actually exist? - \if\pgfkeyscasenumber1% - \pgfkeysfiltercontinuetrue% - \else% - \if\pgfkeyscasenumber2% + }% + \else% + \ifnum\pgfkeyscasenumber=0 % unknown + % non-existing - now we need to check whether we can find it in the global attributes. + \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}% \pgfkeysfiltercontinuetrue% - \else% - % no - that's it. + % it is not, so it is not a known attribute for this operator. Filter. \pgfkeysfiltercontinuefalse% - \fi% + \else% command key or contains value + \pgfkeysfiltercontinuetrue% \fi% - }{% - % the key is no known attribute - \pgfkeysfiltercontinuefalse% - }% - }% + \fi% + }\relax% },% /yquant/attr filter/.style={% /pgf/key filters/attr filter/.install key filter,% diff --git a/graphics/pgf/contrib/yquant/tex/yquant-shapes.tex b/graphics/pgf/contrib/yquant/tex/yquant-shapes.tex index 0ebfca317b..e4cc01e63f 100644 --- a/graphics/pgf/contrib/yquant/tex/yquant-shapes.tex +++ b/graphics/pgf/contrib/yquant/tex/yquant-shapes.tex @@ -244,6 +244,10 @@ \csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}% {{\the\dimen2}{\the\dimen4}}% \fi% + % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings... + \pgftransformationadjustments% + \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax% + \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax% \pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}% {-\dimexpr\yradius-\dimen2\relax}}% \pgfpathlineto{\pgfqpoint{\dimexpr\xradius-\dimen4\relax}% @@ -290,6 +294,10 @@ \csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}% {{\the\dimen2}{\the\dimen4}}% \fi% + % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings... + \pgftransformationadjustments% + \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax% + \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax% \dimen6=\dimexpr\dimen2*\dimexpr\xradius\relax/\dimexpr\yradius\relax+% \dimen2*\dimexpr\yradius\relax/\dimexpr\xradius\relax\relax% \pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}% @@ -334,6 +342,10 @@ \csxdef{yquant@math@cache1@\xradius @\yradius @\the\pgflinewidth}% {{\the\dimen2}{\the\dimen4}}% \fi% + % now we must be careful (#21) - we emulate the line by rectangles, but rectangles are sensitive to the current scaling, while lines are not. So we must undo the scaling, which may be different for x and y direction. Let's hope there is no rotation, we'd get a mix of different scalings... + \pgftransformationadjustments% + \dimen2=\dimexpr\pgfhorizontaltransformationadjustment\dimen2\relax% + \dimen4=\dimexpr\pgfverticaltransformationadjustment\dimen4\relax% \dimen6=\dimexpr\dimen4*\dimexpr\xradius\relax/\dimexpr\yradius\relax+% \dimen4*\dimexpr\yradius\relax/\dimexpr\xradius\relax\relax% \pgfpathmoveto{\pgfqpoint{-\dimexpr\xradius+\dimen4\relax}% diff --git a/graphics/pgf/contrib/yquant/tex/yquant.sty b/graphics/pgf/contrib/yquant/tex/yquant.sty index 1b44a60c79..2acb5d33b5 100644 --- a/graphics/pgf/contrib/yquant/tex/yquant.sty +++ b/graphics/pgf/contrib/yquant/tex/yquant.sty @@ -1,7 +1,7 @@ % yquant.sty % Typesetting quantum circuits using a flow-oriented language % -% Copyright 2019-2021 Benjamin Desef +% Copyright 2019-2022 Benjamin Desef % % This work may be distributed and/or modified under the conditions of the LaTeX Project % Public License, either version 1.3c of this license or (at your option) any later @@ -15,7 +15,7 @@ % % The Current Maintainer of this work is Benjamin Desef. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{yquant}[2022/02/05 v0.7 Yet another quantum circuit library for LaTeX] +\ProvidesPackage{yquant}[2022/05/07 v0.7.1 Yet another quantum circuit library for LaTeX] \RequirePackage{etoolbox}[2018/02/11] \RequirePackage{tikz}[2015/08/29] |