Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
3 votes
1 answer
86 views

types of states that can be created with a given number of entangling gates

I want to know if it is possible to say something in general about the "richness" or "complexity" of quantum states that can be created using a given number of entangling 2-qubit ...
Lior's user avatar
  • 1,180
3 votes
2 answers
157 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
2 answers
460 views

How to implement the exponential of an outer product?

In exercise 6.7 page 258 in Nielsen and Chuang book, they have a Hamiltonian $H = \left| x \right\rangle \!\!\left\langle x \right| + \left| \psi \right\rangle \!\!\left\langle \psi \right|$ and the ...
walid's user avatar
  • 335
3 votes
2 answers
1k views

How do I embed classical data into qubits?

How do I embed classical data into qubits? I have a classical data [0 1] and I want to encode it as quantum amplitude to a superposition? What are the gates used to achieve that? I am a beginner to ...
Ebtehal Ali's user avatar
3 votes
1 answer
895 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,702
3 votes
1 answer
190 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
3 votes
1 answer
280 views

How to use Cirq to transpile circuit to custom native gate set?

I am trying to use Cirq to compile arbitrary quantum circuits to custom native gate sets, e.g., to use the Cirq compiler to generate quantum circuits for different quantum computers (IBM, Rigetti, ...
nils's user avatar
  • 33
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
4 answers
195 views

Can you use Rz to flip from $|+\rangle$ to $|-\rangle$?

Here's the Rz matrix: $$ Rz(\theta) = \begin{bmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{bmatrix} $$ As I understand it, Rz rotates around the Z axis on the Bloch sphere. Since $|+\...
ahelwer's user avatar
  • 3,978
3 votes
1 answer
113 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
  • 21.7k
3 votes
2 answers
2k views

Measuring T1 and T2 constants on IBM Q

We have been asked to measure relaxation and dephasing times T1 and T2 on the IBM Q using the composer only, Qiskit not allowed. I am a bit confused about the way to do so. Can someone explain the ...
Aviv Azran's user avatar
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
3 votes
2 answers
170 views

Minimal quantum OR circuit

The quantum OR circuit between $|a\rangle$ and $|b\rangle$ can be made out of 1 Toffoli and 2 CNOT gates, 1 ancillary qubit. Is there any other implementation? Or is this the minimal in the sense of ...
Upstart's user avatar
  • 1,400
3 votes
1 answer
1k views

Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates?

Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates? Why is it simple for Clifford gates to implement ...
Wang's user avatar
  • 69
3 votes
1 answer
94 views

Can the ancilla for Qiskit's mcx with mode="recursion" be dirty?

I think their implementation is close to the one from here which does use a dirty ancilla, but I just want to make sure
Dani007's user avatar
  • 500
3 votes
1 answer
442 views

How does the cnx gate work in Qiskit (Python)?

Could somebody explain the cnx operator, and how it operates on its qubit parameters to flip the target qubit in Qiskit (Python)?
user1319236's user avatar
3 votes
0 answers
277 views

Clock matrix vs matrix clock

In the process of research leading up to my previous question, I found out about matrix, vector & logical clocks. The citation in the aforementioned question mentions clock and shift matrices. ...
user820789's user avatar
  • 3,272
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
1 answer
371 views

Can we understand multi-qubit gates in terms of rotation groups?

I'm trying to reconcile (i) the statement that swapping two subsystems constitutes a rotation by $2\pi$ and (ii) the angle that is implied by the Hermitian generator of a SWAP gate. I haven't tracked ...
forky40's user avatar
  • 5,715
3 votes
1 answer
701 views

What is the connection between $RX$ gates and $X$ gates (similar for $Y$ and $Z$)?

I am new to quantum gates but do not understand the connection between the $RX$ and $X$ gates. I know that $$R X(\theta)=\exp \left(-i \frac{\theta}{2} X\right)=\left(\begin{array}{cc} \cos \frac{\...
Jason Fring'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
262 views

Grover's Algorithm on a Database with more than 50% matching entries

The Setup for Grover's Algorithm is the following: Given an oracle $f_O^{\pm}$ representing a Query on a Database with total $N$ entries $N$ of which $k$ are matching. Grover's Algorithm is used to ...
vasjain's user avatar
  • 762
3 votes
2 answers
607 views

Computing expectation value of $|\langle z|C|0^n\rangle|^2$ over Haar random circuit

I am trying to understand the integration on page 4 of this paper. Consider a Haar random circuit $C$ and a fixed basis $z$. Each output probability of a Haar random circuit (given by $|\langle z | C |...
BlackHat18's user avatar
  • 1,119
3 votes
1 answer
95 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
3 votes
1 answer
375 views

Is it possible to express $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? In Qiskit for example

Is it possible to express gate $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? Both in principle and in practice (in Qiskit for example)? The single gate $R_z(\lambda)$ ...
Aleksey Zhuravlev's user avatar
2 votes
1 answer
68 views

How to write an $n$-qubits parametric unitary as a linear combination of tensor products between parametric 2$\times$2 matrices?

As far as I understood, it should always be possible to decompose any $n$-qubits unitary $U$ into a linear combination of tensor products between $n$ complex matrices $W_i \in \mathbb{M}_{2 \times 2}$ ...
SimoneGasperini's user avatar
2 votes
4 answers
251 views

Quantum circuit with one unknown gate

You are given a quantum circuit with around 4-5 gates connected. The catch is that you know all the gates and the connection except one gate. For as many times as you want you can check what the ...
wizzywizzy's user avatar
2 votes
1 answer
288 views

How to Construct Swap Gates from Permutation Matrix?

This is a follow-up question from here. Let's say after an LUP decomposition, we have an 8x8 permutation matrix: $ P^{-1} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ ...
prairie99's user avatar
2 votes
2 answers
404 views

Is there a good way to mathematically write a CNOT operation over non-neighboring qubits in a circuit? [duplicate]

I was wondering if there is any way to present the CNOT matrix as we usually present single qubit operations $$... 1 \otimes NOT \otimes 1 ...$$ I know that for adjacent qubits in a circuit we can ...
César Leonardo Clemente López's user avatar
2 votes
1 answer
184 views

How do Hadamard and CNOT gates work on Qiskit SDK? Why is the output reversed?

Here is the code that I have been using on IBM Q Experience (should be the latest version of Qiskit). From my understanding it seems like the outputs of Hadamard and CNOT gates are reversed in a 2-...
Wilson Zhu's user avatar
2 votes
2 answers
318 views

Matrix representation of SWAP on two qubit registers?

There is a matrix that can represent a swap gate-- a gate that essentially swaps two qubits. This matrix, $S$, is: $$ \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & ...
Loic Stoic's user avatar
2 votes
0 answers
114 views

Is there a quantum operation that can transform a superposition of states into its complement?

Given a superposition of states "B" which is a subset of the suoerposition "A" of all possible states of a set of qbits, is there a quantum operation that produces superposition $R=...
S. McGrew's user avatar
  • 235
2 votes
2 answers
291 views

How can I find a quantum channel connecting two arbitrary quantum states?

Given two arbitrary density matrices $\rho, \sigma\in \mathcal{H}$ (they have unit trace and are positive), how do I go about finding a possible quantum channel $\mathcal{E}$ such that $\mathcal{E}(\...
Confinement's user avatar
2 votes
2 answers
232 views

Quasiprobability decomposition of the CZ-gate

I was trying to obtain the quasiprobability decomposition of the CNOT gate by using the information in this paper. The authors give us the example for the CZ gate (Figure 2, i.e. the one below). The ...
stopper's user avatar
  • 333
2 votes
2 answers
224 views

Do quantum gates rotate a qubit around the Bloch sphere, or do quantum gates rotate the Bloch sphere around a qubit?

Do quantum gates rotate a qubit around the Bloch sphere? Or do quantum gates rotate the Bloch sphere around a qubit? "The simplest quantum gates are the Paulis: X, Y, and Z. Their action is to ...
guest's user avatar
  • 303
2 votes
1 answer
146 views

Does the CX gate always leave the first qubit unchanged and swap the amplitudes of the second one?

I'm a self-learner of quantum computing and is at the very beginning. I do have some math and coding background though. I'm trying to understand how working with entangled qubits helps performing ...
SBF's user avatar
  • 123
2 votes
2 answers
210 views

Why does gate teleportation allow to implement nonlocal operations via local ones?

In (Gottesman and Chuang 1999), when discussing quantum gate teleportation, they mention how it can be used to implement nonlocal gates such as a CNOT, by only using (classically controlled) local ...
glS's user avatar
  • 21.7k
2 votes
1 answer
155 views

How to generate matrix for swap(a, b) gate for n qubits

I am trying to simulate a swap gate that swaps two qubits of indices a and b where there are n qubits total. I understand how to make a truth table and generate a matrix based off of that for each ...
Not_swap_master's user avatar
2 votes
3 answers
1k views

Creating a parameterized Operator in Qiskit

I'm trying to run a VQE for a specific custom Anzats. The Anzats is built up of an unitary matrix $U_H$, which I'm trying to created in this way: ...
Paco Bontenbal's user avatar
2 votes
1 answer
312 views

Circuit construction and Dirac notation of the following operation

I have a state $$ |\tilde{\Phi_2}\rangle =\dfrac{1}{2^{3l/2}}\sum_{x=0}^{2^l-1}\sum_{y=0}^{2^l-1}\sum_{z=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |x\rangle^{\otimes l}\otimes |y\rangle^{\otimes l}\...
Upstart's user avatar
  • 1,400
2 votes
1 answer
588 views

FANOUT with Toffoli Gate

Figure 1.16: FANOUT with the Toffoli gate, with the second bit being the input to the FANOUT (and the other two bits standard ancilla states), and the output from the FANOUT appearing on the second ...
Prasanth Kumar Vemula's user avatar
2 votes
1 answer
137 views

How does measuring a value of one operator affect the probability of measuring a value for another operator?

Suppose I have two non-commuting operators, $U_1$ and $U_2$ with eigenvalues $\lambda_{1,1}, \lambda_{1,2}$ and $\lambda_{2,1}, \lambda_{2,2}$, respectively. In order to determine how measuring one ...
Indy500's user avatar
  • 21
2 votes
1 answer
89 views

Is $e^{i\beta} R_Z(-2\beta)$ equivalent to $U_1(2\beta)$?

As far as I know the single qubit gate $$ e^{i\beta\sigma_z} = \begin{bmatrix} e^{i\beta} & 0 \\ 0 & e^{-i\beta} \end{bmatrix} = e^{i\beta} \begin{bmatrix} 1 & 0 \\ 0 & e^{-i2\beta} \...
John's user avatar
  • 197
2 votes
1 answer
164 views

How would I compute a density matrix of a 2 qubit mixed state?

I am currently reading Nielsen & Chuang, and one of the questions asks to calculate a density matrix with the following mixed states, how would I do this? $$ |00> \;with \;probability \; 2/4 \\ ...
lambda's user avatar
  • 101
2 votes
2 answers
313 views

How to construct a CU3 gate using only CX and U3 gates?

Knowing that CX and U3 (taking 3 parameters $\theta, \phi$ and $\lambda$) form a set of universal gates how can I construct an arbitrary CU3 gate using a decomposition of only CX and arbitrary U3 ...
AdonaiH's user avatar
  • 45
2 votes
1 answer
272 views

How do we perform a measurement of an arbitrary 1-qubit quantum state in any arbitrary orientation?

Let's imagine we have an arbitrary 1-qubit quantum system $\alpha \vert 0 \rangle + \beta \vert 1 \rangle$ Making a measurement in the +/- basis is equivalent to performing a Hadamard gate and then ...
Rabins Wosti's user avatar
2 votes
1 answer
145 views

Gate corresponding to $-I$

I am implementing a quantum circuit in Qiskit. I create the equal superposition state $$ -|00\rangle + |01\rangle + |10\rangle +|11\rangle $$ but I want to obtain the quantum state $$ |00\rangle - |...
usercs's user avatar
  • 451
2 votes
1 answer
408 views

If CNOTs and single qubit gates are universal then why do we need to prove that controlled U operations can be composed by them as well?

In the book by Chuang and Nielsen they prove that controlled U operations can be made out of CNOTs and single qubit gates. But then they go on to prove that they are universal by showing that every n ...
bilanush's user avatar
  • 841
2 votes
1 answer
670 views

Can SWAP operators change trace of a product state? [closed]

I am currently reading https://arxiv.org/abs/1501.03099. In the third part of the paper, "Measuring and detecting quantumness", the authors define the SWAP operators, use them on the initial ...
netflix_and_physics's user avatar
2 votes
1 answer
607 views

How do I compute the square root of the $Y$ gate?

I am trying to compute the square root of the Y gate. $$Y_\theta =\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$$ There are many ways for doing this. I ...
Nicholas Sathripa's user avatar