Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
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
5 votes
2 answers
2k views

What are some open sources projects on quantum computing? [duplicate]

I am looking to collaborate on open source simulation efforts.
user avatar
5 votes
1 answer
194 views

How to implement a random selection of one of the 3 qubits on the IBM Q (composer)?

I would like to implement a quantum program on the IBM Composer with following characteristics: The output is the observed value of 3 qubits Only one of the 3 qubits should be observed as $1$, the 2 ...
user avatar
  • 1,128
7 votes
1 answer
482 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 ...
user avatar
  • 3,202
6 votes
1 answer
494 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 ...
user avatar
  • 3,202
13 votes
2 answers
623 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,202
21 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
6 votes
2 answers
395 views

How to prove that Z operator rotates points on Bloch sphere about Z axis through 180°?

My idea was to apply $Z$ operator 𝐭𝐰𝐢𝐜𝐞, which leads us back to the point where we started from, and also show that after applying the $Z$ operator just 𝐨𝐧𝐜𝐞 we are not at the same point ...
user avatar
7 votes
1 answer
939 views

How to apply single and two qubit gates to 2 qubits multiple times?

Let's say we have the following quantum circuit: Let's say we input the state $|00\rangle$ . Both of the $H$ gates produce the output $1/\sqrt{2}$, but which one of the following $2$ vectors is the ...
user avatar
15 votes
1 answer
9k 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
6 votes
1 answer
378 views

How to implement a Square root of Swap gate that swaps 2n-qubits on the IBM Q (composer)?

I am looking for an implementation using the quantum gates provided by the IBM composer of the following quantum function: input $2n$ qubits output $2n$ qubits wherein $50\%$ of the cases the state ...
user avatar
  • 1,128
16 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,128
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
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?
user avatar
  • 1,128
14 votes
3 answers
760 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
11 votes
3 answers
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 ...
user avatar
  • 842
27 votes
3 answers
9k 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,562
5 votes
1 answer
167 views

Conditional Phase Gate Superconducting Qubits

In the paper "Demonstration of two-qubit algorithms with a superconducting quantum processor" (L. DiCarlo et al., Nature 460, 240 (2009), arXiv) they demonstrate how to realize conditional phase gates ...
user avatar
  • 263
7 votes
2 answers
477 views

Why is the decomposition of a qubit-qutrit Hamiltonian in terms of Pauli and Gell-Mann matrices not unique?

If I have the $X$ gate acting on a qubit and the $\lambda_6$ gate acting on a qutrit, where $\lambda_6$ is a Gell-Mann matrix, the system is subjected to the Hamiltonian: $\lambda_6X= \begin{pmatrix}0 ...
user avatar
11 votes
1 answer
3k 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?
user avatar
7 votes
1 answer
71 views

How to avoid error when applying certain combinations of degree of freedom rotations using a quantum circuit?

When applying each of the six degree of freedom rotations (or certain combinations of them) in an SO(4) using quantum gates, the results I expected are produced. For example, the following circuit in ...
user avatar
13 votes
3 answers
699 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
8 votes
2 answers
770 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 $$\...
user avatar
19 votes
4 answers
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 ...
user avatar
  • 397
5 votes
1 answer
890 views

What exactly is a phase vector?

The following $2\times 2$ matrix $$ P = \begin{bmatrix} e^{i\theta} & 0 \\ 0 & e^{i\phi} \end{bmatrix} $$ represents a quantum gate because it's a unitary matrix. If we multiply $P$ by ...
user avatar
16 votes
1 answer
956 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
  • 1,019
4 votes
2 answers
213 views

What can I deduce about $f(x)$ if $f$ is balanced or constant?

$\newcommand{\qr}[1]{|#1\rangle}$Question. Can you check whether this is correct? Also, given the analysis below, what is the domain of and co-domain of $f(\qr{x})$? I think it is $V^4 \to W^4 : f$ ...
user avatar
  • 1,179
10 votes
1 answer
666 views

What happens if two separately entangled qubits are passed through a C-NOT gate?

Suppose I transform a state as follows: I start with the state $\lvert 0\rangle \otimes \lvert0\rangle \otimes \lvert0\rangle \otimes \lvert 0 \rangle$. I entangle the 1st and 2nd qubits (with an H ...
user avatar
10 votes
1 answer
425 views

How do you apply a CNOT on polarization qubits?

I read that a qubit can be encoded in a polarization state (horizontal or vertical polarization of a photon). How do you perform two-qubit operations on a polarization qubit?
user avatar
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,815
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
44 votes
4 answers
11k 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,647
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,815
15 votes
1 answer
945 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
879 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
4 votes
2 answers
250 views

Processing density capabilities in a quantum processor

Given the theoretical infinite quantum states that a qbit can be expressed as is there any practical limit to the processing density in any given quantum processor as compared to the absolute limits ...
user avatar
10 votes
2 answers
496 views

Does quantum control allow to implement any gate?

Using quantum control techniques it is possible to control quantum systems in a wide range of different scenarios (e.g. 0910.2350 and 1406.5260). In particular, it was shown that using these ...
user avatar
  • 19k
17 votes
1 answer
974 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
6 votes
0 answers
241 views

What is the difference between quantum control and quantum optimal control?

In the context of quantum control theory, it is common to see references to both quantum control and quantum optimal control (e.g. 0910.2350 or the guide on qutip quantrum control functions). ...
user avatar
  • 19k
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,363
7 votes
2 answers
107 views

Symmetry of tensor product w.r.t. Vazirani 2-qubit video

Quantum Computing (QC) pioneer Vazirani has graciously long provided some nice videos on an intro to QC. E.g. in "2 qubit gates + tensor product" (2014) he introduces the tensor product w.r.t. QC ...
user avatar
  • 255
18 votes
2 answers
1k 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
29 votes
1 answer
10k 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
12 votes
1 answer
533 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
  • 19k
8 votes
2 answers
2k views

How does evolving a two-qubit state through a CNOT gate entangle them?

Reading into CNOT gate I understand that, mathematically, such a gate entangles the control qubit and the target. (the resulting state is $\frac{1}{\sqrt 2}(|00\rangle+|11\rangle)$) However, looking ...
user avatar
  • 695
8 votes
1 answer
221 views

New algorithm for faster QC simulation by IBM

This new algorithm for QC calculation was introduced recently (2017 4Q) by IBM/ Pednault et al. to great fanfare. The paper seems more couched in the language of physics. Are there any basic ...
user avatar
  • 255
27 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
12 votes
1 answer
890 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
36 votes
8 answers
5k 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,341
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