Skip to main content
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.

Filter by
Sorted by
Tagged with
7 votes
1 answer
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 ...
Olexander Korenyuk's user avatar
7 votes
3 answers
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 ...
QCQCQC's user avatar
  • 449
7 votes
2 answers
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 ...
unknown's user avatar
  • 2,187
7 votes
1 answer
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$ ...
Sam Palmer's user avatar
7 votes
1 answer
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 ...
Quantum Guy 123's user avatar
7 votes
1 answer
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 ...
tobias's user avatar
  • 171
7 votes
1 answer
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 ...
Sanchayan Dutta's user avatar
7 votes
1 answer
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 ...
Ian Gershon Teixeira's user avatar
7 votes
1 answer
773 views

Are anti-unitary gates possible?

According to Wigner’s theorem, every symmetry operation must be represented in quantum mechanics by an unitary or an anti-unitary operator. To see this, we can see that given any two states $|\psi\...
Mauricio's user avatar
  • 2,336
6 votes
2 answers
437 views

How to implement the CCH gate in quantum computers available in clouds?

How to implement CCH gate in quantum computers available in clouds? If there is not any gate directly available for it, what are the possible ways to represent CCH?
Ankit Raj's user avatar
6 votes
0 answers
124 views

Is the universality of a qubit based quantum computer different from the universality of a continuous-variable quantum computer?

I understand that a quantum computer is universal if it can compute anything that a quantum Turing machine can. Another way to think about universality is that any unitary transformation on, e.g., a ...
Kiro's user avatar
  • 1,985
6 votes
2 answers
1k views

Why can the CNOT representation $e^{i\frac{\pi}{4}\left(I-Z\right)\otimes\left(I-X\right)}$ hardly be found in books?

The CNOT gate is usually written as $|0\rangle\langle0|\otimes I + 1\rangle\langle1|\otimes X$ (with $X,Y,Z$ being the Pauli Basis and $I$ the Identity). I have yet to stumble across the ...
manuel459's user avatar
  • 211
6 votes
1 answer
451 views

Is there a non-Clifford gate preserving both $X$ and $Z$ errors?

I would like to know if there exists an $n$-qubit (for $n \geq 2$) quantum gate $G_n$ that preserves both $X$ and $Z$ errors and that is additionnally non-Clifford. In other words, I would like that $...
Marco Fellous-Asiani's user avatar
6 votes
2 answers
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: ...
Tech333's user avatar
  • 81
6 votes
2 answers
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 ...
cnada's user avatar
  • 4,754
6 votes
2 answers
1k views

How to construct the two qubit gate generated by the Hamiltonian $H= X\otimes X + Y \otimes Y + Z \otimes Z $?

I know that the two qubit gate generated by $H=X\otimes X$ is $\exp\{-\text{i}\theta X\otimes X\}=\cos{\theta} \mathbb1 \otimes \mathbb1 - \text{i} \sin{\theta} X \otimes X$, where $X$ is the $\...
Nehad's user avatar
  • 81
6 votes
2 answers
1k views

What are the transversal gates of Shor's $[\![9,1,3]\!]$ code?

What are the transversal gates of Shor's $ [\![9,1,3]\!] $ code? Since this is a stabilizer code we have transversal Pauli gates. Indeed, transversal $X^{\otimes 9}$ implements logical $\overline Z$ ...
Ian Gershon Teixeira's user avatar
6 votes
1 answer
699 views

How to check if a two-qubit gate is entangling?

I would like to know if there's an analog for Schmidt rank that can tell me if a two-qubit unitary is entangling? Suppose I have a parametrized two-qubit unitary $U^{(2)}(\theta)$. I would like to ...
forky40's user avatar
  • 7,103
6 votes
2 answers
446 views

If an auxiliary qubit is allowed, how to construct toffoli gate in easier way?

