Questions tagged [quantikz]
{quantikz} is a useful package for drawing quantum circuit diagrams.
61 questions
4
votes
0
answers
38
views
quantikz2 problems with faded drop shadows [closed]
There seems to be a bug with faded drop shadows in quantikz2.
I've been using quantikz (1.x) with TexLive 2020, where I gave my circuit diagrams nice looking drop shadows by attaching this style:
\...
1
vote
0
answers
27
views
Put a gate in front of a wave in Quantikz
I'm trying to make a circuit in quantiks that represents an arbitrary sized gate
\begin{quantikz}[background color=black!5!white]
&\gate[5]{H^{\otimes n}} &\swap{4} & \\
& & & \...
0
votes
1
answer
123
views
how to draw this? \wire does't work
\documentclass[12pt,reqno]{report}
\usepackage{amsfonts}
\usepackage{stmaryrd}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{quantikz}
\begin{document}
\listofQuantikz
\begin{...
3
votes
2
answers
167
views
Quantikz - "Missing control sequence inserted" when using \mathcal in a \qwbundle
I am trying to typeset a circuit where there is a letter in \mathcal font on a \qwbundle label. Here is a minimal example:
\documentclass{article}
\usepackage{quantikz}
\begin{document}
\begin{...
2
votes
1
answer
83
views
How to permute a single wire to no wire in quantikz?
When I try to permute the bottom wire to the middle row, where there were no wire to begin with, there is an extral foot wire that I hope can be erased:
\begin{quantikz}
& \permute{3} \...
1
vote
1
answer
62
views
how can I auto number quantikz
I want quantikz to be able to number automatically,like this:
which I currently use align
\documentclass[12pt,reqno]{report}
\usepackage{amsfonts}
\usepackage{stmaryrd}
\usepackage{amsmath}
\...
2
votes
0
answers
76
views
Erasing Quantum Wire and Adding Dotted Arrows in Quantikz
I am trying to create a quantum circuit. See the attached image. I'd like to erase the quantum wire in the second row so I can put three vertical dotted arrows in the first column of the circuit to ...
2
votes
1
answer
64
views
can a \gategroup box have two labels?
I'm trying to place labels both above and below a single \gategroup box in my circuit, but haven't been able to figure it out, nor find examples on line. For instance:
\documentclass{article}
\...
2
votes
2
answers
111
views
Spacing and indexing in quantikz
Can somebody explain how I can add space in the following picture and code?
\documentclass{article}
\usepackage{quantikz}
\begin{document}
\begin{quantikz}
\lstick{A} &&& \\
\lstick[2]{\...
0
votes
0
answers
65
views
Quantum Circuit inside Gate
Is there a trick that allows me to put a quantum circuit inside a gate with quantikz?
My attempt so far is to use \includegraphics{<img>} to put an image inside the gate:
\documentclass[12pt]{...
1
vote
0
answers
20
views
Squish 2 gates into 1 cell
Does anybody know a way to squish 2 gates into one column with quantikz?
Take this circuit for example:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{quantikz2}
\begin{document}
\...
2
votes
1
answer
101
views
Underbrace quantum circuit without inputs
Is there a way to underbrace a quantikz circuit without the inputs?
What I have:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{quantikz2}
\begin{document}
$\underbrace{
\begin{...
3
votes
1
answer
231
views
Adjusting size of operations in quantikz
I am trying to adjust the relative size between gate boxes and simpler gate operations (e.g. CNOTs), but am having some trouble. The main motivation is to draw a large circuit, in which case the CNOT ...
-1
votes
1
answer
267
views
How to draw a quantum measurement in TikZ LaTeX
I want to draw a quantum measurement in TikZ LaTeX as the following image! Any ideas?
5
votes
2
answers
324
views
Quantikz not compatible with tikz-cd?
I want to draw quantum circuits and commutative diagrams, so I want to use the two packages quantikz and tikz-cd.
But somehow quantikz overwrites tikz-cd. Take a look at this code:
\documentclass[11pt,...
0
votes
1
answer
449
views
How to get quantikz2 working locally? [duplicate]
I am using latex in Ubuntu 22.04. I have been trying to generate quantum circuits using quantikz. I have been reading the documentation and they import the package as:
\usepackage{tikz}
\...
1
vote
1
answer
162
views
Quantikz circuits bugs in TexStudio
I'm working in a huge file in Tex Studio in which I create lots of circuits using quantikz. The issue is that whenever I draw a circuit in the third chapter or later, the diagram that appears in the ...
3
votes
1
answer
55
views
Prevent quantikz from altering tikz behaviour?
This code
\documentclass{article}
\usepackage{tikz-cd}
% \usetikzlibrary{quantikz2}
\begin{document}
\begin{tikzcd}[ampersand replacement=\&]
A \arrow[rrrr, ""] \& \& \& \...
2
votes
0
answers
111
views
Quantikz: Move gategroup in foreground
Here is an small example of a quantum circuit (drawn with quantikz) that has 3 gategroups.
How can I move Charlie's gategroup (blue) to the front so that it is also on top of Bob's gategroup, like ...
4
votes
1
answer
278
views
How to display two quantum circuits side by side using quantikz?
I have two quantum circuits that I'd like to display side by side using the quantikz package in LaTeX. Here's the code for the two circuits:
\begin{quantikz}
& \ctrl{1} & \\
& \targ{...
1
vote
1
answer
324
views
Quantikz: Control gates are not connected by lines
I am using quantikz library to draw a circuit diagram similar to the ones in this research paper. I can see a gap in the wires after the 4th S gate on the 1st and 4th qubits. I have tried fiddling ...
0
votes
0
answers
53
views
quantikz/tikz, I can't remove the borders from some operators without obscuring letters
Depending on the definition of parameters I can remove or keep the boarders of an operation.
For example, this code
\begin{quantikz}
&\gate[style={red!10}]{X} & \measure[style={fill=gray!...
0
votes
1
answer
90
views
Quantikz: add text without
I have the following circuit, made using quantikz.
I was wondering how I could simply get rid of the lines between the letters on the top row.
The latex is
\documentclass{article}
\usepackage{tikz}
\...
0
votes
0
answers
93
views
Quantikz gategroup, stepsize isn't functioning properly
I would like the dashed line to extend to the right of the last Hadamard gate on the top register. Everything is, more or less, happening in the top 3 registers
\begin{tikzpicture}
\node[scale=0.88]{
\...
1
vote
1
answer
340
views
Quantikz: Annotation Text Above Gate
For a given gate symbol in the quantikz package, I would like to be able to place text above or below the gate in addition to the gate label.
Shifting the text up and using \n to force multiple lines ...
0
votes
2
answers
202
views
Quantikz horizontal alignment for qwbundle
How can I achieve proper horizontal alignment for the "n" in the MWE?
Couldn't find anything in the docs... https://ctan.mc1.root.project-creative.net/graphics/pgf/contrib/quantikz/quantikz....
1
vote
0
answers
468
views
Permuting empty wires in quantikz2
I want to be able to draw some circuits with weaving wires. The quantikz2 tikzlibrary (here) has the \permute gate which almost does what I want, but there is a problem is if a row has an empty wire.
...
3
votes
1
answer
245
views
How do I use both quantikz and zx-calculus packages?
I am a long-time consumer of the discussions in this great forum. This is my first question, so please correct me if I do not follow some protocols.
In my attempt to use both the packages zx-calculus ...
0
votes
2
answers
298
views
The \slice{} command from quantikz doesn't work
I have tried writting some circuits and wanted to put slices to better explain what was going on after every gate. The problem is that when I tried to use the command the slices end up on the same ...
0
votes
1
answer
410
views
quantikz/tikz slice text placement
For the slice element of quantikz, I would like to place the text at the bottom, for example I can do this with the A1 and B1 text as
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\...
3
votes
1
answer
272
views
How to use your own styles in Quantikz?
I am using the quantikz package to draw a quantum circuit and I am failing to insert my "own" gate (BS) as a quantum gate. The gate noisy is a working example of what I want to insert in the ...
1
vote
0
answers
303
views
quantikz - drawing circuit with output in the middle
I'm currently trying to draw this circuit in the quantikz package:
This is what I have so far (+ the output):
\begin{quantikz}
\lstick{$\ket{x_1}$} & \gate{NOT} & \gate[2]{NAND} & ...
0
votes
1
answer
262
views
Quantikz: how to draw zig-zag lines connecting gates on different wires?
I want to draw a zig-zag line between two gates on different wires (to represent entanglement) using quantikz. So far I've only managed to join the gates using a straight wire by making use of a ...
2
votes
1
answer
164
views
Conflict between quantikz, cleveref and gather environments
I am writing an article in which I need a quantum circuit figure, and want to use the quantikz package for the purpose. However, I got a series of errors upon loading quantikz. I have pinpointed the ...
1
vote
2
answers
558
views
Trying to draw a quantum circuit, a basic one
In the beginning, it can start with 'n' input and the same number of output but could not make output lines. I am actually now quite sure about the details of these codes, that's why could not ...
1
vote
1
answer
291
views
Setting default font size in quantikz
How do I change the default font size of all text inside a quantikz environment? There isn't anything in the docs.
\documentclass[border=1cm]{standalone}
\usepackage{quantikz}
\begin{document}
\begin{...
0
votes
1
answer
264
views
How to remove the line from \gategroup command in quantikz
Within quantikz package there's the possibility to wrap a circuit within a box, through the command
\gategroup[]{}
By default, such a group plots the perimeter. The options allow to make the perimeter ...
2
votes
2
answers
999
views
Annotating quantikz circuit
I'm trying to annotate certain parts of my quantikz circuit and drawing boxes around some gates:
\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\...
1
vote
1
answer
694
views
Quantikz remove left wire of gate box
I'm trying to draw a circuit with quantikz using the code:
\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\begin{...
0
votes
1
answer
98
views
Drawing electrical circuit and quantum circuit in same tikpicture environment
I want to include an electrical circuit symbol (capacitor) and quantikz meter in the same tikzpicture environment, but this doesn't draw the quantikz symbol. What am I missing?
\documentclass{article}
...
1
vote
2
answers
210
views
Quantikz draw kink on wire
I want to draw a kink on a wire using quantikz. I'm using the second block of code on p.14 of the quantikz docs,
\documentclass{article}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\...
0
votes
1
answer
1k
views
Quantikz formatting gate boxes
I'm trying to draw a circuit in quantikz and using examples from the manual.
\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb,amsfonts}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\...
1
vote
1
answer
631
views
Quantikz draw strike on double wire and arrow on vertical wires
I'm trying to draw this circuit using quantikz. I don't know how to draw the strike symbol on the double wire, or the down arrow from the \meter:
\documentclass{article}
\usepackage{graphicx}
\...
1
vote
1
answer
444
views
How to create gate symbol in quantikz?
I want to define a gate in quantikz with my own shape. Let's say I want a triangular gate or $\odot$ (instead of the usual CNOT or the square with letter). How can this be achieved? I looked at the ...
0
votes
0
answers
163
views
quantum circuits in tikz (quantikz) modifying of a command, or how to address nodes
Sorry I am not very familiar with this.
I am using quantikz package to draw quantum circuits.
There is an otherwise undocumented feature
\begin{tikzcd}
& \makeebit[-60][blue]{test} & \qw & ...
3
votes
1
answer
1k
views
Drawing Two CNOT gates
I'm new to LaTeX and the tikz package in general.
Here is what I have so far:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\begin{document}
\begin{center}
\begin{quantikz}
...
1
vote
2
answers
1k
views
How to draw simple wires in quantikz
I want to make a way to redirect a line of a quantum circuit to other.
The perfect idea that i have is to use something similar to,
\begin{quantikz}
& \gate{H} & \gate[swap]{} & \qw & \...
0
votes
1
answer
493
views
Customize bold and thin lines in quantikz
I need to write a circuit in thin lines where an operation is exception to this. For example
\begin{quantikz}[thin lines]
& \qw & \ctrl{1} & \qw\\
& \qw & \targ{} & \qw
\end{...
0
votes
1
answer
209
views
quantikz - moving the $\psi_0$ down like the other $\psi$
I would really appreciate if someone can help me move $psi_0 to the bottom like the rest of the $psi$. Below is the code I used.
\documentclass{report}
\usepackage{lscape}
\usepackage{dsfont}
\...
1
vote
2
answers
1k
views
Quantum algorithm circuit with Quantikz
I'm trying with no results to use latex for drawing the famous “Deutsch algorithm”:.
For this use case, I've tried like every latex package for quantum circuits. The one with which I was able to ...