# 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.

123 questions
Filter by
Sorted by
Tagged with
1answer
88 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 ...
1answer
145 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 ...
1answer
315 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 ...
0answers
59 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 ...
1answer
327 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 ...
2answers
467 views

1answer
191 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 ...
2answers
2k 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 ...
1answer
95 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?
3answers
911 views

1answer
362 views

0answers
89 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$, ...
1answer
140 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$ ...
2answers
236 views

1answer
1k 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 ...
1answer
622 views

I'm interested in the conversion between different sets of universal gates. For example, it is known that each of the following sets is universal for quantum computation: $\{T,H,\textrm{cNOT}\}$ $\{H,... 2answers 947 views ### Automatic compilation of quantum circuits A recent question here asked how to compile the 4-qubit gate CCCZ (controlled-controlled-controlled-Z) into simple 1-qubit and 2-qubit gates, and the only answer given so far requires 63 gates! The ... 6answers 7k views ### How to construct a multi-qubit controlled-Z from elementary gates? For the implementation of a certain quantum algorithm, I need to construct a multi-qubit (in this case, a three-qubit) controlled-Z gate from a set of elementary gates, as shown in the figure below. .... 2answers 405 views ### Minimum number of CNOTs for Toffoli with non-adjacent controls I want to decompose a Toffoli gate into CNOTs and arbitrary single-qubit gates. I want to minimize the number of CNOTs. I have a locality constraint: because the Toffoli is occurring in a linear array,... 2answers 5k views ### How do you implement the Toffoli gate using only single-qubit and CNOT gates? I've been reading through "Quantum Computing: A Gentle Introduction", and I've been struggling with this particular problem. How would you create the circuit diagram, and what kind of reasoning would ... 2answers 463 views ### How do we code the matrix for a controlled operation knowing the control qubit, the target qubit and the$2\times 2\$ unitary?

Having n qubits, I want to have the unitary described a controlled operation. Say for example you get as input a unitary, an index for a controlled qubit and another for a target. How would you code ...