Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Procedure for constructing magic state gate injection gadgets

I have a quantum computer that cannot implement the gate $U$ by itself, and needs help in the form of a magic state $|U\rangle$ held in another register. Is there a general-purpose procedure for ...
William Schober's user avatar
1 vote
1 answer
255 views

Simple successor gate

I want to create a gate that, given a sequence of qbits that encode n, transforms that sequence in n+1, in other words the successor function. I managed to do it in qiskit by writing this: ...
ThePirate42's user avatar
0 votes
0 answers
39 views

4- controlled- Z gate (C4Z gate) formation using C4X and Hadamard gates

I require a quantum circuit that utilizes C4X and Hadamard gates to form a C4X gate. Could anyone please help me?
Aech's user avatar
  • 1
3 votes
1 answer
155 views

Is Controlled$(R_z(\theta))$ more expensive than Controlled$(Z^t)$ on the surface code?

There are (at least) two conventions for single-qubit, arbitrary-angle Z rotations in quantum computing, which I will call Rz(theta) and Z^t. $$ R_Z(\theta) = \exp(-i \theta Z/2) = \mathrm{diag}(e^{-i ...
Matt Harrigan's user avatar
0 votes
1 answer
158 views

Is there a tool to decompose 4-Qubit unitaries (aka 16x16 matrices)?

I was wondering if there is a tool that can decompose such a matrix in gates on 4 qubits? I found one for 3-qubit gates (9x9 matrices) in Cirq but nothing for bigger matrices. (The matrix is not ...
Schrödinger314's user avatar
1 vote
1 answer
77 views

Implementation of a unitary operator scaled by a factor

Is it possible to implement a unitary operator scaled by a factor on a quantum computer? Let's say the unitary operator is $U$: $$U=\begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}\...
upe's user avatar
  • 321
0 votes
1 answer
64 views

Realization of the gate $(I\pm U)/2$

The state after applying the Hadamard test (before measurement) is $$\newcommand{\ket}[1]{|#1\rangle}\newcommand{\bra}[1]{\langle#1|}\ket{0}\frac{I+U}{2}\ket{\psi} + \ket{1}\frac{I-U}{2}\ket{\psi}.$$ ...
upe's user avatar
  • 321
2 votes
2 answers
90 views

Better constant for linear depth incrementers

Currently working on some quantum arithmetic and was wondering if we have a better constant factor for a linear depth incrementer. As an example (and the best I could currently find), Craig Gidney ...
Ramezzez's user avatar
  • 156
5 votes
4 answers
121 views

$U_1\oplus U_2$ decomposable into $I\oplus U$ and 1-qubit gates?

TL;DR Let $U_1, U_2, U$ be arbitrary 1-qubit quantum gates. Can 2-qubit gates of the form $U_1\oplus U_2$ always be decomposed into a combination of controlled gates ($I\oplus U$) and single qubit ...
upe's user avatar
  • 321
1 vote
1 answer
181 views

How many gates are necessary to implement an arbitrary n-qubit permutation unitary?

How many gates are necessary to implement an arbitrary n-qubit permutation unitary, using only 1- and 2-qubit gates? An n-qubit permutation unitary is a $2^n$ x $2^n$ unitary matrix where each entry ...
QNA's user avatar
  • 181
3 votes
1 answer
115 views

Is it possible to decompose a controlled gate with control qubit in the $|+\rangle$ state?

$\newcommand{\ket}[1]{\vert#1\rangle}\newcommand{\bra}[1]{\langle#1\vert}$ Given a quantum circuit with 2 qubits that executes a controlled gate $CU$ where the control qubit is in the $\ket{+}$ state, ...
upe's user avatar
  • 321
1 vote
0 answers
40 views

Calculation of feasible operations for a certain set of primitive gates

Assume we have a set of primitive operations of a quantum processor. How can I determine the set of feasible operations or prove that a certain operation is not feasible? As an example, one could ...
qntdni's user avatar
  • 23
2 votes
1 answer
469 views

Multi-control multi-target gate

I'm using qiskit for simulation. Suppose, I have 6 qubits with indices [0, 1, 2, 3, 4, 5] and I have an operator $U$ of size $4 \times 4$, such that it operates on ...
Марина Лисниченко's user avatar
2 votes
1 answer
77 views

Math Behind $X$ Gate With Arbitrary Phase is equivalent to $ZXZ$ Gate

An X gate where there is a phase shift $\phi$ to the applied sinusoidal wave $U = e^{-i\frac{\theta}{2}(cos(\phi)\sigma_x+sin(\phi)\sigma_y)}$ is equivalent to a series of gates $Z_{-\phi}X_{\theta}Z_{...
Esam El-khouly's user avatar
1 vote
0 answers
83 views

Application of transformation $U_d$ that maps any qudit state to $|d-1\rangle$

When giving examples of universal gate sets in the paper Qudits and High-Dimensional Quantum Computing, the authors first define the transformation that maps any given qudit state to $|d-1\rangle$: $$ ...
banercat's user avatar
  • 867
2 votes
1 answer
225 views

Exact synthesis of Toffoli gate from CNOT and rational single-qubit gates?

Is it possible to implement a Toffoli gate exactly using just CNOT gates and single qubit complex rational gates (i.e. with entries in $\mathbb{Q}(i)$), possibly with ancillas? I know this works with ...
D0r1an's user avatar
  • 21
3 votes
1 answer
232 views

How many two-qubit controlled gates do you need to simulate any CU gates where U is a diagonal matrix?

Assuming we have n qubit, the first qubit is a control qubit, and the rest are the targets of $U$. If $U$ is a diagonal matrix, is there any theory to find the minimum number of two-qubit controlled ...
Huy By's user avatar
  • 103
2 votes
1 answer
104 views

Converting a Matrix to a Gate in OpenQasm 2

I am a beginner when it comes to quantum computing so forgive me if this is a dumb question. Does anyone know how to create a gate from any matrix on OpenQasm2? Specifically, can anyone provide any ...
Sam's user avatar
  • 31
1 vote
0 answers
85 views

How to Trotterize a CNOT gate?

I came across a paper that said that they Trotterized a CNOT gate into 4 blocks of CU gates where the CU gate parameters are specified. This was all done on Qiskit. How does this Trotterization ...
NikNack's user avatar
  • 51
1 vote
2 answers
1k views

How to construct common classical gates with CNOT circuit?

How can I construct AND, OR, NAND, NOR with CNOT gates. First off, this other question describes how to make them with matrices. Theoretically I can construct all those gates already. I know how to ...
ions me's user avatar
  • 113
5 votes
3 answers
858 views

Quasiprobability decomposition of the CZ-gate

I was trying to obtain the quasi-probability decomposition of the CNOT gate by using the information in this paper. The authors give us the example for the CZ gate (Figure 2, i.e. the one below). The ...
stopper's user avatar
  • 513
0 votes
1 answer
123 views

Implementing Odd Permutations Without Ancilla Bit

The paper says that The inversion $\alpha \mapsto \alpha^{-1} $ (where 0 is mapped to 0) can be seen as a permutation on $\mathbb F_{256}$. This permutation is odd, while quantum circuits with NOT, ...
user's user avatar
  • 1
1 vote
1 answer
306 views

Decomposition of unitary operator into rotations around Bloch sphere

I apologize in advance for any mistakes as I am new to this field and come from a programming, rather than mathematical/physical background. I am looking for a way to decompose a given operator $U$ ...
Satvik Duddukuru's user avatar
1 vote
0 answers
67 views

Faithful description of a photonic setting with the circuit model

The above picture comes from this paper. The circuit on the left and the one on the right are equivalent (up to the basis). However, there is an important difference: the circuit makes the input -- i....
Daniele Cuomo's user avatar
2 votes
1 answer
126 views

Is there a name for a gate that 'moves' one qubit to a new position via multiple SWAP gates?

Let's say there is a qubit at position $i$, and I want to move it to position $i'$. Without loss of generality, let's say $i < i'$. By 'move it' I mean, perform multiple $SWAP$ operations so that ...
Quantum Guy 123's user avatar
1 vote
2 answers
159 views

CNOT chain vs CNOT fountain in qiskit

I was going through qiskit's synthesis module, their methods take an argument called cx_structure which has two possible values, ...
Zee's user avatar
  • 391
4 votes
0 answers
100 views

What is the correct name of this quantum gate? Possibly state control gate

Let $\vec v \in \mathbb{C}^2 $ be the following quantum state: $$ \vec v = \frac{1}{\sqrt{2}}\begin{bmatrix} v_{1} \\ v_{2} \\ \end{bmatrix},\space \lvert v_1 \rvert = 1,...
misanek123's user avatar
5 votes
1 answer
344 views

Native Gate Decomposition

TL;DR: I've got a very small set of gates to use and need to find efficient decompositions for $R_y$ and controlled $R_y$ gates. Does anyone have any better ideas than what I have? I'm looking to ...
Ken Robbins's user avatar
4 votes
1 answer
159 views

Confusion with the number of CNOTs in a circuit

I am a bit puzzled on the following circuit. According to this Quantum Computing SE thread it holds that $$ e^{i(Z\otimes Z)t} = {\rm CNOT} (I\otimes e^{iZt}){\rm CNOT} \qquad (1) $$ As a result we ...
user39726's user avatar
6 votes
2 answers
724 views

How many quantum gates are needed to prepare an arbitrary state?

In this paper there is this sentence: [...] the description of a $2^n\times2^n$ unitary matrix $U$ (which is a poly($n$)-size quantum circuit) According to the meaning of "which" in ...
Doriano Brogioli's user avatar
2 votes
1 answer
85 views

Decompose bell measurement gate into combination of controlled-not gates and one-qubit gates

OPENQASM2.0 has only one two-qubit gate: controlled not. For a teleportation experiment, I need to perform a measurement in the Bell basis. That is, I need a two-qubit gate with matrix representation $...
Anna Naden's user avatar
1 vote
2 answers
113 views

Circuit including phase factor in $XY(\beta, \theta)$ gate

In Implementation of the XY interaction family with calibration of a single pulse, the $XY(\beta, \theta)$ gate is defined as $$ XY(\beta, \theta) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 &...
epelaez's user avatar
  • 2,965
-1 votes
1 answer
130 views

Decomposition of U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gate [closed]

Can we express U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gate $$ U_1(\lambda) = \begin{pmatrix}1 & 0 \\ 0 & e^{i\lambda}\end{pmatrix}$$ $$ \phi(\delta) = \begin{...
quankid's user avatar
  • 323
4 votes
1 answer
169 views

Universality for reversible classical computation

Is there any way to check whether a set of gates (for example, take the set comprising of the CNOT gate and the Hadamard gate) is universal for reversible classical computation? I can think of trial ...
BlackHat18's user avatar
  • 1,515
7 votes
2 answers
543 views

Complexity of $n$-Toffoli with phase difference

I'm interested in the $n$-Toffoli gates with phase differences. I found a quadratic technique in section 7.2 of this paper. Here's the front page of the paper. Here's an image of the section that I'm ...
Minh Pham's user avatar
  • 101
7 votes
2 answers
7k views

How to visualize Hadamard gate as $X$-$Z$-$X$ decomposition?

In the book Quantum Computation and Quantum Information by Nielsen and Chuang, chapter 4, exercise 4.4 (pg. 175), the author has asked to express Hadamard gate as product of $R_x$, $R_z$ rotations and ...
Trishant Sahu's user avatar
5 votes
2 answers
408 views

How to implement the power of a product of quantum gates as a circuit?

Suppose I have quantum gates (i.e. unitary matrices) $A$ and $B$, and I want to implement $(AB)^x$ in a circuit. If $x$ is integer, I can simply apply $A B$ repeatedly $x$-times. But what if $x$ is a ...
M. Stern's user avatar
  • 2,457
4 votes
0 answers
130 views

Reducing an ansatz to a shallower circuit

Given a very general hardware efficient ansatz as in Figure: and say that you already know all the rotation parameter for the gates in the red box, is there any way to build a gate sequence that ...
Enrico's user avatar
  • 493
3 votes
1 answer
471 views

How to create CNOT from an entangling gate and arbitrary single-qubit gates?

I am working on the classical simulation of quantum circuits. I know how to efficiently implement the following entangling gate, which -- in the following paper: https://arxiv.org/pdf/1803.02118 -- ...
Moritz Epping's user avatar
4 votes
2 answers
901 views

What gate should one use to perform $R_y$ using a single $R_z$ + Clifford gates?

I know how to perform Rz rotations with the least amount of T gates, eg by using Efficient Clifford+T approximation of single-qubit operators by Peter Selinger. Similarly, one could use H Rz H to ...
Pablo's user avatar
  • 583
8 votes
3 answers
2k views

Is it possible to make a Toffoli gate using only CNOTS and ancillas?

I have tried to make a Toffoli gate using only CNOTs and some ancilla qubits but I do not get the unitary. It seems it is not possible without additional gates? What could I do to prove it? I have ...
Mauricio's user avatar
  • 2,396
4 votes
1 answer
518 views

From mathematical notation to quantum circuit, in general

I am learning the basics of quantum computing using Qiskit and I encountered a problem when I tried to solve some of our course exercises. I feel like I am missing an invisible step, the step from ...
Auke Schaap's user avatar
2 votes
3 answers
207 views

Find unitary such that $U:|i\rangle|0\rangle\rightarrow|i\rangle|A_i\rangle$

Let's assume I have two qubits of state $|A_0\rangle$ and $|A_1\rangle$ correspondingly stored in a quantum memory. How do I find a Unitary $U$ that acts on another register of 2-qubits such that $$U:|...
Thomas's user avatar
  • 279
3 votes
1 answer
677 views

How does a general rotation $R_\hat{n}(\theta)$ related to $U_3$ gate?

From eqn. $(4.8)$ in Nielsen and Chuang, a general rotation by $\theta$ about the $\hat n$ axis is given by $$ R_\hat{n}(\theta)\equiv \exp(-i\theta\hat n\cdot\vec\sigma/2) = \cos(\theta/2)I-i\sin(\...
ZR-'s user avatar
  • 2,408
2 votes
1 answer
159 views

How does MCPhaseGate/MCU1Gate works internally in qiskit?

I was curious about the implementation of MCPhase/MCU1Gate and how it works without ancilla qubits. I ended up checking the code of the some auxiliary (?) function ...
123's user avatar
  • 61
2 votes
1 answer
135 views

IBM Qiskit QAOA gate implementation question

In section $5.2$ of the QAOA chapter in Qiskit textbook, section $5.2$, state preparation uses the gate $U_{k,l}(\gamma) = e^{\frac{i \gamma}{2} (1-Z_k Z_l)}$. Later, in section $5.3$, this gate is ...
creet's user avatar
  • 105
7 votes
1 answer
348 views

More efficient implementation of $4$-qubit gate

While working on an error detection algorithm, I stumbled upon the problem of simplifying the following implementation Here, the $S$ gate is defined by $$S=\left( \begin{array}{cc} \frac{\sqrt{3}}{2}...
QC_QAOA's user avatar
  • 135
6 votes
1 answer
2k views

How to construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift?

How can I construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift? I am stuck in this and any help would be appreciated.
user avatar
5 votes
1 answer
238 views

Single-qubit rotations on a subspace within two-qubit unitary

I would like to implement the operation $$ U(a,b) = \exp\left(i \frac{a}{2} (XX + YY) + i \frac{b}{2} (XY - YX) \right) $$ ($a,b \in \mathbb{R}$) without using Baker-Campbell-Hausdorf expansion, ...
forky40's user avatar
  • 7,646
7 votes
3 answers
351 views

Decomposing gates resembling exponentiated members of desired gateset

Suppose I have access to a pretty typical gate set, for example $\{\text{CNOT}, \text{SWAP}, \text{R}_{x}, \text{R}_{y}, \text{R}_{z}, \text{CR}_x, \text{CR}_y, \text{CR}_z\}$ where $\text{CR}$ is a ...
forky40's user avatar
  • 7,646