Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [circuit-construction]

For questions about the construction of complex circuits using elementary quantum gates.

Filter by
Sorted by
Tagged with
1 vote
0 answers
19 views

Highly-efficient $n(n+1)$?

Appendix G of this paper provides a highly-efficient way of squaring integer numbers. (LMK if anything more advanced is already available.) I'm wondering if this approach can be easily modified to ...
mavzolej's user avatar
  • 1,971
1 vote
0 answers
36 views

A maximally distant unitary from a parameterized circuit

I have a parameterized circuit that includes a certain number of rotation gates, each parameterized by an angle. By sampling over these angles, I can obtain various unitaries. What are the unitaries ...
trurl's user avatar
  • 131
1 vote
1 answer
45 views

Showing the Toffoli gate can be constructed from one-qubit gates using computer matrix multiplication

I need help coming up with the code that I can use in a computer algebra system like Sage, Python, or Mathematica that can evaluate the circuit. I am not a programmer and used ChatGPT to try to help ...
user2521987's user avatar
0 votes
0 answers
18 views

How can I find out how compatible a quantum circuit is to a backend without executing the circuit

Say I have multiple backends, I need a score to determine how well a backend is suitable for that particular circuit, I have it's noise model too, I tried transpiling the circuit and calculating noise ...
Vishnu Vardhan's user avatar
1 vote
1 answer
52 views

Quantum circuit of stateful oracle

Suppose I have operator $U_f$ that maps state $|x\rangle|y\rangle|0\rangle$ to another state $|x\rangle|y\rangle|f(x, y)\rangle$. The function $f$ has its internal state, that changes on each ...
Georgy Firsov's user avatar
1 vote
1 answer
64 views

How cat state is constructed?

Context: On Wikipedia, a cat state (2-component) is defined as $$ |\text{cat}_+\rangle = C_+(|\alpha\rangle + |-\alpha\rangle) $$ $$ |\text{cat}_-\rangle = C_-(|\alpha\rangle - |-\alpha\rangle), $$ ...
Martin Vesely's user avatar
12 votes
1 answer
927 views

Does the Quantum Fourier Transform require universality?

Background: In most setups of fault-tolerant quantum computation, universality is achieved using Clifford gates such as $(S, H, \text{CNOT})$ and the $T$-gate. The Eastin-Knill theorem can be ...
Frederik Ravn Klausen's user avatar
3 votes
1 answer
268 views

How to simulate low-rank hamiltonian?

I want to implement a unitary $U\,,$ $$U=\text{exp}(-it|u\rangle\langle u|)\,,$$ where $|u\rangle$ is a known state. Are there any methods to do this efficiently?
mingo's user avatar
  • 65
1 vote
1 answer
75 views

Exponentiating a tensor product of operators acting on disjoint qubit registers

Consider a problem of implementing $\operatorname{e}^{i\bigotimes_j O_j}$, where all the $O_j$ terms act on disjoint sets of qubits. Assume that efficient circuits implementing individual $\...
mavzolej's user avatar
  • 1,971
2 votes
1 answer
69 views

Getting rid of extra qubits without changing phase

If I have the state $\frac{1}{\sqrt2}|0000\rangle + \frac{e^{i\phi}}{\sqrt2}|1111\rangle$ and need to get $\frac{1}{\sqrt2}|0\rangle + \frac{e^{i\phi}}{\sqrt2}|1\rangle$, does anyone have any ideas ...
bruhcobell's user avatar
0 votes
2 answers
251 views

What goes above this code fragment?

I have given this circuit: The question goes as follows: What is a code of the above circuit if the barrier is removed? Now I have a code fragment, which is this: ...
Ark Rana's user avatar
1 vote
1 answer
42 views

Appending a gate to a Stim circuit in C++

I am trying to use Stim in C++. Until now, most functionality worked as expected. However, I recently tried to construct a Stim circuit in C++ and pass it to Python via ...
Maurice Hanisch's user avatar
0 votes
2 answers
71 views

