Skip to main content

Questions tagged [quantikz]

{quantikz} is a useful package for drawing quantum circuit diagrams.

Filter by
Sorted by
Tagged with
1 vote
1 answer
34 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} \...
Guanyu Li's user avatar
2 votes
0 answers
17 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 ...
user82261's user avatar
  • 121
2 votes
1 answer
43 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} \...
gilonik's user avatar
  • 213
2 votes
2 answers
51 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]{\...
David's user avatar
  • 21
0 votes
0 answers
25 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]{...
upe's user avatar
  • 217
1 vote
0 answers
15 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} \...
upe's user avatar
  • 217
2 votes
1 answer
56 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{...
upe's user avatar
  • 217
3 votes
1 answer
63 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 ...
shixian105's user avatar
-1 votes
1 answer
132 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?
Nick Cooper's user avatar
5 votes
2 answers
261 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,...
Blau's user avatar
  • 53
0 votes
1 answer
175 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} \...
Gabriel Balarezo's user avatar
1 vote
1 answer
86 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 ...
ryoutatsu's user avatar
3 votes
1 answer
44 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, ""] \& \& \& \...
mavzolej's user avatar
  • 586
2 votes
0 answers
72 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 ...
upe's user avatar
  • 217
3 votes
1 answer
205 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{...
Josh's user avatar
  • 145
1 vote
1 answer
189 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 ...
Vishwajeet Ohal's user avatar
0 votes
0 answers
39 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!...
Daniele Cuomo's user avatar
0 votes
1 answer
70 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} \...
Sean Thrasher's user avatar
0 votes
0 answers
69 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]{ \...
Cuhrazatee's user avatar
1 vote
1 answer
215 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 ...
Maxi Poser's user avatar
0 votes
2 answers
138 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....
17tmh's user avatar
  • 91
1 vote
0 answers
392 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. ...
markoman's user avatar
  • 647
3 votes
1 answer
185 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 ...
Max Schwetz's user avatar
0 votes
1 answer
212 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 ...
Alexandru Chirvasa's user avatar
0 votes
1 answer
284 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} \...
egwene sedai's user avatar
3 votes
1 answer
189 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 ...
user296811's user avatar
1 vote
0 answers
265 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} & ...
bz0's user avatar
  • 11
0 votes
1 answer
182 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 ...
Pronitron's user avatar
  • 103
2 votes
1 answer
122 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 ...
frederik's user avatar
1 vote
2 answers
488 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 ...
Figen YILMAZ's user avatar
1 vote
1 answer
232 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{...
Medulla Oblongata's user avatar
0 votes
1 answer
225 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 ...
Daniele Cuomo's user avatar
2 votes
2 answers
784 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} \...
Medulla Oblongata's user avatar
1 vote
1 answer
559 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{...
Medulla Oblongata's user avatar
0 votes
1 answer
76 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} ...
Medulla Oblongata's user avatar
1 vote
2 answers
168 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} \...
Medulla Oblongata's user avatar
0 votes
1 answer
844 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} \...
Medulla Oblongata's user avatar
1 vote
1 answer
531 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} \...
Medulla Oblongata's user avatar
1 vote
1 answer
357 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 ...
Mauricio's user avatar
  • 265
0 votes
0 answers
151 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 & ...
user277547's user avatar
3 votes
1 answer
977 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} ...
Orange Space's user avatar
1 vote
2 answers
977 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 & \...
Euler's user avatar
  • 123
0 votes
1 answer
426 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{...
Daniele Cuomo's user avatar
0 votes
1 answer
192 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} \...
boniface316's user avatar
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 ...
VitoShade's user avatar
2 votes
1 answer
1k views

Quantikz gategroup not working

I am trying to re-write the Grover search algorithm using quantikz. I was trying to highlight the inner group of operations (basically the whole circuit except for first and last column) using \...
wasalbi's user avatar
  • 23
2 votes
2 answers
719 views

How to change \slice{} color on quantikz

Within quantikz package there's this possibility to put a single slice to separate two columns, through the command \slice{}. By default it is colored in red and no standard command allows to change ...
Daniele Cuomo's user avatar
0 votes
0 answers
346 views

Quantikz \ctrlbundle causing the document not to compile?

I'm trying to compile the following code: \documentclass{article} \usepackage{tikz-cd} \usetikzlibrary{quantikz} \begin{document} \begin{quantikz} \qwbundle[alternate]{} & \...
Baffo rasta's user avatar
2 votes
2 answers
3k views

How to draw a circuit using quantikz?

How can one draw this complicated-looking circuit with quantikz? Edit: Here is my attempt: \documentclass[english]{revtex4} \usepackage{graphicx} \usepackage{amsmath} \usepackage{tikz} \...
Zubin's user avatar
  • 177
6 votes
1 answer
847 views

Draw measurement on a set of wires using quantikz

I want to draw this circuit (Bernstein-Vazirani Algorithm) using the quantikz package. I could not draw the measurement on a set of wires like the figure. Here is my attempt: \begin{center} \begin{...
Nawal's user avatar
  • 61