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

Subcircuit boxes don't render in groups environment #18

Closed
till-m opened this issue Jan 10, 2022 · 3 comments
Closed

Subcircuit boxes don't render in groups environment #18

till-m opened this issue Jan 10, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@till-m
Copy link

till-m commented Jan 10, 2022

Describe the bug
When using subcircuits in a yquantgroup environment, the borders of the subcircuit box don't render.

To Reproduce

\begin{figure}[h]
	\centering
	\begin{tikzpicture}
		\begin{yquantgroup}
			\registers{
				qubit {} q[2];
			}
			\circuit{
				x q[0];
				cnot q[1] | q[0];
			}
			\equals
			\circuit{
				cnot q[1] | q[0];
				[this subcircuit box style={inner ysep=6pt, "Two $X$"}]
				subcircuit {
					qubit {} q[2];
					x q;
				} (-);
			}
		\end{yquantgroup}
	\end{tikzpicture}
\end{figure}

I also tried using a dashed style, which unfortunately doesn't seem to work either. Neither produces an error, it just won't render the borders.

Expected output
I would expect a solid-border subcircuit box around the two X gates.

Screenshots
image

Environment
Compiled using PdfLaTeX with yquant 0.6 and tikz v3.1.8b.

Once again, thank you for the project @projekter!

@projekter projekter self-assigned this Jan 10, 2022
@projekter projekter added the bug Something isn't working label Jan 10, 2022
@projekter
Copy link
Owner

Thank you for reporting this. Within groups, the frameless attribute was applied via a normal style, not an argument. This did not get reset at all appropriate places.

@till-m
Copy link
Author

till-m commented Jan 10, 2022

Thank you for the quick fix!

On an unrelated sidenote, I was wondering if it was possible to make gates with dashed instead of solid borders?

@projekter
Copy link
Owner

Sure, just pass [dashed] as an attribute to the gate (or any line dashing pattern that TikZ understands). You can use arbitrary TikZ styles, as shown in the manual examples (have a look for example at pages 122 and 123 in the current master version).
Or, if you want to apply it to all gates of a certain type, add it to the respective style of the gate (e.g. \begin{yquant}[operators/every h/.append style={dashed}], or even globally in the document by using \yquantset{operators/every h.....}.

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