Help finding mistake when modifying $T$ injection protocols

I am a little confused about where I am going wrong when computing the action of the following circuit: My understanding is that the CNOT gate acts on the second qubit as a control and the first ...
am567's user avatar
  • 585
0 votes
1 answer
133 views

Hello world program in Qiskit 1.0 [closed]

How do I write a "Hello world" program in Qiskit 1.0, which should be run on IBM cloud and require less than 600 seconds for implementation?
Ausaf Hussain Akhlaq's user avatar
2 votes
1 answer
85 views

How to retrieve a phase gate from a circuit made out of $CX$ and $T$

The extract below comes from this paper. It is an example that shows a basic phase polynomial, related to the $CCZ$ gate. It can also be written with $CX$ and $T$ gates. I can't find the connection ...
Daniele Cuomo's user avatar
4 votes
1 answer
169 views

Is it possible to implement the controlled-S gate, such that the inner gate between the CNOTs belongs to the Clifford?

It's well known how to implement a controlled-U gate when $U$ is a single qubit gate via the decomposition of $U$ into the product $U=e^{i\phi}AXBXC$ where $ABC=I$. My question is: is it possible to ...
Dudu Ponar's user avatar
2 votes
0 answers
26 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 ...
user20762126's user avatar
1 vote
1 answer
89 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 ...
upe's user avatar
  • 269
0 votes
3 answers
89 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
beginnerCoder7's user avatar
2 votes
1 answer
42 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 ...
Zee's user avatar
  • 391
2 votes
2 answers
103 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 ...
Gabi G's user avatar
  • 229
2 votes
1 answer
116 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. ...
Gabi G's user avatar
  • 229
4 votes
1 answer
94 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 ...
user1936752's user avatar
  • 2,997
1 vote
1 answer
34 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 ...
am567's user avatar
  • 585
2 votes
1 answer
72 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. ...
F1_light's user avatar
1 vote
1 answer
143 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 ...
user avatar
1 vote
0 answers
57 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 ...
Daniele Trisciani's user avatar
4 votes
0 answers
43 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 ...
Ethan's user avatar
  • 61
2 votes
1 answer
103 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, ...
xCovelus's user avatar
  • 123
2 votes
1 answer
61 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 ...
kerrwe's user avatar
  • 31
2 votes
2 answers
154 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(...
Juan Manuel Pavon's user avatar
1 vote
1 answer
331 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=\...
Wolfgang Geist's user avatar
2 votes
1 answer
470 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\...
Abu Saleh Musa's user avatar
3 votes
1 answer
147 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 $...
jchadwick's user avatar
  • 451
4 votes
1 answer
288 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, ...
Dylan VanAllen's user avatar
0 votes
0 answers
148 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, ...
mavzolej's user avatar
  • 1,971
4 votes
1 answer
256 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 ...
mavzolej's user avatar
  • 1,971
1 vote
2 answers
118 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 ...
user185671631's user avatar
2 votes
1 answer
99 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 ...
Physkid's user avatar
  • 518
1 vote
0 answers
63 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 ...
incud's user avatar
  • 721
2 votes
0 answers
31 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] ...
Ren-Xin Zhao's user avatar
3 votes
1 answer
126 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 ...
Narcano's user avatar
  • 31
1 vote
1 answer
253 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 ...
am567's user avatar
  • 585
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 ...
requiemman's user avatar
1 vote
1 answer
79 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 ...
am567's user avatar
  • 585
2 votes
0 answers
64 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 ...
ANDREAS kruckenhauser's user avatar
3 votes
1 answer
212 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 ...
Manna's user avatar
  • 31
0 votes
3 answers
178 views

Help debugging implementation of Draper QFT adder

I am attempting to implement the adder found in this paper. Here is the code: ...
Jackson Walters's user avatar
0 votes
1 answer
65 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 \...
Pratham Hullamballi's user avatar
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 ...
Cuhrazatee's user avatar

1
2 3 4 5
15