projekter / yquant

Typesetting quantum circuits in a human-readable language
LaTeX Project Public License v1.3c
56 stars 5 forks source link

Output bracket misaligned #9

Closed tigerjack closed 3 years ago

tigerjack commented 3 years ago

Describe the bug The right curly bracket on the output qubit is not represented correctly.

To Reproduce

\documentclass[tikz]{standalone}          
\usepackage{yquant} % quantum circuits    
\usepackage{braket} % for quantum notation
\begin{document}                          
\begin{tikzpicture}                       
  \begin{yquant}                          
    qubit {$\ket 0$} q[2];                
    qubit {$\ket 1$} q[+3];               
    [red, thick]                          
    barrier (-);               
    % [rotate=90]           
    output {$\ket D^5_3$} (q);        

  \end{yquant}                            
\end{tikzpicture}                         
\end{document}  

Expected output A curly bracket involving all qubits.

Screenshots image

Environment

projekter commented 3 years ago

I don't know which TeXLive revision corresponds to which yquant version, but let me assume that you run the newest version 0.4 (if you don't, please update). In this case, you should see a warning in the log that tells you to specify a compatibility setting. I introduced this setting with version 0.4, as sometimes, there is the need to do some internal changes that will affect the layout of circuits. If you don't specify this setting, yquant runs in a compatibility mode, which means it tries to emulate the behavior of version 0.3. There were quite a number of fixes in 0.4, and you can activate all of them just by saying \usepackage[compat=0.4]{yquant}, in which case everything should look perfectly fine.

Now, this definitely does not look like something that one wants to have even as a compatibility behavior, so I'll have a look into why yquant behaves like this in compatibility mode. But as a quick fix, just specify the most recent compatibility version.

projekter commented 3 years ago

Oh, this was a simple one. Basically the every output key was not applied for multi-output gates in the compatibility mode. The last commit should fix this (actually I forgot something, but together with 97b43c880744987e09f7e90d054aca6126062ab7, it should be fine).

tigerjack commented 3 years ago

Indeed, putting the compat=0.4 solved the issue. Thank you :)