We know if we don't use auxiliary, the construction of Toffoli gate will be: However, if now you are allowed to use one auxiliary qubit, how to realize a CCNOT in a simplier way? (Can we only use X,Y,...
Dingshan Liu's user avatar
6 votes
2 answers
899 views

Custom gates on IBM Q

I realized that QASM supports custom gates. However, when I tried to create the gate, transpiling error appeared both on simulator and real quantum processor. I suspect that IBM has not implemented ...
Martin Vesely's user avatar
6 votes
2 answers
557 views

Partial trace and SWAP in the basis of subsystems

I'm trying to derive equation $(1)$ on p.2 in Lloyd et al, 2013 which reads $$ \text{Tr}_A\left[\exp(-i\theta S_{AB}) (\rho_A \otimes \sigma_B) \exp(i\theta S_{AB}) \right] = (\cos^2 \theta) \sigma_B +...
forky40's user avatar
  • 7,103
6 votes
1 answer
747 views

Decomposition of any 2-level matrix into single qubit and CNOT gates

I saw an example which takes a 2 level matrix. Which is a $8\times8$ matrix that acts non trivially only on 2 levels of only states $|000\rangle$ and $|111\rangle$. The way they do it is by using a ...
bilanush's user avatar
  • 881
6 votes
1 answer
344 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). ...
glS's user avatar
  • 25.3k
6 votes
2 answers
697 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 ...
Archil Zhvania's user avatar
6 votes
1 answer
508 views

How does a $2 \pi$ pulse in Cirac Zoller give a -1 sign to the state?

I understand the first step in the Cirac-Zoller controlled-phase gate; about how to move the state from the electronic state to the vibrational mode state. However, I am unable to understand how a $2\...
Tech Solver's user avatar
6 votes
1 answer
183 views

Implementation of filter operation

