As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
6 votes
1 answer
467 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
  • 5,725
6 votes
1 answer
171 views

What are the relations between the permutation group and the Clifford group?

I'm trying to understand the relation between the permutation group on all the $2^n$ bitstrings and the Clifford group. My question arises from the fact that the Toffoli gate (which can be thought of ...
mavzolej's user avatar
  • 1,740
6 votes
1 answer
134 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
  • 52.3k
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
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
2 answers
940 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
  • 71
5 votes
2 answers
368 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,179
5 votes
2 answers
4k 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
  • 71
5 votes
1 answer
654 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.3k
5 votes
1 answer
486 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
  • 841
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
1 answer
844 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
1 answer
804 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
1 answer
1k views

Quantum Circuit To Compute Any Inner Product

I'm currently reading the paper Classification with Quantum Neural Networks on Near Term Processors It shows a method to determine the following quantity: Where U is a unitary operator acting on $|z,...
Rehaan Ahmad's user avatar
5 votes
1 answer
1k 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
  • 841
5 votes
1 answer
566 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
680 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,179
5 votes
2 answers
451 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
  • 201
5 votes
3 answers
391 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
  • 297
5 votes
1 answer
455 views

What is the correlation between Toffoli and a more generic rotation shown in qiskit textbook

Can someone help me understand the correlation between the 2 diagrams in the qiskit textbook.
Abhishek Kishore's user avatar
5 votes
2 answers
614 views

What are generators for a "real" Clifford group?

I work with stabilizer codes using the real version of Pauli matrices: $X=((0,1),(1,0))$, $Z=((1,0),(0,-1))$, $Y=XZ$ (not $\imath XZ$). I know the encoders for these codes lie in the Clifford group ...
unknown's user avatar
  • 1,732
4 votes
1 answer
1k 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,348
4 votes
2 answers
255 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 ...
Chris Rutherfurd's user avatar
4 votes
2 answers
1k views

Why isn't the circuit performing a measurement in the Bell basis?

Nielsen and Chuang (on page 188 exercise 4.33) says that the circuit including CNOT and Hadamard is performing a measurement in the Bell basis. But I can't see how. The matrix representing the ...
bilanush's user avatar
  • 841
4 votes
2 answers
514 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
4 votes
3 answers
349 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
4 votes
3 answers
3k 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
  • 659
4 votes
2 answers
292 views

Exotic transversal gate group

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
4 votes
1 answer
625 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
1 answer
143 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,367
4 votes
1 answer
308 views

What applications does the quantum gate [(i,1),(1,i)] have?

I've been working through the great introduction to quantum computing on Quantum Country. One exercise there is to find a possible quantum gate matrix that is not the $X,I$ or $H$ matrix. I thought ...
dv02's user avatar
  • 143
4 votes
1 answer
2k views

How is data encoded in a quantum neural network?

I am a newbie to quantum machine learning. I am trying to build a quantum neural network (QNN). What I studied so far about QNN is that input would be qubits and hidden layer parameter can be set ...
Muhammad Kashif's user avatar
4 votes
1 answer
149 views

