Questions tagged [quantum-gate]

For questions regarding usage, performance, implementation, application or theory related to quantum gates.

Filter by
Sorted by
Tagged with
24
votes
3answers
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?
28
votes
5answers
4k 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 ...
9
votes
3answers
1k 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$ ...
14
votes
2answers
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
2answers
741 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 ...
4
votes
1answer
287 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
2answers
547 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 ...
40
votes
4answers
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 ...
20
votes
1answer
4k 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:...
14
votes
3answers
6k 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
3answers
289 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
1answer
437 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 ...
7
votes
1answer
442 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 ...
3
votes
1answer
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-...
8
votes
1answer
437 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 &...
4
votes
1answer
194 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 ...
24
votes
6answers
7k 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}{...
16
votes
1answer
886 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
1answer
623 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: ...
8
votes
1answer
962 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
3answers
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?
8
votes
2answers
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 ...
25
votes
1answer
8k 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 ...
31
votes
8answers
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 ...
19
votes
4answers
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 ...
16
votes
3answers
5k 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?
11
votes
1answer
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
1answer
787 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: ...
17
votes
1answer
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 ...
7
votes
1answer
638 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
1answer
534 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
3answers
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 ...
13
votes
2answers
7k 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 ...
7
votes
2answers
318 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-...
15
votes
1answer
882 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
1answer
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
1answer
272 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
1answer
102 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 ...
3
votes
3answers
841 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
1answer
741 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
3answers
654 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
4answers
5k 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&...
15
votes
6answers
8k 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
2answers
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
3answers
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 ...
8
votes
2answers
627 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 $$\...
15
votes
1answer
846 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 ...
4
votes
2answers
1k views

How to decompose this two-qubit unitary matrix to the standard gate set?

I have read some of the other decomposition questions here however still don't understand how to do it manually. The matrix I wish to decompose is the following for 2 qubits: $M=\frac{1}{\sqrt2}\...
16
votes
2answers
7k 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 ...
11
votes
3answers
2k views

Implementation of the oracle of Grover's algorithm on IBM Q using three qubits

I am trying to get used to IBM Q by implementing three qubits Grover's algorithm but having difficulty to implement the oracle. Could you show how to do that or suggest some good resources to get ...

1
2 3 4 5