Questions tagged [quantum-gate]
For questions regarding usage, performance, implementation, application or theory related to quantum gates.
228
questions
30
votes
5
answers
5k
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 ...
26
votes
3
answers
8k
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?
9
votes
3
answers
2k
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$ ...
43
votes
4
answers
10k
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 ...
14
votes
2
answers
3k
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 ...
11
votes
2
answers
777
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 ...
7
votes
2
answers
385
views
Arbitrary powers of NOT and SWAP
The square-root of not and square-root of swap gates are often singled out for discussion of gates displaying important properties relating to quantum computers.
How do I define arbitrary (non-...
4
votes
1
answer
437
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 ...
13
votes
2
answers
599
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 ...
20
votes
1
answer
5k
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:...
15
votes
3
answers
7k
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 ...
6
votes
3
answers
421
views
Can I find the axis of rotation for any single-qubit gate?
Suppose I have an arbitrary qiskit $U_3$ gate: $U_3(\theta,\phi,\lambda)$. Is there a way I can find which axis the gate is rotating around? In other words, given any real numbers $\theta,\phi,\lambda$...
6
votes
1
answer
476
views
Quantum Ripple Carry Adder Construction
There is an excellent answer to How do I add 1+1 using a quantum computer? that shows constructions of the half and full adders. In the answer, there is a source for the QRCA. I have also looked at ...
8
votes
1
answer
456
views
Understanding the Group Leaders Optimization Algorithm
Context:
I have been trying to understand the genetic algorithm discussed in the paper Decomposition of unitary matrices for finding quantum circuits: Application to molecular Hamiltonians (Daskin &...
7
votes
1
answer
471
views
Quantum XOR Linked List Construction
After getting help here with XNOR & RCA gates I decided to dive into XOR Swaps & XOR linked lists. I was able to find this explanation for quantum XOR Swapping which seems sufficient for the ...
4
votes
1
answer
224
views
Help Identifying a Gate In Nielsen and Chuang
I am seeking help to identify the oracle gates listed in this example. I understand that the right-most one is a toffoli gate, but what are the other ones? Specifically, I do not understand what a ...
3
votes
1
answer
1k
views
How is the no-cloning theorem compatible with the fact that fan-out gates work?
I have some difficulty with understanding no-cloning theorem. Simply speaking, according to the theorem, it is not possible to copy a quantum state.
On the other hand, CNOT gate can be used as so-...
9
votes
2
answers
3k
views
Expressing "Square root of Swap" gate in terms of CNOT
How could a $\sqrt{SWAP}$ circuit be expressed in terms of CNOT gates & single qubit rotations?
CNOT & $\sqrt{SWAP}$ Gates
Any quantum circuit can be simulated to an arbitrary degree of ...
36
votes
8
answers
4k
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 ...
26
votes
6
answers
9k
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}{...
17
votes
1
answer
933
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 ...
6
votes
1
answer
651
views
Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): sampling
In Google's 54 qubit Sycamore processor, they created a 53 qubit quantum circuit using a random selection of gates from the set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$ in the following pattern:
...
15
votes
2
answers
8k
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 ...
8
votes
1
answer
996
views
Practical implementation of Hamiltonian Evolution
Following from this question, I tried to look at the cited article in order to simulate and solve that same problem... without success. Mainly, I still fail to understand how the authors managed to ...
9
votes
3
answers
3k
views
How to implement the "Square root of Swap gate" on the IBM Q (composer)?
I would like to simulate a quantum algorithm where one of the steps is "Square root of Swap gate" between 2 qubits.
How can I implement this step using the IBM composer?
35
votes
2
answers
5k
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 ...
28
votes
1
answer
9k
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 ...
19
votes
4
answers
2k
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
3
answers
6k
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?
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}...
8
votes
1
answer
851
views
Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 2): simplifiable and intractable tilings
In Google's 54 qubit Sycamore processor, they created a 53 qubit quantum circuit using a random selection of gates from the set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$ in the following pattern:
...
18
votes
1
answer
2k
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 ...
8
votes
2
answers
714
views
Is the Kraus representation of a quantum channel equivalent to a unitary evolution in an enlarged space?
I understand that there are two ways to think about 'general quantum operators'.
Way 1
We can think of them as trace-preserving completely positive operators. These can be written in the form
$$\...
7
votes
1
answer
859
views
Physical implementation of gates on IBM Q
There is a lot of quantum gates in IBM Q Composer, however, only few are implemented physically while others can be composed of them.
When one looks at description of a quantum processor in IBM Q ...
3
votes
1
answer
594
views
How to perform Quantum Process Tomography for three qubit gates?
I am trying to perform Quantum process tomography (QPT) on three qubit quantum gate. But I cannot find any relevant resource to follow and peform the experiment. I have checked Nielsen and Chuang's ...
22
votes
3
answers
2k
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 ...
7
votes
1
answer
184
views
Is the Clifford group a semidirect product?
This is from
Is the Clifford group finite?
"Define the Clifford group $ \mathrm{Cl}_n(p) $ of n qudits of prime dimension p as the unitary normaliser of the generalised Pauli group.
Define the ...
6
votes
2
answers
157
views
Can we rotate Bloch vectors for qudits like we do with qubits in the Bloch sphere?
I have been looking into the Bloch vectors for qudits and have been wondering if we can do rotations that are similar to the rotations in the qubit Bloch sphere.
Like, once we create a Bloch vector ...
15
votes
1
answer
931
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 ...
7
votes
1
answer
2k
views
What are theta, phi and lambda in cu1(theta, ctl, tgt) and cu3(theta, phi, lam, ctl, tgt)? What are the rotation matrices being used?
I was reading the documentation for qiskit.QuantumCircuit and came across the functions cu1(theta, ctl, tgt) and ...
4
votes
1
answer
125
views
What exactly is the reason why the Abrams - Lloyd algorithm does not allow implementation using unitary gates and ancillary qubits?
In their original paper (last part of the paper), Abrams and Lloyd present a quantum algorithm that could potentially efficiently solve NP complete problems (in linear time). Their algorithm, robust ...
4
votes
1
answer
461
views
Why is the action of controlled-Z unaltered by exchanging target control qubits?
In the book "Quantum Computer Science", when explaining the error correction code, it uses this picture and says "the action of controlled-z is unaltered by exchanging the target and ...
3
votes
3
answers
951
views
How to implement the controlled square root of NOT gate on the IBM Q composer?
I already know how to do that for Z, Y, and H gates. How can I make a controlled sqrt-of-NOT gate? I mean the controlled version of the gate described here.
4
votes
1
answer
808
views
Simpler implementation of the Toffoli gate on IBM Q for special circumstances
On current quantum hardware, a depth of circuit is constrained because of noise. In some cases, results are totally decoherent and as a result meaningless. This is especially true when Toffoli gates ...
3
votes
3
answers
1k
views
Show that a $CZ$ gate can be implemented using a $CNOT$ gate and Hadamard gates
Show that a $CZ$ gate can be implemented using a $CNOT$ gate and Hadamard gates and write down the corresponding circuit.
Recall from Quantum Information Theory that $Z=HXH$. As $CNOT$ is a ...
14
votes
4
answers
6k
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&...
7
votes
1
answer
1k
views
How to reduce circuit elements of a decomposed $C^2(U)$ operation?
This question refers to Nielsen and Chuang's Exercise 4.22:
Prove that a $C^2(U)$ gate (for any single-qubit unitary U) can be
constructed using at most eight one-qubit gates, and six controlled-not ...
15
votes
6
answers
9k
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.
....
9
votes
2
answers
2k
views
What is the relation between these two forms of a single-qubit unitary operation?
I want to understand the relation between the following two ways of deriving a (unitary) matrix that corresponds to the action of a gate on a single qubit:
1) HERE, in IBM's tutorial, they ...
13
votes
3
answers
1k
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 ...