Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
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 ...
33
votes
2answers
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 ...
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 ...
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 ...
26
votes
2answers
1k 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 ...
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 ...
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?
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}{...
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 ...
22
votes
1answer
695 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,...
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:...
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 ...
18
votes
3answers
3k 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.
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 ...
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?
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 ...
16
votes
2answers
1k 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 ...
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 ...
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. ....
15
votes
2answers
6k 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 ...
15
votes
4answers
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 ...
15
votes
2answers
857 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 ...
15
votes
1answer
884 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
3answers
774 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
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 ...
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 ...
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&...
14
votes
4answers
822 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 ...
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 ...
13
votes
2answers
1k 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?
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 ...
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 ...
13
votes
3answers
642 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\...
13
votes
2answers
2k 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
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 ...
13
votes
2answers
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
2answers
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
2answers
674 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....
13
votes
3answers
634 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
1answer
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
1answer
2k 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. ...
12
votes
1answer
755 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_{\{...
12
votes
1answer
506 views

How are quantum gates realised, in terms of the dynamic?

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 "...
11
votes
2answers
1k views

How to create quantum circuits from scratch

I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak. Getting through the earlier chapters and exercises went ...
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}...
11
votes
2answers
1k views

Rotating about the y- or z-axis of the Bloch sphere

In order to rotate about an axis of the Bloch sphere we ususally use pulses e.g. in trapped ion quantum computing or superconducting qubits. Let's say we have rotation around the x-axis. What do I ...
11
votes
2answers
742 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 ...
11
votes
1answer
2k views

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?
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 ...
10
votes
2answers
2k 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 ...

1
2 3 4 5
22