# Questions tagged [quantum-gate]

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

315 questions
Filter by
Sorted by
Tagged with
11k 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 ...
• 4,138
5k 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.6k
14k 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 ...
• 3,827
1k 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$...
• 2,398
12k 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?
• 1,632
5k 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 ...
• 2,457
1k 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 ...
• 17.6k
2k views

### How to interpret a 4 qubit quantum circuit as a matrix?

This is part of Simon Algorithm (Initial state + some Oracle function) There is a post that explains how to interpret circuits (How to interpret a quantum circuit as a matrix?), but I'm not sure how ...
2k 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-...
• 14.6k
855 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 ...
• 3,312
895 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-...
• 59.3k
1k 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 ...
1k 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 ...
• 887
7k 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 ...
• 1,985
7k 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:...
• 2,195
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 ...
• 437
16k 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 ...
• 293
12k views

• 603
3k 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 ...
• 495
1k 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 \...
1k 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 ...
• 879
2k 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 ...
• 14.6k
4k 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 ...
• 305
529 views

### Building a state with parallel execution

I'm trying to implement the main algorithm described in the Quantum Recommendation Systems paper. In order to do this, I have to create a quantum state $|x\rangle$ corresponding to a real vector ...
• 6,702
555 views

### How does one create the unitary sending $|0\rangle$ into a target quantum state?

The Hadamard gate allows us to construct an equal superposition of states. If one wants to construct an arbitrary superposition e.g. $\alpha\vert 0\rangle + \beta\vert 1\rangle + ..$, how does one ...
• 33
3k views

### Qiskit CNOT-gate matrix mixup?

In the qiskit textbook chapter 1.3.1 "The CNOT-Gate" it says that the matrix representation on the right is the own corresponding to the circuit shown above, with q_0 being the control and ...
• 23
14k 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 ...
• 17.6k
4k 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 ...
• 413
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.6k
14k 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. ....
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 ...
• 11.3k
2k views

• 2,346