Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
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 ...
user avatar
  • 3,587
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 ...
user avatar
  • 3,281
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 ...
user avatar
  • 1,775
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 ...
user avatar
  • 3,878
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 ...
user avatar
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?
user avatar
  • 1,532
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}{...
user avatar
  • 637
26 votes
2 answers
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 ...
user avatar
23 votes
1 answer
757 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,...
user avatar
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 ...
user avatar
  • 413
21 votes
3 answers
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.
user avatar
  • 737
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:...
user avatar
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 ...
user avatar
  • 397
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?
user avatar
  • 728
18 votes
2 answers
995 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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 1,775
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 ...
user avatar
  • 695
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 ...
user avatar
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 ...
user avatar
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. ....
user avatar
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 ...
user avatar
15 votes
2 answers
7k 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 ...
user avatar
  • 1,098
15 votes
1 answer
8k 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 ...
user avatar
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 ...
user avatar
15 votes
3 answers
834 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 ...
user avatar
15 votes
1 answer
903 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 ...
user avatar
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&...
user avatar
14 votes
4 answers
842 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 ...
user avatar
  • 285
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 ...
user avatar
  • 2,334
14 votes
3 answers
715 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\...
user avatar
  • 842
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 ...
user avatar
  • 255
13 votes
2 answers
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?
user avatar
  • 395
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 ...
user avatar
  • 4,467
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 ...
user avatar
  • 3,194
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 ...
user avatar
  • 11.9k
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?
user avatar
13 votes
2 answers
757 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....
user avatar
  • 11.9k
13 votes
3 answers
674 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 ...
user avatar
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 ...
user avatar
12 votes
1 answer
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. ...
user avatar
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}...
user avatar
  • 819
12 votes
1 answer
522 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 "...
user avatar
  • 18.1k
12 votes
1 answer
850 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_{\{...
user avatar
11 votes
3 answers
548 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{...
user avatar
  • 113
11 votes
1 answer
3k views

General parametrisation of an arbitrary $2\times 2$ unitary matrix?

Following is an excerpt from QCQI: I can understand that this matrix satisfies a unitary matrix. Also, intuitively, I am able to understand it. However, what is the proof that any given Unitary ...
user avatar
11 votes
2 answers
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 ...
user avatar
  • 153
11 votes
1 answer
3k views

Implementing a CCCNOT gate using only Toffoli gates

A CCCNOT gate is a four-bit reversible gate that flips its fourth bit if and only if the first three bits are all in the state $1$. How would I implement a CCCNOT gate using Toffoli gates? Assume ...
user avatar
  • 255
11 votes
2 answers
2k 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 ...
user avatar
  • 263
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 ...
user avatar

1
2 3 4 5
24