All Questions
Tagged with quantum-gate quantum-algorithms
175 questions
0
votes
0
answers
37
views
How to train QNN on qiskit or ionq simulators
I am trying to train a QNN using qiskit and ionq, the method I use now is to manually feed my input data into quantum circuits:
...
0
votes
0
answers
60
views
How to entangle two separate set into one?
I have two sets of qubits where the information is encoded in amplitude. How can I entangle them into one to save qubits.
The information $k_0,k_1,k_2,k_3$ and $k'_0,k'_1,k'_2,k'_3$ are encoding in ...
0
votes
0
answers
33
views
What to do about operator scalability?
Suppose I have a 32 qubit register meant to represent a classic variable. I want to apply gates to it and naturally I have to tensor product up to a 32 bit register. That means something like
$$
I_{1} ...
1
vote
1
answer
46
views
QPE implementation with 4 qubits
I'm trying to implement a circuit for QPE, i start with 4 qubits but the results are incorrect (even for 3 or 5 qubits).
the used unitary gate is : ...
1
vote
0
answers
29
views
Implementation of the CSD Decomposition for a 4x4 matrix
I am currently reading Volume I of "Principles of Quantum Computation and Information" by Benenti-Casati-Strini. There is a section in chapter 3 which covers the decomposition of any ...
1
vote
0
answers
52
views
Build a query circuit that set the first bit to 0
This is a question from Chapter 2, 8(c) in Quantum Computing: Lecture notes by Ronald de Wolf.
Suppose we can make queries of the type $|i, b\rangle→ |i, b\oplus x_i\rangle$ to input $x\in\{0, 1\}^N, ...
2
votes
4
answers
175
views
How to realize the index shift operation in quantum circuit?
Can we realize the index shift in a quantum circuit as we do in a classic circuit?
$\forall$ $a,b,c \in \{0,1\}$, $\left|abc\right>\mapsto\left|bca\right>$
e.g. $\left|001\right>\mapsto \left|...
1
vote
0
answers
45
views
Numerical values for the volume of qubits
This paper mentions the volume of qubit in equation (9) given by:
$$Q_0=U*C_1*T_o*n_p^{(2/3)}*(v_q)^{(2/3)}$$
where
$Q_0$ is the heat entering the chamber
$U$ is the heat transfer coefficient
$C_1$ ...
0
votes
1
answer
66
views
Custom Quantum Gate equivalence to backend basis gate set
Hello I am using Qiskit and I have defined a custom gate which implements the array shown in the image:
This array is unitary and the function R(theta) works by tuning a continious variable into 0 of ...
2
votes
2
answers
108
views
How is the computational power defined in Quatum Computing?
In classical data centers, the computational power is expressed as function of the number of executed tasks per second as follows :
$$P(\lambda)=P_{idle}+(P_{peak}-P_{idle})\cdot(\lambda/CPU_{capacity}...
3
votes
0
answers
40
views
Transpilation error: CircuitError: 'The amount of qubit(0)/clbit(0) arguments does not match the gate expectation (2).'
I am trying to implement a algoritm that reduces the number of qubits required for MAXCUT optimization. I need to create a custom gate that encodes a diagonal unitary matrix where the diagonal ...
2
votes
1
answer
606
views
Can IBM Quantum hardware handle any CSWAP at all?
I am designing quantum algorithms where the quantum circuit uses CSWAP gates a lot. The result is very noisy on the quantum hardwares. So I designed really simple circuits to test whether it is indeed ...
0
votes
0
answers
101
views
How to write Verilog code to describe a quantum system
I would like to ask everyone for some verilog code sources that implement quantum systems so I can refer to them
3
votes
2
answers
108
views
Show that transformation $U_f: \left| x, y \right\rangle \to \left| x, y \oplus f(x) \right\rangle$ is unitary [duplicate]
I am reading Quantum Computation and Quantum Information by Chuang and Nielsen and they claim that it is easy to show that transformation $U_f: \left| x, y \right\rangle \to \left| x, y \oplus f(x) \...
0
votes
0
answers
25
views
Constructing amplitude oracle for complex-valued matrix
Let $a, b \in \mathbb R$ such that $\vert a + ib \vert < 1$. Does there exists a generic $2$-qubit unitary such that $$(a |0\rangle + \sqrt{1 - a^2}| 1 \rangle) \otimes (b|0\rangle + \sqrt{1 - b^2}|...
0
votes
1
answer
233
views
Unable to extract the quantum registers information from qiskit quantum circuit data
Consider the following code:
...
1
vote
0
answers
19
views
Why we do SWAP operations for applying a mode N function in Shor algorithms and How we do this swapping? [duplicate]
I am working on implementing shor algorithm for finding prime factors of N = 15. I am trying to understand a code of qiskit, but i am confused how and why the code editor is using swap codes to define ...
0
votes
2
answers
98
views
What's the result of applying a CNOT gate followed by a Hadamard?
Say I have the following circuit
And the input is $|\psi\rangle=\frac12(|00\rangle+|11\rangle+|01\rangle+|10\rangle)$. To find the output sate, I would first apply the CNOT to the second bit, ...
1
vote
0
answers
32
views
Implementation of identity block initialisation strategy for mitigating barren plateaus
I have been trying to implement this paper on identity block initialisation strategy for barren plateau mitigation but I don't really understand how one would apply it to a parameterised circuit with ...
2
votes
1
answer
211
views
What are classical analogies for the notions of superposition, entanglement, and interference?
I'm working on a conceptual explanation of quantum computing properties and have used analogies to make the ideas more accessible. I'd appreciate feedback on the validity of these analogies from those ...
2
votes
1
answer
164
views
Generating Equal Amplitude Superposition States from Another Equal Amplitude Superposition State
Can we prepare a state regarding a transformation in quantum computing that seems to generate another equal amplitude superposition state when applying a Hadamard gate?
Specifically, I observed that ...
0
votes
0
answers
44
views
Proof that if W is the image of a Unitary operator with an $n^O(1)$ size quantum circuit, then $R_W$ has an $n^O(1)$ circuit as well
I have been working on the following problem
Suppose $H$ is the Hilbert space of n qubits. Let $W_0$ be the subspace of $H ⊗ H$ with basis $|x_0⟩$, x = 0,...,N −1 where $N = 2^n$. Suppose $U$ is a ...
1
vote
1
answer
129
views
How to calculate quantum cost?
In the following two papers:
Automatic Synthesis of Reversible Logic Circuit Based on Genetic Algorithm
Particle Swarm Optimization based Circuit Synthesis of Reversible Logic
a comparison ...
1
vote
1
answer
110
views
Is this quantum circuit design more prone to noise?
I am designing a quantum circuit which uses one qubit as the control of many $\text{CSWAP}$ operations. And then, this qubit will be measured.
Will the result be more prone to noise since all the ...
1
vote
0
answers
69
views
How to decompose a permutation matrix into two-level unitary matrices?
Assume a have a SBox and want to make quantum circuit for it. The unitary transform matrix for a SBox is special - a permutation matrix. I found an algorithm to decompose any unitary matrix into two-...
1
vote
0
answers
29
views
Implementing scalar multiple of a polynomial using quantum signal processing
Let $p(x)$ be a degree $d$ polynomial such that $|p(x)|\leq 1$ for $x \in [-1,1]$. Assume I have constructed a quantum circuit, $V(x)$, that implements $p(x)$ in the upper left entry of a $2$ by $2$ ...
2
votes
1
answer
372
views
Qiskit Runtime forbids reset gate?
Some parts of my quantum circuit uses initialize to prepare specific amplitudes to the qubits. However, the Qiskit Runtime outputs error:
...
2
votes
1
answer
116
views
Algorithm to reveal properties of a random quantum permutation gate
Given a unitary $U$, which implements a random permutation $\sigma$, such that the input to the unitary permutes as here: $|v_1\rangle\otimes\ldots\otimes|v_n\rangle$ becomes $|v_{\sigma(1)}\rangle\...
0
votes
1
answer
277
views
How can I use Quantum Shanon Decomposition for any $N \times N$ matrix?
I have a non-unitary and non-hermitian matrix of $16\times16$. I have used singular value decomposition to break that matrix into three matrices i.e. $A = UDV$, Where $U$ and $V$ are unitary but still ...
2
votes
1
answer
124
views
Is there an "in place" Toffoli gate?
I am trying to implement the multiplication of a scalar in $\mathbb{Z}_2$ and a polynomial in $GF(2^n)$ in Qiskit. One naive method of implementation that I can think of is:
...
1
vote
1
answer
109
views
qiskit statevector ordering issue
I am currently studying Qiskit.
I don't understand the two pictures below while studying.
When I apply circuit.x(1), the X gate should be applied to the second qubit, resulting in the state |01>. ...
1
vote
1
answer
98
views
Problem with the mathematical definition of the eigenvalue algorithm on a specific exercise
I think I understand well how the eigenvalue algorithm works but when I try to define it mathematically I have problems.
Specifically I have the matrix U:
$$
U =
\begin{pmatrix}
0 & i \\
i & 0
...
3
votes
1
answer
111
views
How much complexity is required to implement $\text{C$_\Pi$NOT}$ gate?
The projector-controlled not gate $\text{C$_\Pi$NOT}$ is defined as
$$\text{C$_\Pi$NOT} \, \colon= \Pi \otimes X + (\mathbb{I}-\Pi)\otimes\mathbb{I}\,, \tag{1}$$ in András Gilyén et. al. (2018)[arXiv:...
2
votes
0
answers
69
views
How to calculate number of qubits required for Grover Algorithm while constructing it's oracle and diffuser for any Specific Algorithm or Hash?
I am reading a paper titled, " (Towards Post-Quantum Secure Symmetric Cryptography:
A Mathematical Perspective)". Here, I am able to understand the gate counts and T-depth calculations. ...
1
vote
1
answer
63
views
2
votes
3
answers
146
views
Seeking Programming Projects and Tools for Quantum Gate Decomposition Implementations
The Solovay-Kitaev theorem shows that "this approximation can be made surprisingly efficient, thereby justifying that quantum computers need only implement a finite number of gates to gain the ...
0
votes
0
answers
40
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 ...
0
votes
1
answer
57
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$
$|...
2
votes
1
answer
218
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?
...
2
votes
1
answer
551
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
...
1
vote
0
answers
57
views
Quantum algorithm with $|y\rangle \mapsto (-1)^{xy}|y\rangle$ for all $y$ with at most $T$ many $1$s
Given an N-bit string $x$, which we can access by queries, give a quantum algorithm that maps $$|y\rangle \mapsto (-1)^{xy}|y\rangle$$ for all $y \in \{0,1\}^{N}$ that have at most T many $1$s and the ...
2
votes
1
answer
179
views
How to represent two gates addition on Qiskit composer. we can do tensor product and multiplication but how to do Addition
How to represent two gates addition on Qiskit composer we can do it in python code by using qiskit library but I would like to visually see how addition of two operators look like in composer.
I am ...
1
vote
2
answers
96
views
Sorting two numbers using quantum computing
To better understand how quantum computing works, I am trying to sort two numbers using unitary matrix. Based on this definition, I understand a quantum Turing machine to have the automorphism (...
4
votes
1
answer
686
views
Minimum number of 2-qubit gates required to implement a Toffoli gate
I'm trying to design a quantum circuit that has an output that is closest to a CCNOT gate with no more than four 2-qubit gates (but I can use additional single qubit gates).
A lot of resources/papers ...
0
votes
0
answers
62
views
Do I need a lab in order to test new ideas in designing quantum circuits
I would like to know how to test new ideas certainly on a circuit level. Do I require a lab? if so where can I find one I live in Houston. Does nt quantum eliminate the necessity of a lab and can I ...
1
vote
1
answer
118
views
A quantum circuit to find if 4 given sides can form a rectangle
I wrote this code that uses a swap test to find if 2 pairs of sides are equal.
First, amplitude encoding the 4 sides on 3 qubits then performing the swap test. I'm not sure where my logic went faulty, ...
0
votes
2
answers
940
views
How to compare 2 classical number using a quantum circuit
I'm given 2 numbers(could be positive/negative). I want to program a quantum circuit to compare them and return the greater one.
How can I do that?
Also, if the first step is encoding the numbers ...
1
vote
0
answers
66
views
Find the desire state with a set of gates?
I encoded a state |000> applied by a U3 gate, resulting in state: a|000>+b|100>. I need to create a circuit to achieve the desired state (a'|**0>+b'|**1>) with * as any 0 or 1 state. ...
1
vote
1
answer
386
views
Deustch-Jozsa algorithm for a specific problem, doesn't make sense?
I am trying to implement Deustch-Jozsa Algorithm where function f(x) = 0 for even and f(x) = 1 for odd, for a four-bit number. After writing the numbers out I found a pattern as described below
...
3
votes
1
answer
112
views
Grover's Algorithm: Why is the amplitude of $\left|a_{0}\right>$ after the second iteration $\frac{1}{\sqrt{N}}(5-\frac{20}{N}+\frac{16}{N^{2}})$?
Grover's Algorithm: Why is the amplitude of $\left|a\right>$ after the second iteration $\frac{1}{\sqrt{N}}(5-\frac{20}{N}+\frac{16}{N^{2}})$?
If I apply the Grover operator twice to the initial ...