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

scaling does not work with boxes #29

Closed
fgfuchs opened this issue Nov 26, 2023 · 3 comments
Closed

scaling does not work with boxes #29

fgfuchs opened this issue Nov 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fgfuchs
Copy link

fgfuchs commented Nov 26, 2023

Describe the bug
scaling does not work when boxes are included. they are moved outside the circuit, also it would be nice if text would not be scaled as well...

To Reproduce
code for reproduction:

\begin{tikzpicture}[scale=1.5]
  \begin{yquant}
    qubits {} a;
    nobit syndrome;

    [this subcircuit box style={dashed, color=blue, "Syndrome Measurement"}]
    subcircuit {
       qubits {} a;
       [out]
       qubits {$\ket0^{\otimes n}$} syndrome;
       box {$P$} a | syndrome;
       measure {} syndrome;
    } (a, syndrome);

    ["Recovery"]
    box {R} (a) | syndrome;
    discard syndrome;
  \end{yquant}
\end{tikzpicture}

Expected output
boxes are where they should be

Screenshots
scale1
scale1 5

Environment
whatever overleaf has

projekter added a commit that referenced this issue Nov 26, 2023
Related to #29
@projekter
Copy link
Owner

I don't know which version of yquant overleaf is running, but it is not the most current. I already made some improvements to scaled handling quite some time ago, however, thanks to this report, I also found some bugs in there, so that when I tried to run your example, it does not even compile. These are fixed with the previous commit.
However, the placement of the box is only slightly better, but still not correct. I'll have to see what else is missing.
Regarding the scaling of the text, this is because yquant defines /yquant/every circuit by default to be every node/.prefix style={transform shape}. You can simply disable this altogether or selectively, then nodes (text) will no longer be scaled/rotated/whatever transformations you have in effect. However, I don't think this is what you want to have (remember that every gate is also a node). You might want to selectively disable it for labels, so you can add every label/.append style={transform shape=false}] to the tikzpicture (this refers to the TikZ style every label, not to the yquant style every label!)

@projekter
Copy link
Owner

The lastest version should fix this. If you confirm, I'll push the new release to CTAN.

@fgfuchs
Copy link
Author

fgfuchs commented Nov 29, 2023

Thanks for the prompt response. It works now.

@projekter projekter added the bug Something isn't working label Nov 29, 2023
@projekter projekter self-assigned this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants