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.

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

Help with understanding Unitary Operator of Quantum Optical Fredkin Gate

I'm referring to the textbook "Quantum Computation and Quantum Information" 10th Anniversary Edition by Nielsen and Chuang. Chapter 7.4 has a Box 7.4 which introduces the Quantum Optical Fredkin Gate....
1
vote
0answers
36 views

How to implement controlled u3 gate from Qiskit using simpler gates?

I am trying to implement the u3 controlled gate (able to rotate the qubit in any specified direction in 3 dimensions if the control is 1, for two qubits) using simpler gates. The simpler gates ...
3
votes
1answer
38 views

control gate with 3 inputs, two control and rotation gate

My question is about if there is any way to represent a circuit that take 3 inputs and applies a rotation gate on the third qubit if the first two qubits is similar (has the same state)?
1
vote
1answer
31 views

Efficient implementation of exponential of projector

If I have an $n$ qubit system and a projector $P$ such as $P_0 = \left|0\right>^{\otimes n}\left<0\right|^{\otimes n}$ (as an example) on those qubits, is there an efficient way to implement the ...
7
votes
1answer
63 views

Sampling random circuits vs Solovay-Kitaev compiler

Suppose I want to obtain a gate sequence representing a particular 1 qubit unitary matrix. The gate set is represented by a discrete universal set, e.g. Clifford+T gates or $\{T,H\}$ gates. A well ...
3
votes
2answers
70 views

Calculate the square root of Euler angles

