Questions tagged [circuit-construction]
For questions about the construction of complex circuits using elementary quantum gates.
691
questions
2
votes
0
answers
22
views
Controlled Ry gate on IBM and IonQ basis gates
As far as I know the basis gates for IBM and IonQ are:
IBM: ['cx', 'id', 'rz', 'x', 'sx']
IonQ: ['rx', 'ry', 'rz', 'rxx', 'id']
I used qiskit.transpile to see check how Controlled Ry gate can be ...
1
vote
1
answer
81
views
How to find an equivalent circuit without ancilla qubits?
$\newcommand{\ket}[1]{|#1\rangle}$
I have the following quantum circuit:
(The inner qubits are both initialized to $|i\rangle$. $U$ is a arbitrary quantum gate.)
But I am only interested in the ...
0
votes
3
answers
50
views
How to implement multi controlled X gates in Qasm
I wanted to know the easiest way to implement a large multi controlled x gate using Qasm and not Qiskit, if it's possible
2
votes
1
answer
36
views
Increasing qubit limit in Qiskit for benchmarking
I am aware that each backend in Qiskit has a qubit limit. Across all backends in Aer, the limit is 24. When we employ ...
2
votes
2
answers
90
views
How to create the state $(n!)^{-\frac{1}{2}} \sum_{\pi \in S_n} | \pi, \pi (G) \rangle$ when $G$ is an undirected graph and $\pi$ a permutation
Let $G=([n],E)$ be an undirected graph, which is represented by a $n \choose 2$ bit string, by indicating for each $i < j$ if $(i,j) \in E$.
We also denote the state $| G \rangle$ as the $n \choose ...
2
votes
1
answer
82
views
Is it possible to modify the QFT circuit to use only 1-qubit gates?
[Measured Quantum Fourier Transform]
I've recently learned the Quantum Fourier Transform, and was shown its circuit.
The circuit I've seen is composed of Hadamard gates and controlled Rotation gates.
...
4
votes
1
answer
87
views
How does one create a long range CNOT gate on a square grid of qubits using constant depth circuits?
In this talk, the speaker shows a bunch of data qubits on the top and ancilla qubits at the bottom that need to be linked by CNOT gates. The grid here is $n\times n$.
The procedure is to swap the ...
1
vote
1
answer
31
views
What is the explicit action of the following circuit?
Would somebody please be able to explain the action of this circuit to me? (Taken from Arthur Pesah's blog post "Computing with Quantum Codes using Transversal Gates")
I understand overall ...
2
votes
1
answer
68
views
Implementing cphase gate on IonQ through Amazon Braket
I am implementing a VQE algorithm where I need controlled phase gate as part of ansatz circuit. I am using Amazon Braket service. Ionq processor however does not support c-phase gate or phase gate. ...
2
votes
1
answer
115
views
How to make sense of `Pauli observables` in the gate cutting code here?
I am following the tutorial mentioned in the circuit-knitting-toolbox.
This tutorial explains how you can replace non-local gates with local operations in the superoperator representations and ...
1
vote
0
answers
50
views
Qiskit bad unitary decomposition
I want to decompose a two-qubit unitary gate $U$,
$$U = e^{-i \cdot \frac{t}{2} \cdot Z_1 \cdot Z_2}\,,$$ where $t$ is an angle.
I already know the right decomposition but Qiskit gives me an ...
4
votes
0
answers
40
views
Does delaying measurements change the complexity of the circuit?
It's often said that for any quantum circuit with intermediate measurements, there exists an equivalent circuit where all measurements are at the end of the circuit.
Is anything ever argued about the ...
2
votes
1
answer
79
views
How to find a quantum circuit to generate a target state?
I am starting in Quantum Computing, but I am pretty lost, sorry... let's say I need to design a quantum circuit to generate some given quantum states in Dirac's notation, as in the following example, ...
2
votes
1
answer
55
views
Use of $X$ gates in creating probability distribution in a quantum circuit
I have been trying to understand the Grover-Rudolph scheme for loading a probability distribution into a quantum circuit. This article gives a demonstration of this scheme by creating a probability ...
2
votes
2
answers
142
views
How to implement the modular exponentiation implementation in Shor's algorithm?
I am trying to implement Shor's algorithm using modular exponentiation as described in this paper: https://arxiv.org/abs/quant-ph/0205095
The issue is found when trying to implement CMULT($a^{-1}$)mod(...
1
vote
1
answer
93
views
Expectation values using qiskit
Expectation values can be calculated using
$\bf{Matrix}$ $\bf{mechanics}:$
$A$ has eigenvalues $\lambda_j$ and eigenstates $\Phi_j$. Then the expectation value of $A$ with respect to a state
$\Psi=\...
2
votes
1
answer
386
views
How to construct a quantum circuit for quantum Fourier transform in a prime dimensional Hilbert space?
This problem is given as a problem in Nielsen and Chuang. Consider a Hilbert space of dimension $p$ where $p$ is a prime number. Quantum Fourier transform (QFT) in this space is defined as
$$
|j\...
3
votes
1
answer
143
views
Which qubit has the highest $|1\rangle$ amplitude?
Suppose I can prepare $n$ qubits each in an unknown independent state (not entangled). If needed, you can assume that each qubit is in a state $a_i |0\rangle + b_i |1\rangle$ for real numbers $a$ and $...
4
votes
1
answer
252
views
Qiskit reverse_bits is not equivalent to swapping qubits
For three qubits, I thought swapping the first and third qubit is equivalent to vertically flipping the circuit. However, performing one and then the other in Qiskit returns two different operators, ...
0
votes
0
answers
103
views
Adding a phase to a circuit using standard gates
How do I add an arbitrary overall phase to the circuit using standard gates?
Yes, I know that the overall phase it irrelevant, yet this is only true until you control the circuit on extra qubits. Yes, ...
4
votes
1
answer
190
views
Questions on multi-controlled Toffolis and their implementation in Qiskit
Is it possible to decompose an $n$-controlled Toffoli into $O(n)$ CNOTs without extra working qubits?
If so, is such an decomposition currently available in Qiskit or any other (preferably Python and ...
1
vote
1
answer
71
views
general way to decompose a CZ gate on $n$-qubit system
Suppose I have a CZ(i,j) gate (or CNOT) acting on qubit $i$ and $j$, on a $n$-qubit system. Is there a general way to decompose this gate into a set of gates that only involve single-qubit gates and ...
2
votes
1
answer
84
views
Constructing a two 3-qubit state involving either X, Y or Z rotation gate
The goal is to construct the state
$|\psi\rangle = \frac{1}{2}|010\rangle + \frac{\sqrt{3}}{2}|101\rangle$
Two issues I am facing:
What is a good choice for initial state?
What is a good choice for ...
1
vote
0
answers
49
views
Construct of a quantum circuit for the projection $|0\rangle\langle0| + |1\rangle\langle1| $ and its generalizations
We can construct a projection over $|0\rangle \langle 0|$ using a quantum circuit with two qubits via the Hadamard test circuit
$$U = H_1 X_2 CZ_{1,2} X_2 H_1 X_1\,, \tag{1}$$
and by performing ...
2
votes
0
answers
28
views
What is the mathematical rationale for the decompose() function of qiskit?
The decompose() function decomposes the encapsulated quantum module into sets of elementary quantum gates. But what is the math behind its operation? For example how is a diag[1,1,1,1,1-1,1,1,1,1] ...
3
votes
1
answer
99
views
Quantum error correction circuit from stabilizer codes
I am trying to familiarize myself with QEC codes and their use in quantum communication. Right now, I am trying to implement some more widely known codes in Qiskit. My main problem is I cannot wrap my ...
1
vote
1
answer
172
views
How to interpret the circuit that measures stabilizers in the 5-qubit error correcting code
I would like to understand the exact role of the following circuit (By Vtomole - Own work, CC BY-SA 4.0) in the 5-qubit QECC.
The image attached (from Wikipedia) is captioned "Quantum Circuit ...
1
vote
0
answers
66
views
Implementing $n$-bit Toffoli gate with $(2n-5)$ and $(4n-12)$ CCNOT gates
Papers such as Diao et al. "A Quantum Circuit Design for Grover’s Algorithm" implement an $n-1$ bit Toffoli gate with $2n-7$ gates and $n-3$ scratch bits. I want to know if there is a way to ...
1
vote
1
answer
73
views
How to interpret the encoding circuit for the 5-qubit QECC
I have a question on circuit which constitutes the sydnrome measurement for the 5-qubit error correcting code. If I focus on just a portion of the circuit:
Reference for image. The full circuit can ...
2
votes
0
answers
58
views
Efficient gate executing the time evolution of a Hamiltonian using Runge-Kutta method
You can find a minimal working example below.
In particular, I want to replace the scipy.linalg.expm() matrix exponential by a Runge Kutta time evolution method as ...
3
votes
1
answer
161
views
How to apply rotation about X and Z in stim?
I have a quantum circuit illustrated in the provided image, where I perform a series of quantum operations followed by a projective measurement..
Using Qiskit, I've already written the code for this ...
0
votes
2
answers
110
views
Help debugging implementation of Draper QFT adder
I am attempting to implement the adder found in this paper.
Here is the code:
...
0
votes
1
answer
55
views
How to find explicit gate decomposition of a circuit implementing a unitary using HamiltonianGate()?
I'm new to Qiskit.
I am trying to construct a gate from HamiltonianGate(), available on Qiskit. The Hamiltonian in question is:
$$H = - \pi\delta(Z_1 - Z_2)
+ 2\pi J ~ \mathbf{I}_1 \cdot \...
2
votes
0
answers
45
views
Generic circuit for signature matrix
Consider a set $ A = \{a_0,a_2,\ldots,a_{k-1}\} \subset [N] := \{0,1,\ldots,N-1\}$.
Consider the diagonal matrix
\begin{equation}
R := I - 2 \sum_{a\in A} |a\rangle\langle a|,
\end{equation}
which is ...
0
votes
1
answer
79
views
How to simulate a $CNOT$ only using a single qubit?
I am looking to do a $CNOT$ on itself, i.e., if the qubit is in $|0\rangle$ it stays in $|0\rangle$ and if it is in $|1\rangle$ it becomes $|0\rangle$. We are allowed to use $H$, $X$, $Z$, and $CNOT$ ...
3
votes
2
answers
167
views
Encoding circuit for $[\![6, 4, 2]\!]$ code
For the famous $[\![4, 2, 2]\!]$ code, there is a circuit to encode two physical states into the logical state (from Roffe's work):
As $[\![m, m-2, 2]\!]$ is a class of error-detection code, I am ...
1
vote
3
answers
164
views
Map $n$ qubit state with complex amplitudes to $n+1$ qubit state with real amplitudes
For the simplest case, consider a single qubit state $|\psi\rangle$, and assume access to a state preparation unitary $V$ satisfying
$$
V|0\rangle = |\psi\rangle
$$
and
$$
V|1\rangle = |\perp\rangle.
...
1
vote
1
answer
61
views
Superposition on a subset of integers [duplicate]
Assuming I have $n$ qubits and I want to create a superposition out of a subset of integers:$$k∈\{1,...,2^n\},$$ how can I create a circuit that creates a uniform superposition of, for example, $k = 3$...
4
votes
1
answer
77
views
Can the oracle for $f:\{0,1\}^n \rightarrow \{0,1\}^m$ be implemented with only $n+m$ qubits?
(Part 1: Required ancilla qubits for a given function's oracle)
The question is that given a Boolean function $f:\{0,1\}^n \rightarrow \{0,1\}^m$, how many ancilla qubits are required to build its ...
4
votes
2
answers
289
views
Given $f: \{0, 1\}^n\to\{0, 1\}^m$, how many qubits are needed to implement the oracle $\mathcal U|x,0\rangle^{\otimes m}=|x,f(x)\rangle$?
Suppose I am given a function $f: \{0, 1\}^n \to \{0, 1\}^m$.
A standard oracle would be of the form $\mathcal{U}|x\rangle|0\rangle^{\otimes m} = |x\rangle|f(x)\rangle$.
I would suspect that this ...
3
votes
0
answers
47
views
Understanding circuit to Hamiltonian embedding where we do not have a separate clock register
I am trying to understand the clock construction given in this paper, to embed a circuit to a Hamiltonian, which doesn't need to access a separate clock register.
The construction, at a high level, ...
0
votes
0
answers
54
views
How to alter the result of (somewhat) randomly generated circuits?
I create randomly generated circuits by iterating through a list of the gate set (in my case [$CX,SX,RZ,X$]) and adding the gate to the circuit. (In the case of the $CX$ gate we look at the topology ...
0
votes
0
answers
47
views
Quantum Crosstalk in gate scheduling with different gates
I am working on quantum crosstalk, specifically on CNOT and SWAP gate operations that lead to crosstalk. I have encountered works that decompose CNOT and SWAP with iSWAP and CZ gates. I would like to ...
3
votes
0
answers
66
views
Amplitude amplification on each register in a product state
let oracle $U_\psi$ prepare a state $\psi$ with success probability $p$. For simplicity assume that $U$ requires a single ancillary qubit and $\psi$ is itself a single-qubit state:
$$
U_\psi |0\rangle|...
0
votes
0
answers
33
views
How to go from a classical LSTM cell to a quantum LSTM cell where the neural network parts in the LSTM cell's gates are replaced by quantum circuits?
The input data I have is a tensor with shape (num_samples, num_timesteps, num_features). A single datapoint in my problem case is a feature vector of dim = 4 which conceptually corresponds to an ...
1
vote
1
answer
181
views
What's a good Clifford+T circuit for a controlled-controlled-SWAP gate?
Mosca and Mukhopadhyay give a Clifford+T circuit for a three-qubit Fredkin (controlled-SWAP) gate:
This uses four $T$ and three $T^\dagger$ gates at a T-depth of four.
What would the T-count and ...
2
votes
2
answers
182
views
Is the plus state a magic state for the Hadamard gate?
Is the plus state $\left|+\right>:=\frac{\left| 0\right>+\left| 1\right>}{\sqrt{2}}$ a magic state for the Hadamard gate $H$? That is, given the ability to perform (controlled) Pauli ...
3
votes
0
answers
61
views
What's an example of a superposition $\sum_i \sqrt{p_i}|i\rangle$ that cannot be prepared efficiently?
As also discussed in (How does the induction step in the Grover-Rudolph scheme to prepare superpositions from probabilities work? and How does the uncomputation step work in the Grover-Rudolph scheme ...
4
votes
1
answer
123
views
How to implement projective measurement from multiple measurements?
In the following paper by Harrow et al.: https://arxiv.org/pdf/1607.03236.pdf, they want to implement a measurement operator that is the average of a set of measurement operators. On page 9, right ...
2
votes
1
answer
118
views
Does subtraction circuit have a class like full or half Carry adder circuit in qiskit? one subtraction circuit code-example in qiskit?
I need a subtraction circuit to calculate Laplacian in edge processing, but I didn't find any class in qiskit.Do I have to write the code myself?