projekter/yquant

Output bracket misaligned

Closed this issue · 3 comments

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

  • TeX distribution: This is TeX, Version 3.141592653 (TeX Live 2021/Arch Linux) (preloaded format=tex)
  • Compiler (pdf, Lua, ...): pdflatex
  • Version of all formats and packages: yquant Revision: 58712

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.

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 97b43c8, it should be fine).

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