I am trying to find a nice way to represent the square root of an arbitrary single qubit unitary to implement Lemma 6.1 from this paper Given the Euler angles: $R_z(a)R_y(b)R_z(c) = \left(R_z\left(a'\...
1
vote
1answer
39 views

Approximating unitary matrices — restricted gateset

Note: This question is a follow up of Approximating unitary matrices. The decompositions provided in Approximating unitary matrices are correct and worked for me without problem. But I am now facing ...
2
votes
1answer
59 views

How to create an $n$-qubit normally controlled gate?

Suppose I have a quantum gate $U$ and it's a controlled gate. In particular, I have a $2\times 2$ matrix formulation of the gate's action on 2 adjacent qubits. How can I make this work on an $n$-bit ...
2
votes
1answer
64 views

Using Quantum Fourier Transform in adding two 2-bit numbers

I am trying to use Qiskit to write a code that uses QFT to add 2 numbers. I am referring to this paper: https://iopscience.iop.org/article/10.1088/1742-6596/735/1/012083 I have a few questions: 1) Is ...
1
vote
0answers
22 views

Controlled controlled adder gates involved

Let's say I have a circuit that given in the figure As we can see that this circuit consists of $2$-Toffoli gates and $4$ C-NOT gates, and to construct this entire circuit using only single qubit ...
6
votes
1answer
77 views

How to decompose a controlled unitary $C(U)$ operation where $U$ is a 2-qubit gate?

In the vein of this question, say I have a 2-qubit unitary gate $U$ which can be represented as a finite sequence of (say) single qubit gates, CNOTs, SWAPs, cXs, cYs and cZs. Now I need to implement a ...
5
votes
2answers
152 views

Transform matrix into a combination of simple quantum gates

I am trying to transform this matrix into a combination of quantum gates but I cannot find any such functionality on Qiskit or anywhere else. I have tried to use Quirk but I do not understand it. $$\...
5
votes
1answer
125 views

Nielsen and Chuang's proof for 'approximating arbitrary unitary gates is generically hard'

The following statement is found on the page 199 of Nielsen and Chuang's book (10th Anniversary Edition) in the proof for the fact that 'approximating arbitrary unitary gates is generically hard': ...
1
vote
0answers
59 views

Transferring classical OR gate in a quantum gate

I would be interested to know how to transform the classic OR gate into a quantum gate. I thought a little about myself. The OR gate can also be rewritten as a NAND gate: So, I have now tried to ...
3
votes
2answers
96 views

Minimal quantum OR circuit

The quantum OR circuit between $|a\rangle$ and $|b\rangle$ can be made out of 1 Toffoli and 2 CNOT gates, 1 ancillary qubit. Is there any other implementation? Or is this the minimal in the sense of ...
2
votes
1answer
40 views

Making a maximally mixed 2-qubit state in the IBM Q

I am trying to make a 2-qubit maximally mixed state $\mathbb{I}/4$ where $\mathbb{I}$ is the identity $4\times 4$ matrix. I know that, for a maximally mixed 1-qubit state I can use a Hadamard gate, ...
8
votes
2answers
324 views

How is it possible to implement unitary operator when its size is exponential in inputs?

A quantum circuit can use any unitary operator. Its matrix is exponential in the number of input bits. In practice how can this ever be possible (aside from operators which are tensor products), i.e. ...
2
votes
1answer
88 views

Implementing these $N×N$ matrices on $\log N$ qubits

Consider $n$ qubits and the $N=2^n$ states that I label \begin{equation} |k \rangle = \sum_{i=0}^{n-1} 2^i q_i, \end{equation} i.e. $|q_{n-1}\cdots q_0 \rangle \rightarrow |k\rangle$, where $q_j \in \...
0
votes
0answers
29 views

How are multi-qubit gates extended into larger registers? [duplicate]

Implementing a single-qubit gate in a multi-qubit register is relatively easy. For example, this gate: This is equivalent to $I \otimes H \otimes I$. If the $H$ gate was on the first bit, it would be ...
5
votes
2answers
155 views

Implement Fredkin gate with square root of swap

I would like to implement a Fredkin gate based on square root of swap and one-qubit gates. In particular, I was hoping to find the exact gate named "?" in this circuit: In addition, I want to avoid ...
4
votes
1answer
74 views

Rewrite circuit with measurements with unitaries

In quantum physics, because of the no-cloning theorem, lots of classical proofs of cryptographic problems cannot be turned into quantum proofs (rewinding is usually not possible quantumly). A dream ...
2
votes
1answer
64 views

Optimise implementation of a quantum algorithm when an input is fixed

I need to implement a quantum comparator that, given a quantum register $a$ and a real number $b$ known at generation time (i.e. when the quantum circuit is generated), set a qubit $r$ to the boolean ...
2
votes
1answer
146 views

Building an N-qubit Controlled S Gate

I've been beating my head against this problem for three days now and I just can't seem to crack it. To construct an N-qubit controlled Unitary gate, I can do something like this (note I'm using ...
2
votes
1answer
92 views

If CNOTs and single qubit gates are universal then why do we need to prove that controlled U operations can be composed by them as well?

In the book by Chuang and Nielsen they prove that controlled U operations can be made out of CNOTs and single qubit gates. But then they go on to prove that they are universal by showing that every n ...
2
votes
1answer
326 views

Decompose a general two-qubit gate into general controlled-qubit gates

We often seek to decompose multi-qubit unitaries into single-qubit rotations and controlled-rotations, minimising the latter or restricting to gates like CNOTs. I'm interested in expressing a general ...
2
votes
1answer
104 views

How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?

Is there a way to create a rotation gate which has half the angle of some implementable gate? I am looking to implement a gate on Quirk which allows for standard time-dependent rotations $$R_x(\...
3
votes
0answers
95 views

Decomposition of any 2-level matrix into single qubit and CNOT gates

I saw an example which takes a 2 level matrix. Which is a $8\times8$ matrix that acts non trivially only on 2 levels of only states $|000\rangle$ and $|111\rangle$. The way they do it is by using a ...
4
votes
2answers
509 views

Composing the CNOT gate as a tensor product of two level matrices

I don't understand, why is the control not gate used so often. As far as I understand it, if you apply two 2 level operations on two qubits then you get a 4 x 4 matrix by the tensor product. So how ...
1
vote
1answer
82 views

Proof that $2^n \times 2^n$ operator be decomposed in terms of $2 \times 2$ operators

What is the proof that any $2^n\times 2^n$ quantum operator can be expressed in terms of the tensor product of $n$ number of $2\times 2$ quantum operators acting on a single qubit space each?
5
votes
3answers
515 views

Is there any method of adding two operators in a circuit?

I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is $$U(t)=e^{-...
4
votes
3answers
103 views

Hadamard gate as a product of $R_x$, $R_z$ and a phase

I am having problems with this task. Since the Hadamard gate rotates a state $180°$ about the $\hat{n} = \frac{\hat{x} + \hat{z}}{\sqrt{2}}$ axis, I imagine the solution can be found the following ...
1
vote
1answer
66 views

Creating a time dependent custom gate in Quirk

I have created a $16\times 16$ unitary operator using a Hamiltonian by finding its exponential $$U=\exp(-iH\delta t)$$ If I set $\delta t=1$ then I can take this matrix and input it into quirk using ...
1
vote
1answer
122 views

Gate sequence for exponential of product of Pauli Z operators

I want to compile $$\exp(-i \theta \sigma_i^z \sigma_j^z)$$ down to a gate sequence of single qubit rotations and CNOTs. How do I do this? What is the general procedure for compiling a unitary $U$ to ...
10
votes
3answers
638 views

Approximating unitary matrices

I currently have 2 unitary matrices that I want to approximate to a good precision with the fewer quantum gates possible. In my case the two matrices are: $$G = \frac{-1}{\sqrt{2}}\begin{pmatrix} i &...
5
votes
4answers
648 views

How do I build a gate from a matrix on Qiskit?

I'm creating a gate for a project and need to test if it has the same results as the original circuit in a simulator, how do I build this gate on Qiskit? It's a 3 qubit gate, 8x8 matrix: $$ \frac{1}{...
4
votes
1answer
153 views

Construction of ${R_n(\theta)}$ using only the Hadamard and ${\pi/8}$ gates

In the "Quantum Computation and Quantum Information 10th Anniversary textbook by Nielsen & Chuang", they claim that Eqn(4.75) is a rotation about the axis along the direction ( ${cos(\pi/8)}$, ${...
3
votes
2answers
198 views

Implementing gate with two parameters using Qiskit in Python

I am trying to implement the HHL algorithm (for solving $Ax=b$). I am assuming $A$ to be unitary and Hermitian so that I can find the Hamiltonian simulation for it easily. For any $A$ to be Hermitian ...
6
votes
2answers
407 views

How to obtain Y rotation with only X and Z rotations gates?

Let's say you have a system with which you can perform arbitrary rotations around the X and Z axis. How would you then be able to use these rotations to obtain an arbitrary rotation around the Y axis? ...
5
votes
2answers
290 views

Measuring the Hamiltonian in the VQE

I am trying to implement VQE in pyQuil and am dumbfounded by how to measure the expectation value of a general Hamiltonian on $\mathbb{C}^{2^n}$ i.e. determine $\langle\psi , H \psi\rangle$ on a ...
5
votes
2answers
92 views

Clarification needed: “Simulation” of $e^{-iHt}$ and its time complexity

On page 3 here it is mentioned that: However, building on prior works [32, 36, 38] recently it has been shown in [39] that to simulate $e^{−iHt}$ for an $s$-sparse Hamiltonian requires only $\...
3
votes
0answers
70 views

Circuit to construct a $n$-qubit state which is a superposition of states with only a single qubit being $\lvert1\rangle$ [duplicate]

So the question came up in a book I am working through. Given a circuit with $n$ qubits, construct a state with only $n$ possible measurement results, each of which has only $1$ of $n$ qubits as $1$, ...
2
votes
1answer
132 views

How to construct a quantum gate producing 1 if r divides x, 0 otherwise?

If you have two registers in the state $\frac{1}{2^{n/2}} \sum_{x = 0}^{2^{n/2} - 1} |x\rangle |0\rangle$, how could you construct a gate that produces a superposition of states $|x\rangle|1\rangle$ ...
1
vote
2answers
105 views

How does the stated Pauli decomposition for $\operatorname{CP\cdot A\cdot CP}$ arise?

I'm having a bit of trouble understand @DaftWullie's answer here. I understood that the $4\times 4$ matrix $A$ $$ \frac{1}{4} \left[\begin{matrix} 15 & 9 & 5 & -3 \\ 9 & 15 & 3 &...
6
votes
2answers
368 views

Simulation vs Construction of Fredkin gate with Toffoli gates

I'm working my way through the book "Quantum computation and quantum information" by Nielsen and Chuang. (EDIT: the 10th anniversary edition). On chapter 3 (talking about reversibility of the ...
7
votes
2answers
165 views

Is there a general method to implement a 'greater than' quantum circuit?

I am interesting in finding a circuit to implement the operation $f(x) > y$ for an arbitrary value of $y$. Below is the circuit I would like to build: I use the first three qubits to encode $|x⟩$, ...
2
votes
1answer
122 views

What quantum gate is XNOR equivalent to?

The standard way to implement a reversible XOR gate is by means of a controlled-NOT gate or CNOT; this is the "standard quantum XOR operation". Physics.Stackexchange Is there a "standard quantum XNOR ...
5
votes
1answer
107 views

How can I decompose a gate into $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$?

I am working with the set $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$ where $\mathrm{H}$ is the Hadamard gate, and $\mathrm{P}(\theta)$ is the phase gate with angle $\theta$. I want to build ...
11
votes
3answers
649 views

How to derive the CNOT matrix for a 3-qbit system where the control & target qbits are not adjacent?

In a three-qbit system, it's easy to derive the CNOT operator when the control & target qbits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in the ...
5
votes
1answer
355 views

Decomposition of an arbitrary 1-qubit gate into a specific gateset

Any 1-qubit special gate can be decomposed into a sequence of rotation gates ($R_z$, $R_y$ and $R_z$). This allows us to have the general 1-qubit special gate in matrix form: $$ U\left(\theta,\phi,\...
7
votes
1answer
464 views

Decomposition of arbitrary 2 qubit operator

As you know, universal quantum computing is the ability to construct a circuit from a finite set of operations that can approximate to arbitrary accuracy any unitary operation. There also exist some ...