Questions tagged [quantum-gate]
For questions regarding usage, performance, implementation, application or theory related to quantum gates.
1,617
questions
0
votes
1
answer
60
views
How to perform below operation in Qiskit?
I want to implement the below equation in Qiskit.
$(A \otimes B).\rho.(B^\dagger \otimes A^\dagger)$ where $\rho$ is a density matrix and $A$ and $B$ are CNOT gates.
$$ A=\begin{bmatrix}
1 & 0 &...
0
votes
1
answer
48
views
Understanding Quantum Adder Circuits Logic
How to see that both are adder circuits in terms of conventional classical circuit logic ?
Strange, the first circuit uses QFT , while the second circuit is using ripple-carry architecture
0
votes
1
answer
98
views
Modular addition in Qiskit
I want to implement the Jordan gradient estimation algorithm in Qiskit. I need a unitary operator $U_f$ that performs as follows:
$$U_f: |x_1\rangle |x_2\rangle \cdots |x_d\rangle|y\rangle \...
0
votes
1
answer
52
views
How is quantum universality related to efficient classical simulation?
I have been studying quantum universality and came across the following statement:
The Clifford set alone is not a universal quantum gate set, as it can be efficiently simulated classically.
A set ...
0
votes
1
answer
107
views
How to apply error-correction to the swap test circuit?
Swap test is a simple quantum circuit to measure the inner product of two quantum states [Wiki: swap test], it only contains three quantum gates. However, due to the error in the real quantum computer ...
0
votes
1
answer
39
views
How to implement a doubly controlled phase gate?
I'm trying to implement a doubly controlled phase gate using Qiskit. I'm aware of this proposed solution, but it's not working on my Google collab notebook. For some reason, I cannot import the "...
0
votes
1
answer
55
views
Why is "this" particular decomposition/regouping of states observed?
This question is motivated from this as well as the regrouping of terms in Shor code.
The setup is not important, but it is being provided for context.
$|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$
$|...
5
votes
2
answers
312
views
What is the expectation value of $|\langle \psi|U|\psi \rangle|$ over Haar random states $|\psi\rangle$?
We know the average unitary fidelity, $\int |\langle \psi|U|\psi \rangle|^2 d\psi$, has a nice closed-form solution: $\frac{1+\frac{1}{d}|Tr (U)|^2}{1+d}$, thanks to Horodecki and Nielsen.
However, I ...
1
vote
3
answers
155
views
Why is the error propagation by the CNOT gate considered without taking into account the state?
In the syndrome measurement circuit of a stabilizer code, I think you would consider that Pauli errors propagate through the CNOT gates. I don't understand why one usually considers the propagation of ...
0
votes
1
answer
54
views
Can we initialize two arrays in two different qubits in a 2-qubit quantum circuit in IBMq?
Can we initialize two different arrays in two different qubits in a 2 qubit quantum circuit?
I tried in IBMq but it showing error.
So don't understand.
from qiskit import QuantumRegister, ...
1
vote
0
answers
117
views
Decomposition of Control-V gates using CNOT and single qubit gate?
In the book "Introduction to quantum algorithms via linear algebra", there is a problem 6.8, that said: "Show that CV can be written as a composition of (appropriate powers of) T gates ...
4
votes
1
answer
64
views
Definition of quantum junta is not basis independent: isn't this a problem?
A quantum $k$-junta is defined as a unitary matrix $U$ acting on $n$ qubits which has the form $U = V \otimes \mathbb I$ where $V$ is a unitary acting some $k < n$ of the qubits. The fact that a ...
3
votes
1
answer
100
views
Which gate should one add to CNOT in order to have a universal set for Quantum Computing?
I have recently encountered the paper Both Toffoli and Controlled-NOT need little help to do universal quantum computation by Yaoyun Shi.
I'm having trouble understanding the proof of theorem 3.1
...
2
votes
1
answer
121
views
Why is it so difficult to implement a T gate?
Much effort has gone into optimizing T gates (distillation, factories, and numerous circuit optimizations).
I am aware that non-Clifford gates are necessary to attain quantum speedup, and the T gate, ...
2
votes
1
answer
287
views
How to express Hadamard gate as a generic trigonometric functions of theta? [duplicate]
Hadamard gate is expressed as $H=R_x(\pi)*R_y(2\theta)$ where $\theta$ is $\pi/4$.
$$H=\begin{bmatrix}
0 & 1\\
1 & 0
\end{bmatrix} \begin{bmatrix}
\cos \theta & -\sin \theta\\
\sin \...
2
votes
1
answer
57
views
Is there a method to implement qutrit using qubits?
I want to implement 3 level system on a qubit quantum computer.
Currently I feel I can use 2 qubits and encode the states of a 3-level system as such
|0>=|00>, |1>=|01>, |2>=|10>
The ...
2
votes
0
answers
35
views
Exploiting virtual-$Z_{\theta}$ corrections in QEC
The work done by IBM Researchers to perform virtual-$Z_{\theta}$ gates allowed them to:
achieving zero-time relative phase shifts;
correcting $Z_{\phi}$ errors occurring when applying some gates -- e....
0
votes
0
answers
52
views
Understanding notation regarding phase oracle continued
Since I am not able to comment on my post, I had to register an account and start a new post. Maybe my old post can be deleted, which is found : here
I am new to quantum computing. I cannot get my ...
0
votes
1
answer
95
views
How does the V gate perform modular exponentiation?
The V gate is defined such that $V^2=X$:
$$ V|0\rangle = \frac{1}{2}\begin{bmatrix} 1+i&1-i\\1-i&1+i\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix} = \frac{1+i}{2}|0\rangle + \frac{1-i}{2}|1\...
3
votes
1
answer
115
views
How many two-qubit controlled gates do you need to simulate any CU gates where U is a diagonal matrix?
Assuming we have n qubit, the first qubit is a control qubit, and the rest are the targets of $U$.
If $U$ is a diagonal matrix, is there any theory to find the minimum number of two-qubit controlled ...
0
votes
0
answers
23
views
What would be the simplest physical implementation of a CNOT operation between spin and energy DoF's?
I'm working on a project where I'm considering a two-level system ("atom" for convenience) which possesses two linearly independent degrees of freedom, one of them a spin degree of freedom ...
1
vote
1
answer
32
views
Local Simulator for Aquila Aws
I am new to this field, so i would like to be sure that the local simulator is actually free.
Then, I would like to know how to check the number of qubits avaiable in the simulator.
1
vote
1
answer
127
views
How to create a multicontrol mcx gate or operation in cirq
In qiskit the method to apply a multi control with more than 2 control qubits is:
qc.mct ( listcontrols,targetbit,listancillas, mode=mode[i])
What is the ...
1
vote
3
answers
216
views
How to join different quantum circuits into one big circuit on specific qubits in qiskit?
I have a quantum circuit that loads the data and is acting on qubit q0,q1,q2 then another circuit that does the same on q3,q4,q5 ...
2
votes
1
answer
74
views
Converting a Matrix to a Gate in OpenQasm 2
I am a beginner when it comes to quantum computing so forgive me if this is a dumb question. Does anyone know how to create a gate from any matrix on OpenQasm2? Specifically, can anyone provide any ...
2
votes
1
answer
114
views
Why is Bernstein-Vazirani guessing considered a one guess?
In Bernstein-Vazirani algorithm, we can see the application of $CX$ gates from each qubit that represents the bit in state 1, onto the $|-\rangle$ state. It seems clear to me that the $CX$ will apply ...
1
vote
1
answer
91
views
Controlled unitaries in quantum singular value transformation
tldr -- Building general polynomials with QSVT requires implementing controlled versions of vanilla QSVT circuits. Is this a trivial task? Does it change the complexity? How is it done in practice?
...
1
vote
1
answer
37
views
How to best represent 5-Qbit codeword operator in Qiskit [duplicate]
We learned that in the 5-Qibit error correcting code, the logical zero state $ | \bar{0} \rangle $ is encoded in the form of $ \frac{1}{4} (\mathbb{1}+M_0)(\mathbb{1}+M_1)(\mathbb{1}+M_2)(\mathbb{1}+...
0
votes
1
answer
30
views
Nonsensical projection of initialized qubits in Qiskit
I wanted to try Qiskit by setting up two qubits initialized to $ | 11 \rangle $ or $ | 01 \rangle $ and two classical bits to measure those two initialized qubits.
For this simple demonstration, I ...
3
votes
2
answers
243
views
Name of quantum gate that cycles the Paulis
Background: There is a single qubit quantum gate of the form
$$
\frac{1}{\sqrt{2}}\begin{pmatrix}
1 & -i \\ 1 & i
\end{pmatrix}.
$$
As far as I know, this was originally introduced as the $T$ ...
2
votes
1
answer
104
views
Are quantum controlled non-unitary circuit operations possible?
Are quantum controlled non-unitary operations possible?
For instance can I define a controlled-reset where I reset a target qubit to $|0 \rangle$ if a controlled qubit is in the $|1\rangle$ state? How ...
0
votes
0
answers
108
views
Half-wave plate (HWP) Hadamard gate implementation
The transformation of a qubit encoded in the polarization state from $|H\rangle$ to the state $|+\rangle$ is theoretically achievable with an HWP@π/8. However, I rarely see this solution in ...
0
votes
1
answer
149
views
Qiskit_machine_learning QNNEstimator 'Estimator job failed' when using CU-Gates
I'm trying to construct a QNN using controlled arbitrary unitary gates. While some simple code versions work perfectly for controlled single rotations, the moment I add CU gate with parameters, the ...
0
votes
0
answers
34
views
How does using a controlled rotation gate , with the slope of the linear function as a parameter, loads that function onto the amplitude?
I was going through the paper Quantum Risk Analysis in the section III they came up with a technique, in which they represented the analytical function into a polynomial and then used the slope of ...
1
vote
1
answer
175
views
How to add noise mode in Sampler (SamplerQNN) in qiskit for quantum neural network?
I would like to add a noise model to one of the tutorial examples of quantum machine learning in the Qiskit site (PyTorch QGAN implementation).
I used the following codes
...
0
votes
1
answer
35
views
Creating a parameterized Operator in Qiskit that cannot be decomposed into Qiskit supported gates
I am trying to create a custom ansatz to use the built-in Qiskit VQE() function. My ansatz is composed of single qubit gates and a hamiltonian gate which cannot be decomposed into Qiskit supported ...
0
votes
0
answers
27
views
Derivation of complexity for data encoding schemes
Could anyone help to derive the space-time complexities of the following different data encoding schemes ?
0
votes
1
answer
33
views
Qiskit syntax to remove all gate operations for a given qubit line in a circuit
I am looking for a method to remove all operations for a given qubit in a Qiskit circuit. Here, I am looking to remove potentially many gate operations that are operating on that qubit line. Ideally I ...
3
votes
2
answers
109
views
Transformation of 0 state to superposition of 0 and + state with only using single qubit gates
How to transform a qubit from state $|0\rangle$ to $(|0\rangle+|+\rangle)/N$ by only using an additional qubit, a controlled Hadamard gate, a Hadamard gate and a $Y$ or $Z$ gate? Sequence of the gates ...
0
votes
0
answers
47
views
Understanding the meaning of [2, 2] for input_register and target_register in a custom Cirq gate
I'm learning a custom gate implementation from google Cirq official tutorial of shor algorithm(https://colab.research.google.com/github/quantumlib/Cirq/blob/master/docs/experiments/shor.ipynb#scrollTo=...
0
votes
1
answer
60
views
What state do you get applying the pauli Y gate to $|\pm\rangle$? [duplicate]
I know it's a basic question but what state gives when you apply pauli $Y$ gate over states $+$ and $-$?
If I apply $Y|+i⟩ = |+i⟩$ or $Y|0⟩ = i|1⟩$, but I don't understand what do you get when you do $...
1
vote
0
answers
29
views
Question on circuit function evaluation
In this question, from what I understand, the circuit on the right hand side can not be evaluated for f(0) so depending on value of y, we will have two different f(0)s so this equality of circuits ...
1
vote
1
answer
62
views
Is every diagonal gate whose non-zero entries are $2^k$th roots of unity in the two qubit Clifford hierarchy?
Does the two qubit Clifford hierarchy contain all diagonal gates whose entries are $ 2^k $ roots of unity?
In particular, is it true that every $ 4 \times 4 $ diagonal matrix whose diagonal entries ...
1
vote
1
answer
129
views
SX operator and superposition
I am running some tests using the probabilities we get from statevector to assert values in qiskit. For instance, with two qubits and a hadamard gate on the first one we have:
...
8
votes
0
answers
216
views
Can you programatically check whether a given set of gates is universal?
I am wondering if there is an automated way to determine whether a given set of quantum operations is universal.
More precisely given a set of 1 and 2 qubit gates can we write a program to determine ...
2
votes
1
answer
75
views
Does SZS equal Z?
I am completely new to quantum computing and playing QuantAttack. While playing, I found something strange: SZS turns into Z.
According to the Wikipedia article that the game recommends reading, SZS ...
2
votes
0
answers
45
views
Quantum circuit runtime
I want to estimate the execution time of some experiments, and I would be interested to know how the time needed to run a quantum circuit grows in function of the number of qubits and the parametric ...
0
votes
0
answers
42
views
Conjugation of Unitary Matrices in Quantum Channel
A quantum channel is given in the form $U(\rho)=\sum_{j}p_jK_j\rho K_j^\dagger$. I have read in another thread that a quantum channel is the generalized version of a quantum gate (represented by a ...
2
votes
2
answers
165
views
Conditional unitary based on output of a function
I read about dynamic circuits in Qiskit which uses an if-test. My question is how can we give a custom function in the if-test? Based on its documentation, we can only provide a classical register to ...
0
votes
3
answers
219
views
How to represent Beam-Splitter and Kerr gates as basic quantum logic gates?
I want to know how to convert these exponential forms to tensor products of well known logic gates (like the ones built into Qiskit). My goal is to program the Beam-splitter-Kerr ansatz circuit for ...