Share Your Experience: Take the 2024 Developer Survey

# Questions tagged [quantum-gate]

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

313 questions
Filter by
Sorted by
Tagged with
3k views

### How does the CNOT gate operate when the control qubit is a superposition?

If a control qubit is in superposition, how it will affect target qubit if it is collapsed or in superposition? Is it true that CNOT works only if the control bit collapsed to 1? Also, is it possible ...
3k views

### Hadamard gate as a product of $R_x$, $R_z$ and a phase

I am having problems with this task. Since the Hadamard gate rotates a state $180°$ about the $\hat{n} = \frac{\hat{x} + \hat{z}}{\sqrt{2}}$ axis, I imagine the solution can be found the following ...
• 449
577 views

### Which codes have transversal $T$ gate?

A previous post transversal P (phase) gate shows that codes where all stabilizer elements have weights that are multiple of 4 will have a transversal $P$ gate. "Transversal" seems to have ...
• 2,187
740 views

### Correct Formulation of N&C Exercise 4.11 and other textbooks misquoting

Inspired by the comments in this question How to approximate $Rx$, $Ry$ and $Rz$ gates?, there is the errata for question 4.11 pg 176 in N&C. The original form states that for any non parallel $m$ ...
• 969
261 views

### Does conjugation by a Clifford send each non-identity Pauli to every other non-identity Pauli with equal frequency?

I see here in Olivia DeMatteo's notes, she states: When we consider the action of the entire Clifford group on a single non-identity Pauli, it maps that Pauli to each of the $d^2 − 1$ other possible ...
• 1,371
382 views

### Most efficient way for general state generation

Assume we are given an $n$-qubit system and complex numbers $a_0, \ldots, a_{m-1}$ with $m = 2^n$. Assume further we start with the initial state $|0 \ldots 0\rangle$ and want to make the ...
• 171
451 views

### Decomposing a $(w+1)$-qubit permutation gate into $w$-qubit permutation gates, SWAPs and NOTs

Say I have a quantum circuit of $w+1$ qubits with a permutation gate (mapping computational basis states to computational basis states) that does the permutation $(i, i+1)(i+4, i+5)$ on $w+1$ qubits ...
• 17.6k
158 views

### Which Clifford groups are 2-designs?

Let $X$ be the $q \times q$ shift matrix sending $|y \rangle \mapsto |y+1 \rangle$ where the ket index $y=0,\dots, q-1$ is taken mod $q$. Let $Z$ be the diagonal $q \times q$ clock ...
• 4,046
773 views

• 1,586
7k views

### Making custom gate in Qiskit?

I have been trying to make a gate in qiskit in terms of the basic gates, but I keep on getting an error when I apply it to a circuit. This is my gate: ...
• 81
675 views

### How do we code the matrix for a controlled operation knowing the control qubit, the target qubit and the $2\times 2$ unitary?

Having n qubits, I want to have the unitary described a controlled operation. Say for example you get as input a unitary, an index for a controlled qubit and another for a target. How would you code ...
• 4,754
1k views

• 1,199
1k 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 ...
2k views

• 1,199
255 views

### How does quantum gate teleportation differ from state teleportation?

As described e.g. in this post, quantum gate teleportation can be framed as a variation of quantum state teleportation where a gate is applied beforehand on the receiver, and this results in the final ...
• 25.3k
1k views

### How to formulate Dynamical Decoupling passes in Qiskit to improve result upon circuit execution

First, let me say that I am not familiar with the idea of Dynamical Decoupling. The goal of this question is to understand how to set up a circuit with dynamical decoupling to improve my hardware ...
• 13.9k
1k views

### Matrix representation and CX gate [duplicate]

I am having hard time figuring out how the CX (controlled-NOT) gate is represented in the matrix representation. I understood that tensor product and the identity matrix are the keys, and I ...
• 4,987
4k views

### Why do quantum gates have to be unitary?

In my textbook, it's said the unitarity constraint is the only constraint on quantum gates. Any unitary matrix specifies a valid quantum gate! Why do quantum gates have to have to be unitary? How do ...
• 669
236 views

### Is there a higher dimensional Fredkin gate?

The Fredkin gate is CSWAP gate. Given a control register in $0$ or $1$, the gate does nothing or swaps two target registers respectively. Is there a higher dimensional version of this gate? I have ...
• 2,997
885 views

### Applying CNOT with local operations and two EPR pairs

Suppose Alice and Bob hold one qubit each of an arbitrary two-qubit state $|\psi \rangle$ that is possibly entangled. They can apply local operations and are allowed classical communication. Their ...
• 257
421 views

### How to factor the output of a CNOT acting on the input $|-,+\rangle$

I am trying to implement the Deutsch oracle in classical computer, using direction from this talk. There is this slide where they show how the CNOT gate modify 2 Hadamard transformed Qubits: While ...
• 143
I am trying to implement QAOA and there are things I don't understand at all. The expansion of $H$ into Pauli $Z$ operators can be obtained from the canonical expansion of the cost-function $C$ by ...
A transversal logical gate for an $n$ qubit code is a gate from the group of local unitaries $$\bigotimes_{i=1}^n U(2)$$ which also preserves the codespace. For an $((n,K,d))$ code we say a ...