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.

233 questions
36
votes
5 answers

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

In a three-qubit system, it's easy to derive the CNOT operator when the control & target qubits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in the untouched qubit's position of…
ahelwer
  • 4,288
  • 2
  • 15
  • 36
34
votes
6 answers

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}{2} \begin{bmatrix} 1 & 0 & 1 & 0 & 0 & 1 & 0 & -1…
Nillmer
  • 785
  • 1
  • 5
  • 13
26
votes
1 answer

Explicit Conversion Between Universal Gate Sets

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,\textrm{c}S\}$, where $S=T^2$ and $S^2=Z$, and…
DaftWullie
  • 62,671
  • 4
  • 55
  • 140
22
votes
2 answers

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 lead you to it?
Lucas Myers
  • 323
  • 1
  • 2
  • 7
20
votes
2 answers

What is the mathematical justification for the "universality" of the universal set of quantum gates (CNOT, H, Z, X and π/8)?

In this answer I mentioned that the CNOT, H, X, Z and $\pi/8$ gates form a universal set of gates, which given in sufficient number of gates can get arbitrarily close to replicating any unitary quantum gate (I came to know about this fact from…
Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112
18
votes
1 answer

Obtaining gate $e^{-i\Delta t Z}$ from elementary gates

I am currently reading "Quantum Computation and Quantum Information" by Nielsen and Chuang. In the section about Quantum Simulation, they give an illustrative example (section 4.7.3), which I don't quite understand: Suppose we have the Hamiltonian…
17
votes
6 answers

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. . The gates that I can use are the Pauli gates…
15
votes
1 answer

How does approximating gates via universal gates scale with the length of the computation?

I understand that there is a constructive proof that arbitrary gates can be approximated by a finite universal gate set, which is the Solovay–Kitaev Theorem. However, the approximation introduces an error, which would spread and accumulate in a long…
14
votes
2 answers

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 first step was to use the C$^n$U construction given…
14
votes
2 answers

Given a decomposition for a unitary $U$, how do you decompose the corresponding controlled unitary gate $C(U)$?

Suppose we have a circuit decomposition of a unitary $U$ using some universal gate set (for example CNOT-gates and single qubit unitaries). Is there a direct way to write down the circuit of the corresponding controlled unitary $C_U$ using the same…
13
votes
3 answers

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: The square root of NOT gate (up to a global phase) $$G = \frac{-1}{\sqrt{2}}\begin{pmatrix} i…
Adrien Suau
  • 5,172
  • 22
  • 58
13
votes
1 answer

How to implement a matrix exponential in a quantum circuit?

Maybe it is a naive question, but I cannot figure out how to actually exponentiate a matrix in a quantum circuit. Assuming to have a generic square matrix A, if I want to obtain its exponential, $e^{A}$, i can use the series $$e^{A} \simeq I+…
13
votes
2 answers

Quantum XNOR Gate Construction

Tried asking here first, since a similar question had been asked on that site. Seems more relevant for this site however. It is my current understanding that a quantum XOR gate is the CNOT gate. Is the quantum XNOR gate a CCNOT gate?
user820789
  • 3,440
  • 13
  • 43
13
votes
2 answers

How can a controlled-Ry be made from CNOTs and rotations?

I want to be able to applied controlled versions of the $R_y$ gate (rotation around the Y axis) for real devices on the IBM Q Experience. Can this be done? If so, how?
James Wootton
  • 11,700
  • 1
  • 35
  • 74
12
votes
1 answer

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 known approach to solve the problem is to use…
1
2 3
15 16