2022 Developer Survey is open! Take survey.

Questions tagged [quantum-circuit]

a model in which a computation is a sequence of quantum gates, which are reversible transformations on an n-qubit register (the quantum-mechanical analog of an n-bit register)

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

About Quantum tomography

Imagine I have a classical data(normalised to fit qubit) in the form of$\alpha_1,\alpha_2,\beta_1,\beta_2$ I assumed data to be in qubit $$\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\...
user avatar
3 votes
0 answers
71 views

How to construct a quantum circuit that given $|\psi_0\rangle,|\psi_1\rangle$ outputs $\frac{1}{c}(|\psi_0\rangle+|\psi_1\rangle)$?

Suppose I have two arbitrary quantum states $\lvert \psi_1 \rangle $ and $\lvert \psi_2 \rangle$. Further suppose that we know $U_1$ such that $\lvert \psi_1 \rangle = U_1 \lvert 0 \rangle$, but we ...
user avatar
  • 123
3 votes
4 answers
309 views

Cost of SWAP gate

We know that a SWAP gate needs three CNOT gates but I have seen papers which say that a SWAP gate can be achieved by necessary rewiring can are not counted towards the final quantum cost. I am ...
user avatar
1 vote
1 answer
52 views

Can you construct a 3-qubit XOR state?

I'm wondering if it is possible to build a 3-qubit quantum circuit that creates the following pure state: $$\frac{1}{2}\left(|000\rangle+|011\rangle+|101\rangle+|110\rangle\right)=\frac{1}{2}\left[1,0,...
user avatar
  • 77
1 vote
1 answer
35 views

I have question about cost of 'modular multiplication unitary' in Shor's algorithm

Here modular multiplication unitary means $U_a : |s\rangle \to|as\mod N\rangle$. My main question is, can the modular multiplication unitary $U_a$ can be constructed in time polynomial in the number ...
user avatar
2 votes
1 answer
40 views

What is the average amount of gates needed to implement a random Clifford gate?

Given a Clifford gate acting on $n$ qubits is implemented using its generators, what is the average number of gates needed to implement a random Clifford gate as a function of $n$?
user avatar
2 votes
1 answer
59 views

Construct a two-qubit quantum gate with given action using the gates ${CNOT, H, T}$

Using the gates ${CNOT, H, T}$, construct a 2-qubit gate that acts as follows on the computational basis $ |0⟩⊗|0⟩ = |0⟩⊗|0⟩ $ $ |0⟩⊗|1⟩ = e^{pi*i/4}|0⟩⊗|1⟩ $ $ |1⟩⊗|0⟩ = e^{pi*i/4}|1⟩⊗|0⟩ $ $ |1⟩⊗|1⟩ ...
user avatar
2 votes
1 answer
87 views

(Exercise-verification) Basic exercise on a 3 qubits circuit

