Questions tagged [gate-synthesis]
For questions about finding (short) gate sequences to implement a specific unitary operation, for example decomposing a complicated multi-qubit gate into a sequence of basic gates. It might apply to optimizing circuits with respect to length or depth or finding gate sequences to implement an algorithm.
231 questions
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 ...
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 ...
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 ...
10
votes
2
answers
2k
views
Transpilation into custom gate set in qiskit
In qiskit, I can transpile a given circuit into a some predefined gate set as follows (just an example)
...
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 ...
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 -- ...
4
votes
2
answers
900
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 ...
3
votes
1
answer
119
views
Tool to verify $CNOT$ (or any interacting 2-qubit gate)
Is there any tool to define a circuit and verify if it works as desired?
It would be interesting to find ways of performing interacting gates - e.g. CNOT gate - between non adjacent qubits.
Hence I'd ...
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 ...
2
votes
1
answer
97
views
Do we need to use an ancillary qubit when decomposing arbitrary $U(2^n)$ gates using Clifford+T universal gate sets?
As I know, we can decompose $U$ without ancilla if it's from special unitary group $SU(2^n)$. Do we need to use ancilla qubit on decomposing arbitrary $n$-qubit $U$ using Clifford+T universal gates ...
5
votes
1
answer
702
views
What is Qiskit's Transpiler method for unitary synthesis?
As I could found in here how the transpile works in qiskit, I understood that transpile gets arbitrary Unitary gate $U$ and some set of basis gates as input, and produce some quantum circuit of $U$ ...
4
votes
1
answer
517
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 ...
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:|...
3
votes
1
answer
676
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(\...
3
votes
2
answers
2k
views
How to implement $\sqrt{iSWAP}$ in Qiskit
I want to implement the $\sqrt{iSWAP}$ operator using simple operations in Qiskit such as it is done for the $iSWAP$ here or $\sqrt{SWAP}$ gate here. How can I do this? If possible I would like to ...
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 ...
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 ...
7
votes
1
answer
346
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}...
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.
2
votes
0
answers
152
views
Representation of multiple qubit matrices in Dirac notation
Imagine one wants to represent the and function for any number of qubits in Dirac notation. The and gate flips the target qubit if all the control qubits are in state 1. This is its matrix ...
6
votes
3
answers
120
views
How to create the state $\vert 0 \rangle+i \vert 1 \rangle$ using elementary gates?
I am trying to write $|0\rangle+i|1\rangle$ in terms of elementary gates like H, CNOT, Pauli Y, using the IBM QE circuit composer.
I was thinking some kind of combination of H and Y since $Y|0\rangle=...
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, ...
5
votes
1
answer
670
views
Gate-level implementation of Eigenvalue-Inversion in HHL
I am trying to understand how does the gate-level implementation of eigenvalue-inversion step in the HHL algorithm works.
I am following this reference, where it is stated (Lemma 4) that this can be ...
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 ...
-1
votes
1
answer
188
views
How to create a gate with functionality CCX(a,b,b)?
Can we create a Controlled gate with below functionality?
if {a==|1> && b==|1>} then {qc.x(b)}
Basically, a CCX gate but the output Qubit is actually one of the input Qubits. Apparently, ...
7
votes
1
answer
195
views
Reducing the depth of quantum circuits with ancilla qubits
This question is two-fold and considers general $n$-qubit operations on a quantum computer.
First, can a general $n$-qubit operation be implemented on a quantum computer without the use of ancilla ...
4
votes
1
answer
4k
views
CNOT expressed with CZ and H gates by taking into account HZH =X
From this link:
Where equation 1 is:
I can probably brute-force this by explicitly calculating this quantum circuit's effective 4x4 matrix and seeing that its equivalent to this teleportation ...
1
vote
1
answer
2k
views
How to code a projector operator in qiskit?
I'm new to qiskit and I want to know how do I define a projector operator in qiskit? Specifically, I have prepared a 3 qubit system, and after applying a whole lot of gates and measuring it in a state ...
3
votes
2
answers
134
views
Decomposition of $|110\rangle \leftrightarrow |000\rangle$ Exchange Gate
How to implement a 3 qubit gate, that exchanges the level $|110\rangle$ and $|000\rangle$, with elementary gates (CNOT, SWAP, Toffoli, local gates, etc.(everything Qiskit allows)):
$$
U=\pmatrix{
0 &...
2
votes
1
answer
1k
views
Principal square root of Pauli Y gate in Qiskit?
I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of ...
3
votes
1
answer
457
views
How to define Q-operator in Quantum Amplitude Estimation
I'm trying to implement a circuit for Quantum Amplitude Estimation in Qiskit using elementary gates.
I have created the circuit that represent my algorithm $A$ but now from the theory I know that I ...
7
votes
1
answer
452
views
Adding a phase to qubit: why is it necessary for arbitrary single qubit gate
By convention, we often write a single qubit gate as:
$$U=e^{i \alpha} R_z(\beta) R_y(\gamma) R_z(\delta)$$
We notice that in addition to the three rotations, there is a coefficient $e^{i \alpha}$. ...
7
votes
1
answer
1k
views
Would IBM's "compiler" turn my identity circuit into nothing?
If I were to create a circuit with the following gate:
$$\tag{1}R_\phi = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{bmatrix},$$
with $\phi$ specified to be equal to 0, then the gate that I ...
5
votes
1
answer
2k
views
How can you decompose Grover's diffusion operator into gates?
I know how Grover's diffusion operator works ($U_s = 2|s\rangle\langle s|-I$) with the inversion around the mean. However, I want to implement it in simpler gates, to use the algorithm. How can I do ...
6
votes
2
answers
215
views
Equivalence checking of quantum circuits up to error
Suppose you are given two circuit descriptions $A$ and $B$ where by a circuit description I mean a sequence of gates (in the order they are applied) and the qubits they are applied on. (For the sake ...
6
votes
2
answers
650
views
How to find a circuit for the roots of QFT?
After reading about using quantum gates instead of ancillas, it asserts that every quantum circuit has a square root. Theoretically, they do, but is there a practical method to generate the quantum ...
3
votes
1
answer
447
views
Is it possible to express $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? In Qiskit for example
Is it possible to express gate $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? Both in principle and in practice (in Qiskit for example)?
The single gate $R_z(\lambda)$ ...
5
votes
2
answers
722
views
Are Toffoli gates actually used in designing quantum circuits?
In an actual quantum computer, are we designing circuits with Toffoli Gates and then using compilers or optimizers to remove redundancies so that we can use fewer qubits than a full Toffoli gates ...
2
votes
2
answers
410
views
How to construct a CU3 gate using only CX and U3 gates?
Knowing that CX and U3 (taking 3 parameters $\theta, \phi$ and $\lambda$) form a set of universal gates how can I construct an arbitrary CU3 gate using a decomposition of only CX and arbitrary U3 ...
7
votes
1
answer
435
views
What are the differences between the Toffoli and Fredkin gates (historical, practical, etc.)
I'm trying to understand the historical ordering and the practical differences between the Toffoli Gate and the Fredkin Gate.
Toffoli's February 1980 tech report MIT/LCS/TM-151 states:
Where ...
4
votes
3
answers
455
views
What is the complexity of splitting a state into a superposition of $n$ computational basis states?
$\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
I'...
3
votes
1
answer
484
views
Implementing a controlled-controlled-U using controlled-U
Suppose I know how to implement a 2 qubit gate $C-U$ (i.e controlled U), and I want to implement $CC-U$ using $C-U$ and other 1 or 2 qubit gates, is that possible?
2
votes
1
answer
301
views
Cheap Toffoli gates with phase errors
Here, a cheap verion of a Toffoli, up to a phase flip for $|101\rangle$, is given by
with $A=R_y(\pi/4)$. Are there similar versions of cheap implementation of general $C^nNOT$ gates?
I tried to ...
1
vote
0
answers
56
views
How can I prove the universality of this set of gates?
I was reading this article. A brief explanation: Here we have a circuit, the registers are a stepfunction state, an single photon state and a function state. The first two have position operators $X$ ...
2
votes
0
answers
326
views
Decompose Toffoli gate with minimum cost for IBM quantum computer
The known decomposition of toffoli gate that can be used on IBM quantum computer is :
I want to know any other Toffoli gate decompositions that can be used on IBM quantum computer and have a cost ...
5
votes
1
answer
605
views
Building a state with parallel execution
I'm trying to implement the main algorithm described in the Quantum Recommendation Systems paper. In order to do this, I have to create a quantum state $|x\rangle$ corresponding to a real vector ...
8
votes
2
answers
1k
views
How can I fill a unitary knowing only its first column?
I have a unitary matrix that I want to construct. I only care what happens to the first computational state, so the first column is specified. So far, I've been assigning each question mark to a ...
2
votes
2
answers
306
views
How to prove that a matrix is an arbitrary unitary?
My goal is to prove that I can synthesise arbitrary unitary from two components.
In the end, I find a matrix with the form
\begin{equation}
\mathbf{W}_j=\begin{pmatrix}
|\alpha|2\cos{(\phi_{...
3
votes
0
answers
80
views
Cost of controlled-$U_i$
What is the cost (number of gates) of $\sum_{i=0}^{N-1}| i \rangle \langle i|\otimes U_i$ in terms of $N$ and the costs of the unitaries $U_i$? Say the gate set consists of arbitrary one-qubit gates ...
9
votes
3
answers
1k
views
How can I see, without math, the action of a gate in matrix form?
Suppose we have the Fredkin gate with
$$
F=
\left( {\begin{array}{cc}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 ...