Questions tagged [circuit-construction]
For questions about the construction of complex circuits using elementary quantum gates.
701
questions
0
votes
1
answer
64
views
Quantum problems that input arithmetic circuits
In computer science, problems can input arithmetic circuits. For example, let's just consider an example search problem:
You are given an input $x \in \mathcal{I}$. $x$ is a tuple $(n, C)$, where $C$ ...
3
votes
3
answers
335
views
How to prepare all the computational basis states by running the same quantum ansatz with distinct $\theta$ values?
Given a 2-qubits system, the 4 computational basis states are $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$.
Is it possible to prepare these states by a one-parameter quantum circuit "...
1
vote
0
answers
60
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
223
views
Removing barriers from a QuantumCircuit object in Qiskit
I find barriers useful for visualization purposes, naturally it helps observing a circuit that is separated to some logical segments than just watching a mixture of gates and qubits.
However, before ...
5
votes
0
answers
83
views
Arbitrary rotations in the plane spanned by two known quantum states
Suppose I have two quantum states $|\psi_1\rangle,|\psi_2\rangle$ that I know how to prepare from some fixed initial state, say $|0\rangle^{\otimes N}$ on some $N$ qubits with known quantum circuits $...
1
vote
2
answers
304
views
Is it possible to express T, CNOT, SWAP, and CCNOT gates as a product of rotation gates?
I am trying to learn some basics in quantum computing and reached a place where I need to understand deeply unitary matrix decomposition.
Therefore, I am looking for some help whether literature or ...
1
vote
0
answers
151
views
Block encoding for a sum of Pauli terms
Given a qubit Hamiltonian with polynomially many local Pauli terms, what is the most natural way of constructing its block encoding? I know there are multiple ways of doing so, but I am looking for ...
1
vote
2
answers
66
views
How to implement Hamiltonian $0.01Z$?
I have a task in an assignment that wants me to apply a Hamiltonian to a state.
The Hamiltonial is 0.01*sigma_z. I know how to apply a Z gate to a state but I don't know to process the factor 0.01 in ...
4
votes
1
answer
231
views
Is it possible to implement any random Hamiltonian using quantum circuit
Are there any restrictions on implementing the evolution of any random Hamiltonian? Suppose I want to implement Rabi oscillations using a quantum circuit, I initialize the state and the Hamiltonian ...
1
vote
1
answer
66
views
Quantum circuit simplification using classical computers
Suppose that we have this kind of circuit where the first unitary operator U is used for the state preparation while the Hadamard operator is used of state detection.
Let's say we try to run this ...
1
vote
1
answer
261
views
Commutativity of XY gate
My question is a simple one: Can 2 XY gates commute ?
XY gate is a 2-qubit XX+YY interaction also sometimes referred to as iSwap gate.
0
votes
1
answer
269
views
How to decompose root iswap into root cz and single-qubit gates
Id like to decompose root iswap gate into root cz (not cz or cx) and single-qubit gates.
1)Is it possible to decompose like that?
2)Is there a way to do such a decomposition with qiskit, qutip, etc.?
3
votes
1
answer
420
views
How does one convert a truth table to a square permutation matrix?
Given a classical circuit of $m$ inputs and $n$ outputs, composed of various AND gates, OR gates, NOT gates, etc., a truth table is a $2^{m}\times(m+n)$-sized matrix, where, in general, the first $m$ ...
0
votes
2
answers
291
views
What is the unitary matrix for a full adder? [duplicate]
I need the unitary matrix for a full adder.
I want to assess how an automatically generated circuit is close to the full adder. Therefore,I need a unitary matrix for the full adder. I believe it ...
2
votes
2
answers
166
views
How to translate a 4-qubit Grover's algorithm circuit into a state Matrix?
Grover's algorithm circuit may be implemented as follows:
(from here)
It is shown very elegantly by @MartinVesely (How to interpret a 4 qubit quantum circuit as a matrix?) how to translate a 4 qubit ...
1
vote
2
answers
406
views
Is there any library that can convert a circuit drawn as text to a qiskit QuantumCircuit?
Does anyone know of a library to convert a parametrized qiskit circuit drawn as 'text' back to a QuantumCircuit or similar?
I have see [this] 1 question, but ...
1
vote
2
answers
330
views
Conversion error: from a QISKIT circuit to a QASM string and back
I created a circuit in qiskit and then converted it into a QASM string. When I try to make a circuit out of the QASM string I get the error:
...
0
votes
1
answer
69
views
Survival probability quantum circuit
Suppose say that I have a quantum state $\vert\psi\rangle$ at time $t = 0$, which is now evolved by a hamiltonian $H$
$$e^{-iHt}\vert\psi\rangle$$. I can ask the question, how much of initial state is ...
0
votes
1
answer
112
views
Frequency range of superconducting qubit
What are the reasons/considerations for setting the transmon qubit frequency between around 3-6 GHz? What undesirable consequences will result if the frequency is out of the range?
1
vote
1
answer
302
views
How do I bound parameters in RawFeatureVector with ParameterizedInitialize in Qiskit?
I'm not sure how to bind the parameters in the Qiskit RawFeatureVector circuit.
Here is my code:
...
4
votes
3
answers
413
views
Realizing a swap gate using a commutator sequence and an auxiliary qudit
Say I have two qudits $1$ and $2$, each of which has Hilbert space of dimension $m$. Is it possible to introduce an auxiliary qudit $a$ (of any dimension $d_a\in \mathbb{Z}_{\geq 2}$) and find quantum ...
1
vote
0
answers
47
views
Commuting circuit equivalent to $CX_{ij}CX_{jk}$
Commuting groups are useful to perform circuit optimization.
There is a big branch of research working on circuit construction by means of CZ gates and/or EASE gates. Up to reach an efficient ...
0
votes
2
answers
557
views
Qiskit ERROR: Circuit contains invalid instructions
Recently I encountered a weird qiskit error which produces a pretty useless traceback. To replicate this error, I create a very simple circuit given below:
When I run it on a simulator, I get an ...
2
votes
2
answers
229
views
How to factor $N=14$ with Shor's algorithm?
As a practice exercise, I am trying to factor $N=14$ using Shor's algorithm. My initial guess is $a = 5$, and I need a quantum circuit $U$ for:
$U\vert y \rangle = \vert 5 \cdot y ~{\rm mod}~ 14 \...
1
vote
2
answers
222
views
How to create superposition of all bitstrings with exactly two ones on 4 qubits?
On a quantum circuit, how would I create an equal superposition of the states:
$$|\psi\rangle=|0011\rangle + |0101\rangle + |0110\rangle + |1001\rangle + |1010\rangle + |1100\rangle.$$
1
vote
1
answer
156
views
How to store error caused by circuit manipulation
Given that
is equivalent to
I am interested into not performing the last CNOT. Rather, I want to keep track of the error I intentionally introduced by removing it.
I am trying to do this by means of ...
2
votes
1
answer
110
views
How to calculate a matrix difference in a quantum circuit in the form $A - BAB$
In quantum circuits, every gate is a unitary, and these gates get multiplied together. For example, a simple circuit that performs $X$ on the least significant qubit (i.e., $I \otimes X$), and $CNOT$ ...
0
votes
0
answers
69
views
Method to use nonlinear operators within quantum circuits
I recently learned of a technique known as "block-encoding" which embeds any $M \times N$ matrix into a unitary matrix, given that the spectral norm is at most $1$. This type of result is ...
1
vote
0
answers
30
views
Modeling light transfer through every path with superpositioning
So I asked a question about this topic earlier but since then, I did more digging into this problem.
Researchers at Berkeley experimented with a theory of photosynthesis happening using Quantum ...
2
votes
1
answer
140
views
Implementing controlled rotation for FRQI by using controlled Ry and NOT Gate
I was reading about Flexible Representation of Quantum Images (FRQI) encoding in Qiskit textbook. It says that, given $$\{\theta_0, \theta_1, ..., \theta_{4^{n}-1}\} \quad (\theta_i \in [0,\pi/2])$$ ...
1
vote
1
answer
87
views
Qubit reset using Grover iteration
Suppose I’m building a long circuit and I need to reuse a qubit from a previous step but I don’t want to use the reset operation (or I’m not using an IBM computer so I don’t even have the reset option)...
4
votes
0
answers
32
views
Qiskit: efficient way to create bound circuits?
I am running an optimization problem whose objective function $F(a)$ requires measuring N variational circuits $V_i(a)$ at each evaluation.
So, roughly, I have created N parametric circuits and I do:
<...
1
vote
1
answer
158
views
Is there any shortcut to create a controlled gate or any technique?
I was solving Controlled H gate from qiskit textbook -> Basic Circuit Identities
There I tried to find the unitary matrix for CH gate but it get's really complicated when I use tensor product or ...
0
votes
2
answers
210
views
Is this kind of $T$ injection correct?
I found the protocol in figure on internet, without proof.
Here, $|\omega\rangle = TH|0\rangle$.
It is refered as catalytic injection. I doubt its correctness on the second qubit as it outputs $|\...
1
vote
1
answer
73
views
How to inject a $Y^{\frac{1}{4}}$ gate into a circuit
I need to perform a controlled-$H$ gate, which is non-Clifford.
Its standard decomposition is
$$Y^{-\frac{1}{4}}_b\cdot CX^{\phantom{\frac{1}{4}}}_{a,b}\cdot Y^{\frac{1}{4}}_b.$$
By means of some ...
0
votes
1
answer
149
views
How is the P function applied in QSVT for the case of Hamiltonian simulation if it only modifies singular values?
I am watching Andras Gilyen's talk on QSVT here.
On one slide he mentions the core of QSVT:
Given $U$--- a block encoding of matrix $A$ that has singular values $\lambda$, left singular vectors, $\...
0
votes
1
answer
157
views
How to choose values of phi for Hamiltonian simulation with Quantum Singular Value Transform?
I am reading the review, Grand Unification of Quantum Algorithms, which covers the area known as "Quantum Singular Value Transform (QSVT)."
I am really trying to understand it behind the ...
1
vote
1
answer
723
views
qiskit : can you get circuit from unitary matrix?
In qiskit you can get a unitary matrix from a circuit (circuit to unitary matrix example). Is the opposite direction possible? Can you input a unitary matrix and have qiskit come up with a circuit? If ...
1
vote
1
answer
62
views
ModuleNotFoundError when running Qiskit RNG
I'm trying to generate random numbers using IBMQ backends with the following code:
...
0
votes
0
answers
51
views
How can the result of 1 million transformations on a qubit be verified to be correct?
I tried to do almost a million transformations on a qubit.
I made a three qubit circuit with equal superposition of |0> and |1> (using Hadamard gate) and on the first qubit (qubit 0), added one ...
2
votes
1
answer
137
views
Padding a quantum circuit to increase the amplitude by a constant
Let us be given the description of a quantum circuit $\mathsf{Q}$, acting on $n$ qubits, such that
\begin{equation}
\langle 0^n|\mathsf{Q}|0^n\rangle = \frac{\#0_f - \#1_f}{\sqrt{2^n}},
\end{equation}...
0
votes
1
answer
55
views
How to implement quantum circuit for this operation
I am wondering how to construct a gate for some operation like
$$U = \frac{1}{\sqrt{2}}(I - i \sigma_{x})$$
I don't know how to add two $I$ with $-i\sigma_{x}$ specifically, any help would be ...
1
vote
1
answer
420
views
What Adding Modulo To Register Means
I was reading about the Jordan gradient algorithm(https://arxiv.org/pdf/quant-ph/0405146.pdf) and I am a bit confused about one of the phrases:
Next, use the blackbox to compute
f and add it modulo $...
2
votes
1
answer
185
views
Grover 3-SAT: Interpretation of Quantum Circuit
I'm referring to the Grover implementation for the 3-SAT problem:
https://qiskit.org/textbook/ch-applications/satisfiability-grover.html
For the given problem
the generated quantum circuit is as ...
2
votes
1
answer
47
views
How can one impliment Bennett's partial measurement onto a binomial subspace for state distillation?
I'm reading the seminal paper on entanglement distillation by Bennett et. al.
The idea is that Alice and Bob have $n$ identical copies of an imperfect (but pure) Bell state. The initial state is ...
4
votes
0
answers
111
views
Are there any systematic tools for estimating expected error rate?
Like we all probably know, today’s NISQ computers are, as their name implies - very noisy. Hence, if we desire to obtain valuable results then we should come up with circuit designs that minimizes the ...
4
votes
3
answers
580
views
Creating a uniform superposition of a subset of basis states
Assume we have an n qubit system and $K \subset \{1,...,2^n\}, K \neq \emptyset $
I want to describe a circuit that takes the input $|0\rangle....|0\rangle$ to the state $|\psi\rangle = \frac{1}{\sqrt{...
2
votes
0
answers
55
views
Approximating the concatenation of two approximate circuits
Suppose I have two quantum circuits $A_n,B_n$ that I have already found to approximate the operations $U,V$ within some error $\epsilon_n$ and each with an overall circuit depth $\ell_n$ using $n$ ...
1
vote
1
answer
256
views
CIRQ How to iteratively apply a multi qubit gate to first n qubits
I've got an arbitrary n qubit circuit, with a "for Q in range(n):", which creates a custom gate class that affects (Q+1) qubits, which I want to apply to first (Q+1) qubits of the circuit ...
1
vote
1
answer
89
views
Julia codes for unitary gate decomposition
I am looking for a way to decompose any given operator U into ZYZ rotations. And then plug the values back into ei∗α∗Rz(θ0)∗Ry(θ1)∗Rz(θ2), to 'recompose' the gate and check if the gate decomposed ...