Questions tagged [quantum-gate]
For questions regarding usage, performance, implementation, application or theory related to quantum gates.
1,580
questions
46
votes
4
answers
13k
views
How do I add 1+1 using a quantum computer?
This can be seen as the software complement to How does a quantum computer do basic math at the hardware level?
The question was asked by a member of the audience at the 4th network of the Spanish ...
38
votes
2
answers
6k
views
What is quantum gate teleportation?
Quantum state teleportation is the quantum information protocol where a qubit is transferred between two parties using an initial shared entangled state, Bell measurement, classical communication and ...
37
votes
8
answers
6k
views
If all quantum gates must be unitary, what about measurement?
All quantum operations must be unitary to allow reversibility, but what about measurement? Measurement can be represented as a matrix, and that matrix is applied to qubits, so that seems equivalent to ...
34
votes
1
answer
13k
views
How are quantum gates implemented in reality?
Quantum gates seem to be like black boxes. Although we know what kind of operation they will perform, we don't know if it's actually possible to implement in reality (or, do we?). In classical ...
33
votes
5
answers
9k
views
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 ...
30
votes
6
answers
12k
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}{...
28
votes
4
answers
11k
views
How can I implement an n-bit Toffoli gate?
I want to create a Toffoli gate controlled by n qubits, and implement it in QISKit. Can this be done? If so, how?
27
votes
2
answers
2k
views
Why is it important to eliminate the garbage qubits?
Most reversible quantum algorithms use standard gates like Toffoli gate (CCNOT) or Fredkin gate (CSWAP). Since some operations require a constant $\left|0\right>$ as input and the number ...
26
votes
3
answers
7k
views
What are magic states?
I wonder what are magic states, and a magic state gadget. While I'm reading a paper, these terms frequently appear.
26
votes
1
answer
1k
views
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,...
23
votes
1
answer
6k
views
How to interpret a quantum circuit as a matrix?
If a circuit takes more than one qubit as its input and has quantum gates which take different numbers of qubits as their input, how would we interpret this circuit as a matrix?
Here is a toy example:...
22
votes
3
answers
9k
views
How to calculate circuit depth properly?
Is the circuit depth the longest sequence of gates applied on one of the qubits?
Or is it something more complicated?
22
votes
3
answers
3k
views
Toffoli gate as FANOUT
I was searching for examples of quantum circuits to exercise with Q# programming and I stumbled on this circuit:
From: Examples of Quantum Circuit Diagrams
- Michal Charemza
During my introductory ...
21
votes
4
answers
3k
views
Why are quantum gates unitary and not special unitary?
Given that the global phases of states cannot be physically discerned, why is it that quantum circuits are phrased in terms of unitaries and not special unitaries? One answer I got was that it is just ...
19
votes
2
answers
13k
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 ...
19
votes
2
answers
1k
views
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 ...
18
votes
4
answers
10k
views
Implementing "Classical AND Gate" and "Classical OR Gate" with a quantum circuit
Quantum cNOT Gate (Classical XOR Gate)
A "Controlled NOT (cNOT) Gate" flips the 2nd qubit if the 1st qubit is $\left|1\right>$, and returns the 2nd qubit as-is if the 1st qubit is $\left|0\right&...
18
votes
2
answers
9k
views
How to implement the 4 Bell states on the IBM Q (composer)?
I would like to simulate the 4 "Bell States" on the IBM composer?
How can I best implement those 4 Bell states using the existing set of gates ?
Here below you see the definition of the 4 Bell ...
18
votes
1
answer
3k
views
If quantum gates are reversible how can they possibly perform irreversible classical AND and OR operations?
Quantum gates are said to be unitary and reversible. However, classical gates can be irreversible, like the logical AND and logical OR gates. Then, how is it possible to model irreversible classical ...
17
votes
2
answers
2k
views
Do multi-qubit measurements make a difference in quantum circuits?
Consider the unitary circuit model of quantum computation. If we need to generate entanglement between the input qubits with the circuit, it must have multi-qubit gates such as CNOT, as entanglement ...
17
votes
4
answers
2k
views
How do the probabilities of each state change after a transformation of a quantum gate?
Quantum gates are represented by matrices, which represent the transformations applied to qubits (states).
Suppose we have some quantum gate which operates on $2$ qubits.
How does the quantum gate ...
17
votes
1
answer
1k
views
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 ...
17
votes
1
answer
1k
views
How are gates implemented in a continuous-variable quantum computer?
I've mostly worked with superconducting quantum computers I am not really familiar with the experimental details of photonic quantum computers that use photons to create continuous-variable cluster ...
16
votes
6
answers
12k
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.
....
15
votes
3
answers
10k
views
How to construct matrix of regular and "flipped" 2-qubit CNOT?
When constructing the matrices for the two CNOT based on the target and control qubit, I can use reasoning:
"If $q_0$==$|0\rangle$, everything simply passes through", resulting in an Identity matrix ...
15
votes
4
answers
941
views
What is the opposite of measurement, in a quantum circuit?
My understanding is that at the level of quantum mechanics, almost all operations are reversible in time. Most gates in a quantum circuit clearly obey this rule; they can be reversed by applying some ...
15
votes
1
answer
11k
views
How to input 2 qubits in 2 Hadamard gates?
Let's say we have a circuit with $2$ Hadamard gates:
Let's take the $|00\rangle$ state as input. The vector representation of $|00\rangle$ state is $[1 \ 0 \ 0 \ 0]$, but this is the representation ...
15
votes
3
answers
1k
views
What is the quantum circuit equivalent of a (delayed choice) quantum eraser?
Quantum computers are efficiently able to simulate any other quantum system. Hence there must be some sort of equivalent of a (possibly simulated) quantum eraser setup. I would like to see such an ...
15
votes
1
answer
1k
views
Why do we use the standard gate set that we do?
The typically used gate set for quantum computation is composed of the single qubits Cliffords (Paulis, H and S) and the controlled-NOT and/or controlled-Z.
To go beyond Clifford we like to have full ...
15
votes
1
answer
3k
views
Why are non-Clifford gates more complex than Clifford gates?
There are two groups of quantum gates - Clifford gates and non-Clifford gates.
Representatives of Clifford gates are Pauli matrices $I$, $X$, $Y$ and $Z$, Hadamard gate $H$, $S$ gate and $CNOT$ gate. ...
15
votes
2
answers
1k
views
State of the art gate speeds and decoherence times
I am interested in the state of the art gate speeds and decoherence times for the qubit types I know are being pursued by companies presently:
superconducting qubits,
ion trap qubits,
photonic qubits....
14
votes
3
answers
2k
views
Is swap gate equivalent to just exchanging the wire of the two qubits?
Is swap gate equivalent to just exchanging the wire of the two qubits?
if yes why not just switching the wire whenever we want to apply a swap gate?
14
votes
2
answers
4k
views
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 ...
14
votes
3
answers
1k
views
How to think about the Z gate in a Bloch sphere?
I am confused about how to understand the $Z$ gate in a Bloch sphere.
Considering the matrix $Z = \begin{pmatrix}
1 & 0 \\
0 & -1
\end{pmatrix}$ it is understandable that $Z|0\rangle = |0\...
14
votes
1
answer
4k
views
General parametrisation of an arbitrary $2 \times 2$ unitary matrix
From Nielsen & Chuang's Quantum Computation and Quantum Information (QCQI):
Since $U$ is unitary, the rows and columns of $U$ are orthonormal, form which it follows that there exist real numbers $...
14
votes
2
answers
3k
views
How to prove/disprove universality for a set of gates?
A universal set of gates are able to mimic the operation of any other gate type, given enough gates. For example, a universal set of quantum gates are the Hadamard ( $H$ ), the $\pi/8$ phase ...
13
votes
3
answers
2k
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:
The square root of NOT gate (up to a global ...
13
votes
2
answers
4k
views
How and why does swap test works?
I am having some trouble understanding why a SWAP test would work. I meant I read that and understood the concepts as follows:
If the two input states are equal, the output register always results
in ...
13
votes
3
answers
800
views
Superposition of quantum circuits
Given a quantum circuit $C_1$ that generates a state $\vert\psi\rangle$ and another circuit $C_2$ that generates $\vert\phi\rangle$, is there a way to construct a circuit that outputs
$$\frac{1}{\sqrt{...
13
votes
2
answers
754
views
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 ...
13
votes
2
answers
1k
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 ...
13
votes
2
answers
1k
views
How do you rotate a Fock state qubit?
I read that a qubit can be encoded in a Fock state, such as the presence or absence of a photon. How do you perform single qubit rotations on Fock states?
13
votes
3
answers
798
views
Is acting with a positive map on a state not part of a larger system allowed?
In the comments to a question I asked recently, there is a discussion between user1271772 and myself on positive operators.
I know that for a positive trace-preserving operator $\Lambda$ (e.g. the ...
12
votes
1
answer
2k
views
Are circuits with more than 1000 gates common?
I have seen circuits with 30 qubits and around 500 gates. Also circuits with 32 qubits and 6000 gates. Are circuits with more than 1000 gates common in quantum computing? Are there many quantum ...
12
votes
3
answers
3k
views
How to approximate $Rx$, $Ry$ and $Rz$ gates?
Quantum Inspire is a quantum computing platform provided by QuTech. It consists of two real quantum processors - Starmon-5 and Spin-2. Whereas it is possible to use rotation gates $Rx$, $Ry$ and $Rz$ ...
12
votes
2
answers
447
views
What are the possible non-entangling two-qubit gates?
The non-entangling gates in $ SU_4 $ contains the entire group of gates of the form
$$
SU_2 \otimes SU_2.
$$
It also contains
$$
\zeta_8 SWAP= \zeta_8 \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 &...
12
votes
2
answers
640
views
How are elementary quantum gates realised?
When expressing computations in terms of a quantum circuit, one makes use of gates, that is, (typically) unitary evolutions.
In some sense, these are rather mysterious objects, in that they perform "...
12
votes
1
answer
2k
views
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}...
12
votes
2
answers
977
views
Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate set
I was recently going through the paper titled "Quantum supremacy using a programmable superconducting processor" by NASA Ames Research Centre and the Google Quantum AI team (note that the paper was ...
12
votes
1
answer
1k
views
How does Fourier sampling actually work (and solve the parity problem)?
I'm writing with respect to part I and part II of the Fourier sampling video lectures by Professor Umesh Vazirani.
In part I they start with:
In the Hadamard Transform:
$$|0...0\rangle \to \sum_{\{...