Applying $R^{'\dagger}_{xz}$ in gate teleportation

In figure 4 of the paper Quantum Teleportation is a Universal Computational Primitive, the authors show a circuit for applying a unitary $U$ fault-tolerantly via teleportation. I'll paste the figure ...
epelaez's user avatar
  • 2,695
4 votes
2 answers
120 views

Example of a quantum algorithm better than its classical counterpart which involves only $1$ qubit?

I was reading over the proof of the Deutsch-Jozsa algorithm, which in its simplest case, involves at least 2 qubits. Is there an example of a quantum algorithm that is better than it's classical ...
Pranav Jain's user avatar
4 votes
1 answer
386 views

Square root of NOT as a time-dependent unitary matrix

I want to express the square root of NOT as a time-dependent unitary matrix such that each $n$ units of time, the square root of NOT is produced. More precisely, I want to find a $U(t_0,t_1)$ such ...
Alejandro Díaz-Caro's user avatar
4 votes
1 answer
790 views

Implementing a complex circuit for a Szegedy quantum walk in qiskit

Problem definition I'm implementing a quantum circuit in qiskit for a Szegedy quantum walk, (reference, Fig 21.). It uses two registers of dimension $N$ ($N=3$) each one. The challenges I'm facing are:...
German Alamilla's user avatar
4 votes
1 answer
151 views

How are two different registers being used as "control"?

On page 2 of the paper Quantum Circuit Design for Solving Linear Systems of Equations (Cao et al.,2012) there's this circuit: It further says: After the inverse Fourier transform is executed on ...
Sanchayan Dutta's user avatar
4 votes
1 answer
282 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
1k views

How to prove universality for a set of gates?

Which of the following sets of gates are universal for quantum computation? {H, T, CPHASE} {H, T, SWAP} And how do we prove it?
hey0god's user avatar
  • 43
4 votes
1 answer
281 views

Do all physical architectures for quantum computers use the same universal gate sets?

Now I have understood that physical implementation of quantum computer need a universal quantum gate set like Clifford+T to realize any unitary quantum gate. However, I don't know if it is all the ...
Henry_Fordham's user avatar
4 votes
2 answers
1k 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
4 votes
1 answer
285 views

How to create an $n$-qubit normally controlled gate?

Suppose I have a quantum gate $U$ and it's a controlled gate. In particular, I have a $2\times 2$ matrix formulation of the gate's action on 2 adjacent qubits. How can I make this work on an $n$-bit ...
Isky Mathews's user avatar
4 votes
2 answers
439 views

Generate a 3-qubit SWAP unitary in terms of elementary gates

I wish to generate the following unitary ...
LOC's user avatar
  • 343
4 votes
1 answer
149 views

How the real IBM quantum computers apply arbitrary Rz(θ) gate rotation? [closed]

I want to ask the following questions: (1) The basis gate set of IBM quantum computers is { Id, Rz(θ),√X, X, CNOT, reset}. Somebody said that IBM didn’t really apply Rz(θ) gate on the machine. The ...
劉承瀚's user avatar
4 votes
2 answers
679 views

Why can't a fanout be made with a CNOT gate?

I know this question has been answered here, but the answers leave some things confusing to me. When broken down (and used to calculate), the idea that the states are entangled doesn't seem to be ...
SpaceChicken's user avatar
3 votes
2 answers
158 views

Expressing CNOT in the eigenbasis of $X$ (Preskill lecture notes eq. 7.6)

In chapter 7, equation 7.6 says CNOT works as follows: CNOT: $\frac{1}{\sqrt{2}} (|0\rangle + |1\rangle )\otimes |x\rangle \rightarrow \frac{1}{\sqrt{2}} (|0\rangle + (-1)^x |1\rangle ) \otimes |x\...
Blackwidow's user avatar
3 votes
1 answer
120 views

In quantum teleportation, does Bob's qubit depend on Alice's $\alpha$ and $\beta$ coefficients?

Does applying an operation to one half of an entangled pair affect the other? As in the case of quantum teleportation when Alice applies CNOT to her half of the pair and the qubit she wants to send ($\...
Aarsh Chaube RA1911027010105's user avatar
3 votes
3 answers
1k views

How can we construct a square root of NOT gate in Qiskit and IBMQ circuit composer using universal gates?

I have tried it with decomposing controlled S then conjugating with H gate. But I want to construct it using a minimum number of gates.
jayanti singh's user avatar
3 votes
1 answer
1k views

Quantum addition and modulo operation using gates

I have a matrix equation $X_{\text{new}}=AX_{\text{old}}$, where $A=\begin{bmatrix}1 & 1 & 1\\ 2 & 3 &2\\ 3&4&4 \end{bmatrix}\bmod 64$, and $X_{\text{old, new}}\in \{1,2,...64\}...
Upstart's user avatar
  • 1,400
3 votes
2 answers
133 views

What is the name of this "ancilla based" process to implement gates

I just want to know if there is a specific name for the implementation of a gate on the top qubit with the help of the bottom qubit, represented on this image: It looks like gate teleportation but it ...
Marco Fellous-Asiani's user avatar