I have an exercise but not the answer, can somebody tell me if this is correct? Here is the exercise and my answers: Consider the following unitary operation $$ U = (CNOT_{13} \otimes I_2)(CNOT_{12} ...
user avatar
  • 97
1 vote
2 answers
315 views

Can anybody explain the following circuit?

I think I understand what it does. But i can't agree with output for sertain inputs. For example: if a=1 and b=1 then how the output on 4 line could be xor(a, b). Because as far as I know xor(1,1)=0 ...
user avatar
  • 21
2 votes
1 answer
52 views

"Bennett’s trick" for reversible circuits

A textbook approach, attributed to Charlie Bennett, for creating reversible circuit which outputs the input qubits and the initialized ancilla qubits involves copying the function output between the ...
user avatar
  • 21
2 votes
1 answer
34 views

Calculating entanglement with CRZ Gates on non-neighbor qubits

I'm trying to prove that my quantum circuit is behaving the way I want it to, which means I want to calculate its state vector. Until entanglement, I can show it works using the bloch-sphere - after ...
user avatar
  • 147
4 votes
1 answer
99 views

Constructing a pure state in Bloch sphere using 3 gates

We have the 3 following gates : $$ H = \dfrac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1 \end{bmatrix} $$ $$ R(\varphi) = \begin{bmatrix}1 & 0 \\ 0 & e^{-i\varphi} \end{bmatrix} $$ $$ ...
user avatar
  • 97
1 vote
1 answer
41 views

Manually calculating quantum circuit with custom gate

I am trying to calculate the state of this Quirk circuit by hand: where U is a custom gate with 2x2 matrix: From what I've read, I should be able to calculate the resultant amplitudes as: (U⊗I⊗I).(...
user avatar
1 vote
1 answer
88 views

Is there a non one-way quantum computer?

Be it theoretical proposal or anything else, is there even a definition for non one-way (or non measurement-based) quantum computer/computation?
user avatar
1 vote
2 answers
108 views

Best way to measure similarity of two quantum circuits?

Suppose you have some unknown circuit X. You don't know the structure of circuit X, but you do have a set of inputs and corresponding outputs, i.e. you know what the circuit does. Then suppose you ...
user avatar
3 votes
2 answers
105 views

Estimating imaginary part of an inner product of two quantum states

Suppose I want to estimate $Im(\langle \psi_1\lvert \sigma_x\lvert \psi_2\rangle)$ by using quantum circuit. At first, I thought of using the Swap test, but since it gives $|\langle \psi_1|\psi_2\...
user avatar
0 votes
1 answer
58 views

How to get the matrix of a quantum circuit when the ancilla qubit is set to a specific state?

I would like to get the matrix form of a quantum circuit, representing the operation on normal qubits, after specifying the ancilla qubit at a given state. Is there any way to realize this using ...
user avatar
0 votes
2 answers
50 views

What is measure_all function and the vertical dotted line represent in the circuit?

For the following code qc = QuantumCircuit(2) qc.cx(0,1) qc.measure_all() qc.draw() Q1: What this vertical dotted line represent in the below circuit diagram? Q2: '...
user avatar
1 vote
0 answers
18 views

Why can't phonon vacancy be used to trap ions? [closed]

Provided symmetric coulomb repulsion forces, I can't see why one could not dope an ion on a hetero structure that could confine the ion without interacting with either substrate-circuit or ionized ...
user avatar
  • 11
1 vote
1 answer
38 views

Are there quantum circuits or quantum algorithms that generate arbitrary discrete distributions?

Are there quantum circuits or quantum algorithms that generate arbitrary discrete distributions? such as a discrete normal distribution.
user avatar
-1 votes
1 answer
43 views

Quantum ripple-carry adder construction

I am attempting to build a 2-bit ripple-carry adder, using IBM Quantum Experience composer, but I'm confused on how to construct the carry transpose that is shown at the bottom?
user avatar
  • 143
1 vote
0 answers
48 views

Equivalence of Topological Quantum Computing and the Quantum Circuit Model

It is my understanding that topological quantum computers are capable of executing an arbitrary quantum circuit with a polynomial overhead of translating the circuit to the native topological ...
user avatar
  • 495
1 vote
1 answer
58 views

In the Bernstein-Vazirani algorithm, what is the use of the second Hadamard gate?

In the Bernstein-Vazirani algorithm, what is the use of the second Hadamard gate? What happens if I remove it? Would the algorithm works fine? I read something about it closing the interference.
user avatar
  • 143
2 votes
2 answers
119 views

Remove Inactive Qubits from Qiskit Circuit

Is there any way to remove unused/inactive qubits from my Qiskit circuit? For example, I have the register $x0\_float$ who has an unused qubit $x0\_{float}_0$ (see image), For context, my code is ...
user avatar
5 votes
1 answer
120 views

Construction of unitary matrices built from linear combination of Pauli strings

Let's define $P_k \in \{ I, X, Y, Z \}^{\otimes n}$ and called each of these $P_k$ as a Pauli string (or word) then given that $$U = \sum_{k=1}^L c_kP_k $$ with the following conditions: $\sum_{k=1}...
user avatar
  • 12.3k
1 vote
1 answer
41 views

extracting the Pauli error on the data qubits at the end of circuit in stim

Let's say one implements the following circuit in stim from the stim tutorial: ...
user avatar
  • 113
2 votes
1 answer
33 views

How to write the code for decomposing only a subset of gates in a quantum circuit via Qiskit?

I have a quantum circuit with a number of gates, and some of them are labeled by some letters without showing the details inside. I have known the quantumcircuit.decompose() would help, but it would ...
user avatar
6 votes
3 answers
240 views

Transforming a Quantum State to a superposition of its inverse [duplicate]

Does there exist a circuit that allows you to transform a quantum state into a superposition of its inverse; i.e., transform a state into an equal superposition of all basis states that are orthogonal ...
user avatar
1 vote
1 answer
61 views

What are some references discussing the generation of quantum circuits with genetic algorithms?

I have recently saw that quantum circuits can be generated using genetic algorithms. These are called as Evolvable quantum hardware. Please provide me some links of good papers or books related on ...
user avatar
7 votes
1 answer
134 views

Circuit from finite group of gates and classical simulations

Let $ G $ be a finite group of quantum gates. Is it true that any circuit made using only gates from the finite group $ G $ can be efficiently simulated on a classical computer? Here by circuit made ...
user avatar
2 votes
1 answer
38 views

How to interpret photon number 'gates' in quantum circuit?

Peng et. al. Describe a circuit for entanglement cloning (i.e. entanglement broadcasting) which on its own looks fairly straightforward: Confusingly however, the gates $U_1$ and $U_2$ are not logical ...
user avatar
  • 105
2 votes
0 answers
18 views

How to simulate these Floquet and Rotation operators for kicked top model?

In this and other papers relating to the kicked top model, it is mentioned that spin coherent states can be expressed as: $$\left|\theta,\phi\right>=R(\theta,\phi)\left|j,j\right>$$ for given ...
user avatar
  • 31
1 vote
0 answers
47 views

Use parametrized quantum circuit output amplitudes for training in tensorflow

I am trying to train a quantum neural network in tensorflow_quantum (tfq). Using cirq.Circuit I have set up my circuit. I now need to wrap it in a keras model for ...
user avatar
2 votes
1 answer
35 views

How can one sort two registers without leaving an entangled ancilla behind used for comparison?

If we have an state $\alpha|abc\rangle + \beta|bad\rangle$, and we know that $a<b$, how can we obtain state $\alpha|abc\rangle + \beta|abd\rangle$ without entangled ancillas, if we don't know $c$ ...
user avatar
  • 401
0 votes
3 answers
122 views

How to flip qubit C if (A xor B)=1?

Assume I have tree qubits (A,B, and C) I would like to flip qubit C if (A xor B)=1. The gate CCNOT(A,B,C) will flip C if A and B are both one. Please let me know if there is a solution.
user avatar
2 votes
1 answer
71 views

Is there a way to prove that the number of gates in Exercise 4.22 of Nielsen and Chuang's book is the smallest possible number?

I've been going over Nielsen and Chuang's Quantum Computation and Quantum Information and I ran into Exercise 4.22, which says, Prove that a $C^{2}(U)$ gate (for any single qubit unitary $U$) can be ...
user avatar
7 votes
2 answers
882 views

What is this circuit doing?

Can anyone help me understanding what is this circuit doing ? The circuit can be reproduced with qiskitas follows: ...
user avatar
  • 115
3 votes
1 answer
201 views

Is there a way to decompose a quantum circuit into a Clifford subcircuit and a non-Clifford subcircuit?

Is there any way of decomposing a arbitrary quantum circuit into two sub circuits, first of them being composed only of Clifford gates and the second one only of non-Clifford gates? Thank you!
user avatar
3 votes
1 answer
155 views

How to perform a controlled Pauli string rotation gate?

I would like to know some circuit decomposition for an arbitrary controlled Pauli string rotation: \begin{equation} |0\rangle\langle 0| \otimes e^{i \theta (P_1\otimes...\otimes P_n)}+ |1\rangle\...
user avatar
  • 401
3 votes
3 answers
105 views

Measuring in rotated basis for mult-qubit circuits

In a previous question (and others), someone asked about measuring on a basis other than the computational one, but for one qubit circuit. Here it was asked for a specific basis. Suppose I have a two-...
user avatar
0 votes
1 answer
64 views

Using qml.AmplitudeEmbedding two times in a circuit raises an error

I'm trying to use qml.AmplitudeEmbedding() two times in a circuit but it raises an error saying that the device used does not support this feature.
user avatar
0 votes
0 answers
22 views

TypeError: File does not start with OPENQASM descriptor

I am trying to use the python tool PYZX to optimize my quantum circuit. In their documentation, they give this specific command to run on your circuit to optimize it. ...
user avatar
3 votes
1 answer
74 views

How to build a quantum circuit of a given reversible function?

Given a function $f : \{0,1\}^n \longrightarrow \{0,1\}^m$ and a function $g : \{0,1\}^m \longrightarrow \{0,1\}^n$ that both can be computed by polynomial-size classical circuits such that $g(f(x))=x$...
user avatar
  • 119
3 votes
1 answer
51 views

Hadamard Test Circuit Missing Term

I am trying to understand a specific Hadamard Test circuit used to calculate the direct product coefficient $$ B_{l,m} = \langle 0|V^{\dagger} A^{\dagger}_m A_l V |0\rangle $$ where $V$ is a ...
user avatar
  • 97
1 vote
2 answers
48 views

Are ancillary qubits necessary to represent a syndrome measurement in the circuit model?

From my understanding, in QEC with stabiliser codes, one can use the operator formalism and state to perform a measurement over a space which is orthogonal to the code space. This allows to not ...
user avatar
1 vote
1 answer
60 views

Can we design a circuit that outputs desired estimates?

If we have state $\lvert\psi\rangle \in (\mathbb{C}^{2})^{\otimes n}$ in an $\textit{n}$-qubit system with Pauli operators $P$ such that $P \in \{I, X, Y, Z\}^{n}$, how can we design a circuit/...
user avatar
  • 153
4 votes
1 answer
147 views

What is a simple example showing the issues of not doing the "uncomputation" step?

I'd like to ask rather some basic questions regarding "uncomputation". I understand the operation itself and returning the garbage bits back to the original product states .. etc. But I ...
user avatar
2 votes
1 answer
143 views

Non-unitary gates in qiskit

We are programming with Qiskit and for our research project we need to insert non-unitary gates within a quantum circuit. Is the unitarity of gates a mandatory property required to run the code ...
user avatar
2 votes
3 answers
105 views

Find a circuit implementing a 3-qubit unitary matrix preparing $|b\rangle\simeq(0,c,c,c,c,c,c,0)$ with $c=1/\sqrt6$

I am trying to find a circuit to represent a 3 Qubit unitary matrix such that $U|0\rangle = |b\rangle$ for $b = \left[0~c~c~c~c~c~c~0\right]$, where $c = 1/\sqrt{6}$. Although I am working in Qiskit, ...
user avatar
  • 97
0 votes
1 answer
82 views

The statevector of the quantum circuit

I have tried to solve this problem many times. But I can't solve this. Please somebody help me. (prep has no meaning) ${O_1}$ : $O_2$: What is the state vector $|\psi\rangle$ (for qubits 1 and 2) ...
user avatar
  • 1

1
2 3 4 5