Questions tagged [quantum-gate]
For questions regarding usage, performance, implementation, application or theory related to quantum gates.
1,579
questions
0
votes
0
answers
142
views
Applying Trotterization to a Hamiltonian for Time Evolution in Qiskit
I'm currently working on a project where I need to simulate the time evolution of a quantum system using Qiskit. The Hamiltonian of my system is given by:
$$H = -J \sum_{j=1}^{N-1} (\sigma_j^x \...
1
vote
2
answers
69
views
The effect of CNOT gate on The control qubit
I want to know in which cases the CNOT gate can change the state of the first qubit (the control qubit), and why is that ?? I know that the CNOT gate has effect only on target qubit..
0
votes
0
answers
17
views
how to find a quantum gate matrix from RHO before and RHO after evolve
to evolve a 4x4 density matrix I use this method:
rhoafter = np.dot(np.dot(gate,rhobefore),np.conjugate(gate.T))
And I want to find the gate from rhobefore and ...
0
votes
0
answers
35
views
Exponential modulation on qiskit, Shor algorithm [duplicate]
I´m trying to code the shor algorithm for any N and any a but i always find examples of code for the N=15. My first question is how is this funtion( provided by qiskit ) does the exponential ...
1
vote
1
answer
70
views
Decomposing Hadamard gate
I'm following a lesson, and it says that the Hadamard gate can be decomposed to three gates: RZ(pi/2), squared root Z, and RZ(pi/2). However, when I do matrix multiplication of these three matrices, I ...
7
votes
3
answers
547
views
Universal Gate Set, Magic States, and costliness of the T gate
The usual universal gate set is $\mathcal{C} + T$ where $\mathcal{C}$ is the Clifford group and $T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix} $ is the $\pi/8$ rotation gate. In ...
0
votes
0
answers
21
views
Why are the other qubits affected by a phase flip in Shor's 9-qubit code?
We have the following "concatenated" initial state in the 9-qubit Shor code:
$\alpha{(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)}/{2\sqrt{2}}+\beta{(|000\...
2
votes
2
answers
98
views
How can I implement a Hamiltonian which is sum of tensored pauli operators on qiskit?
I am working with a Tight Binding Hamiltonian with N sites and one orbital at each site in a closed chain. I have converted the fermionic expression to a spin expression using Jordan Wigner ...
1
vote
0
answers
69
views
Can we write CNOT gate in terms of Quaternion?
A quaternion can be represented as $a + bi + cj + dk$ where a, b, c, d, are real numbers, and i, j, k, are symbols that can be interpreted as unit-vectors pointing along the three spatial axes. .
I am ...
0
votes
1
answer
74
views
Operator qubit ordering not matching circuit qubit ordering
I tried constructing a cx gate manually using tensor products and one using QuantumCircuit in qiskit followed by converting it ...
0
votes
1
answer
57
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
36
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
81
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
42
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
82
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
30
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
261
views
Haar average of $|\langle \psi|U|\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
95
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 ...
-1
votes
1
answer
50
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
55
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
57
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
87
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
87
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
255
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
46
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
32
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
40
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
83
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
100
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
18
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
26
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
80
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
77
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
53
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
87
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
71
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
32
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
26
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
236
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
98
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
80
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
101
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
25
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
107
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
23
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
19
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
26
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
86
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
39
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=...