If I want to implement the measurement operation corresponding to filtering, i.e. $$ M_1=\left(\begin{array}{cc}1 & 0 \\ 0 & \alpha \end{array}\right)\qquad M_2=\left(\begin{array}{cc}0 & ...
DaftWullie's user avatar
  • 58.7k
6 votes
1 answer
2k views

How would one implement a quantum equivalent of a while loop in IBM QISkit?

I'm writing a simple multiplication algorithm that uses the Quantum Fourier Transform to repetitively add a number (the multiplicand) to itself and decrements another number (the multiplier). The ...
Sashwat Anagolum's user avatar
5 votes
2 answers
414 views

Exotic transversal gate group for stabilizer code

What are examples of interesting $ [[n,1,d]] $ or $ [[n,2,d]] $ stabilizer codes, $ d \geq 2 $, whose group of transversal gates is not isomorphic to a subgroup of the Clifford group (on 1 and 2 ...
Ian Gershon Teixeira's user avatar
5 votes
1 answer
389 views

Eastin Knill Theorem and groups of transversal gates

The Eastin-Knill Theorem shows that the transversal gates always form a group and that moreover this group is a finite subgroup of the group of all unitaries. For many codes, for example all self dual ...
Ian Gershon Teixeira's user avatar
5 votes
1 answer
2k views

How can I simulate Hamiltonians composed of Pauli matrices?

Suppose I want to perform the time-evolution simulation on the following Hamiltonians: $$ H_{1} = X_1+ Y_2 + Z_1\otimes Z_2 \\ H_{2} = X_1\otimes Y_2 + Z_1\otimes Z_2 $$ Where $X,Y,Z$ are Pauli ...
ZR-'s user avatar
  • 2,388
5 votes
1 answer
2k views

The meaning of measurements in different bases

There are other similar questions. But I don't understand the answers. Suppose I express $a|0⟩+b|1⟩$ in the form $\frac{c}{\sqrt2}(|0⟩+|1⟩)+\frac{d}{\sqrt 2}(|0⟩−|1⟩)$ where $a,b,c,d∈\mathbb C$. ...
bilanush's user avatar
  • 881
5 votes
1 answer
710 views

How to apply the outer product operator?

$\newcommand{\q}[2]{\langle #1 | #2 \rangle} \newcommand{\qr}[1]{|#1\rangle} \newcommand{\ql}[1]{\langle #1|} \renewcommand{\v}[2]{\langle #1,#2\rangle} \newcommand{\norm}[1]{\left\lVert#1\right\...
R. Chopin's user avatar
  • 1,199
5 votes
1 answer
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 ...
user avatar
5 votes
2 answers
2k views

Question About How Qiskit Reset Gate Affects Other Entangled Qubits

I am trying to understand how the reset gate in Qiskit affects qubits its entangled with. Consider the following circuit with qubits $q_0$ and $q_1$: Where circuit240 takes $|0\rangle$ to $a|0\rangle ...
Rehaan Ahmad's user avatar
5 votes
2 answers
2k views

How to create a condition on only one classical bit when we have a total of 2 classic bits in the system

I am trying to make a quantum circuit with one qubit and 2 classical bits for each measurment in the system below: I want to make condition on the first bit: if the first collapse to zero so x ...
Daniel Vainshtein's user avatar
5 votes
1 answer
1k views

How can we construct a control-control y-rotation (CCRy) gate in Qiskit?

Qiskit has a CRy gate, however I couldn't find a CCRy (double control Ry) gate implementation. How can we construct the CCRy circuit given below in Qiskit without any ancillary qubits? Edit: A quick ...
Faiyaz Hasan's user avatar
5 votes
2 answers
284 views

Is the intuition of quantum parallelism always correct?

I recently read in Section 7.5.2 of Quantum Computing: A Gentle Introduction by Eleanor Rieffel and Wolfgang Polak a section in which they criticize the view of quantum parallelism in quantum ...
Joery's user avatar
  • 173
5 votes
3 answers
447 views

Calculating measurement result of quantum swap circuit

Consider the following circuit, where $F_n$ swaps two n-qubit states. If the inital state is $|0\rangle \otimes |\psi\rangle \otimes |\phi\rangle = |0\rangle|\psi\rangle|\phi\rangle$, the state ...
Raekye's user avatar
  • 307
5 votes
1 answer
970 views

General approach for switching control and target qubit

It is well known that circuit can be replaced with this circuit The situation is even easier in case of controlled $\mathrm{Z}$ where gate controlled by $q_0$ and acting on $q_1$ have same matrix as ...
Martin Vesely's user avatar
5 votes
1 answer
842 views

Why is the Toffoli gate not sufficient for universal quantum computation?

I know that there are papers (cf. arXiv:quant-ph/0205115) out there which prove that the Toffoli gate by itself is not enough for universal quantum computation, but I haven't had the time to go ...
Sanchayan Dutta's user avatar
5 votes
2 answers
406 views

Why are oracles Hermitian by construction?

$\newcommand{\qr}[1]{|#1\rangle}$In this lecture, it is nicely explained how to define an operator that computes a function $f(x)$. I know how to implement such operators. (We just define $O\qr{x}\...
R. Chopin's user avatar
  • 1,199
5 votes
1 answer
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 ...
glS's user avatar
  • 25.3k
5 votes
1 answer
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 ...
KAJ226's user avatar
  • 13.9k
4 votes
1 answer
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 ...
Adrien Suau's user avatar
  • 4,987
4 votes
3 answers
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 ...
Claire's user avatar
  • 669
4 votes
1 answer
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 ...
user1936752's user avatar
  • 2,997
4 votes
1 answer
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 ...
Joe's user avatar
  • 257
4 votes
3 answers
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 ...
leloctai's user avatar
  • 143
4 votes
1 answer
464 views

Is the cost Hamiltonian unitary in QAOA?

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 ...
Himera Ephemera's user avatar
4 votes
1 answer
107 views

Does every code have a strongly transversal Pauli group?

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 ...
Ian Gershon Teixeira's user avatar

1 2 3
4
5
7