Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
15 views

Any two level flip in $n$ qubit system

Let start with a multi controlled Toffoli gate. Looking at the matrix representation (in the binary base), you easily see $$ \pmatrix{ 1& 0& 0& 0& 0& 0& 0& 0\\ 0& 1&...
1
vote
1answer
18 views

Rotation of multi-body interaction in quantum circuit

In quantum circuit, how do you implement the rotation of multi-body interaction, such as $e^{-i\theta\sigma_z^1\sigma_z^2\sigma_z^3}$? I already know the case of less than two-body interaction, but I ...
1
vote
0answers
20 views

Repeating Quantum Phase Estimation algorithm

In the Quantum Recommendation Systems paper, the authors use the Quantum Phase Estimation algorithm in a way that is slightly different from what I've seen so far. This is how it is described: The ...
1
vote
1answer
15 views

Why is the number of qubits linear in the inverse of epsilon in Quantum Phase Estimation?

On Wikipedia, one can read the following about Quantum Phase Estimation: the algorithm estimates the value of $\theta$ with high probability within additive error $\varepsilon$, using $O(1/\...
3
votes
0answers
40 views

Matrix mod 2 multiplication

There was a similar question asked here, but I feel like mine is even more basic. What's the easiest way to implement a circuit $U$ corresponding to matrix multiplication modulo 2? $$ |x_1x_2x_3\...
1
vote
1answer
42 views

Does principle of deffered measurement imply information can travel faster than light?

I have been reading the book by Michael A Nielsen and Isaac Chuang and came across the principle of deferred measurement. They showed using this principle how the circuit for quantum teleportation can ...
1
vote
1answer
46 views

I made a simple circuit on qiskit,but I have some question on this result

I made a simple circuit that we can see. In my view, $|00000\rangle$ should appear in one result, but I didn't see it. why?
3
votes
2answers
36 views

How to implement exponentiation of a gate without breaking complexity?

In the application of QFT for quantum phase estimation (QPE) of a unitary $\mathbf{U}$, one has to perform successive controlled operations using powers of $\mathbf{U}$. In order not to break the ...
2
votes
0answers
18 views

Quantum circuit CCX optimization for Grover

I am working on a circuit for a Grover problem and during that I am trying to minimize the used QuBits. The problem is shown in the attached image. In this case the circuit is more or less efficient ...
0
votes
2answers
39 views

How to switch bit in the quantum state?

I want to transform binary representation from one to other. Here, I have 2 registers one act as control register and another is target register with the same number of qubits $n$. Consider $n = 3$ ...
2
votes
1answer
41 views

Quantum circuit to get expectation values of Pauli matrices, given state $|\psi\rangle$

I'm trying to solve 2 linear equations with the help of HHL algorithm. I've taken $A=\begin{pmatrix} 1.5 & 0.5\\ 0.5 & 1.5\\ \end{pmatrix}$ and $b=\begin{pmatrix} 1\\ 0\\ \end{pmatrix}$. I've ...
2
votes
1answer
39 views

Gate corresponding to $-I$

I am implementing a quantum circuit in Qiskit. I create the equal superposition state $$ -|00\rangle + |01\rangle + |10\rangle +|11\rangle $$ but I want to obtain the quantum state $$ |00\rangle - |...
2
votes
1answer
42 views

Rotations to encode $f(x)$ into ancilla qubit for quantum Monte Carlo

I'm trying to understand the quantum monte-carlo algorithm starting at the most basic version. A key step is rotating (Algorithm 1 p.g 8), an ancilla bit by rotation $R$ with respect to the value of a ...
1
vote
1answer
25 views

Uniform superposition of states with one qubit set to $|1\rangle$ and others to $|0\rangle$

I am wondering what a circuit should look like if I want to prepare the state of the following form: $$ |0\rangle^{\otimes n} \mapsto \dfrac{ |1000\ldots0\rangle + |0100\ldots0\rangle + |0010\ldots0\...
2
votes
1answer
40 views

Building a state with parallel execution

I'm trying to implement the main algorithm described in the Quantum Recommendation Systems paper. In order to do this, I have to create a quantum state $|x\rangle$ corresponding to a real vector ...
3
votes
1answer
58 views

Is there a systematic way to build quantum circuits?

The question is quite straightforward. In classical computation, there exists several ways to build logical circuits based on thruth tables and Karnaugh maps. Is there anything equivalent for quantum ...
5
votes
2answers
311 views

Why is Deutsch's gate universal?

(This is related to Exercise 4.44 in Nielsen and Chuang) Deutsch quantum gate is basically a $iR_x(\alpha \pi)$ gate with two control qubits. The constant $\alpha$ is an irrational number that allows ...
0
votes
0answers
46 views

Understanding SGD on a Quantum Circuit

I implemented the following circuit, a very simple circuit: I applied the technique presented on Farhi's paper - which I am so happy people in here are talking about more and more ! - and applied to ...
2
votes
1answer
40 views

How to construct Control-Z with square root of swap?

How to construct Control-Z with square root of swap(up to some single qubit operations)? In some papers it just directly mention that it's possible but didn't tell how to do.
3
votes
0answers
61 views

Aproximating unitaries with elements from a t-design

(This is basically a reference request) I am wondering if there are any results out there on to what accuracy a given unitary can be approximated with an element drawn from a t-design. To ...
0
votes
0answers
53 views

Ising Model, Graphs, and Cirq

How would you explain, pictorially and without too much overhead, an interaction between the qubits on this model using Cirq? I am interested in trying to map accurately the ansatz on Cirq to a ...
1
vote
1answer
46 views

Are $\mathrm{cRz}$ with angle $\pi$ and $\mathrm{cZ}$ equal on the IBM Quantum Experience?

I was trying to implement the 2-qubit Grover algorithm without the auxiliary bit. Before finding the gate symbol for the controlled $\mathrm{Z}$, I worked with the controlled $\mathrm{Rz}$. The gate ...
3
votes
1answer
62 views

General approach for switching control and target qubit

It is well known that circuit can be replaced with this circuit The situation is even easier in case of controlled $\mathrm{Z}$ where gate controlled by $q_0$ and acting on $q_1$ have same matrix as ...
1
vote
0answers
29 views

Primer for Quantum Circuits and Optimization

I am interested in studying physical systems and trying to build circuits to simulate them. Now, of course, all the systems I could try to work with at simple, toy, systems - and that's fine. ...
2
votes
1answer
72 views

Why I am not getting approximate equiprobable states in the following circuit on IBM Q simulator?

I have the following circuit which consists of symmetric modules. I compiled the circuit in IBM Quantum experience backend - ibmq_qasm_simulator, 8192 shots. The result is not equiprobable. Why? Since ...
3
votes
1answer
136 views

Why I am getting transpilation error while executing the following IBM Quantum Experience code?

While executing the following circuit (consisting 16 qubit and 4 classical bits) I am getting "Error in transpilation process. [1003]" error. I have a group of 2 operations (you can observe circuit ...
1
vote
1answer
32 views

Toffoli gates with Hadamard coins (QISKIT)

I am creating the following circuit with Qiskit (2Toffoli gates controlled with coins) And to set the coins for one iteration of the circuit i do the following : ...
3
votes
0answers
80 views

XX, YY, ZZ circuit representations?

Is there a good primer or set of lectures\examples that show entirely how to take a given matrix and developing a circuit that represents it. I am trying to implement a program to find the lowest ...
1
vote
1answer
63 views

Can we add two classical registers in IBM Quantum Experience?

Suppose I have 01 and 11 in classical register 1 and 2 respectively in IBM quantum experience circuit. I want 01 + 11 = 00 mod 4. Can it be done?
2
votes
1answer
59 views

How to make circuit of a 32 X 32 matrix?

I have a 32 X 32 matrix show in the picture below and I want to make a circuit for this matrix. Also in the picture below to the matrix picture I have written the each column in bra-ket notation to ...
1
vote
1answer
48 views

Achieve a control gate with 2 hadamard coins

I want to implement two Toffoli gates with 4 qubits: 3 serving as control qubits (the 2 hadamard coins and one other qubit) and the last one as target qubit and 3 qubits (2 coins 1 target qubits) as ...
5
votes
2answers
82 views

How to prepare mixed states on a quantum computer?

I am a little bit confused by density matrix notation in quantum algorithms. While I am pretty confident with working with pure states, I never had the need to work with algorithm using density ...
1
vote
2answers
203 views

How to construct a IBM Quantum Experience circuit for the following state transformation?

Please help me in building IBM Quantum Experience circuit for: $$ M|0\rangle = \frac{1}{2}(|0\rangle+|1\rangle+|2\rangle+|3\rangle) $$ Edit: Is it possible to make a circuit for a general ...
1
vote
1answer
119 views

Simpler implementation of the Toffoli gate on IBM Q for special circumstances

On current quantum hardware, a depth of circuit is constrained because of noise. In some cases, results are totally decoherent and as a result meaningless. This is especially true when Toffoli gates ...
0
votes
0answers
21 views

Vetting the Circuit Gate for a 3 Qubit Entanglement [duplicate]

While I've seen plenty of examples on how to entangle two qubits, I've (unfortunately) not seen any on the generalized version of entangling multiple qubits, nor how you know your circuit is correct. ...
3
votes
2answers
133 views

If an auxiliary qubit is allowed, how to construct toffoli gate in easier way?

We know if we don't use auxiliary, the construction of Toffoli gate will be: However, if now you are allowed to use one auxiliary qubit, how to realize a CCNOT in a simplier way? (Can we only use X,Y,...
0
votes
2answers
79 views

Swap test to calculate inner product with qiskit for multi-qubit states

Is it possible to perform a controlled swap test with multiple targets with qiskit? I have tried using cswap(ancilla[0],qb1,qb2), where qb1 is an n-qubit register and qb2 is as well
3
votes
1answer
193 views

Implementing QFT for Shor's Algorithm?

I'm studying Shor's algorithm. This diagram shows a calculation of $4^x\mod21$. I don't understand how this expresses $4^x \mod21$. Could you explain this? For example, by showing another calculation ...
2
votes
0answers
35 views

Easiest hash function to implement on Qiskit

Trying to build an Oracle circuit for Grover's algorithm that will try to find a desired input in order to get a certain output of a hash function. Was wondering if there were any 4 or 8 bit hash ...
1
vote
1answer
51 views

How to implement modular exponentiation efficiently in Shor's algorithm?

I'm a noob in quantum computing and I'm trying to get Shor's algorithm working on Q# (the language is unrelated). However, I'm stuck on computing $f(x)$s in the quantum circuit. Let $N\sim \log_2(n)$ ...
3
votes
3answers
132 views

Unentangling a qubit from a system: can we convert $\alpha|000\rangle+\beta|111\rangle$ into $\alpha|00\rangle+\beta|11\rangle$?

Let's say I start with the following arbitrary qubits: $$ \color{red}{\vert Q_1 \rangle = \alpha_1 \vert 0 \rangle + \beta_1 \vert 1 \rangle}\\ \color{green}{\vert Q_2 \rangle = \alpha_2 \vert 0 \...
3
votes
1answer
61 views

Constructing a circuit for $C^1(U)$ for rotation operators with TWO single qubit gates and CNOT gate

This is the exercise 4.23 from Nielsen and Chuang, asking that if it is possible to construct $C^1(U)$ for $U=R_{x,y}(\theta)$ with TWO single qubit gates and CNOT gate. My answer is no, and I would ...
2
votes
1answer
98 views

How to interpret a 4 qubit quantum circuit as a matrix?

This is part of Simon Algorithm (Initial state + some Oracle function) There is a post that explains how to interpret circuits (How to interpret a quantum circuit as a matrix?), but I'm not sure how ...
0
votes
1answer
54 views

How can I build up an arbitrary quantum circuit given a certain unitary matrix operation?

Suppose I want to put a qubit whose initial state is $|0\rangle$ to the final state $\frac{1}{\sqrt{3}}|0\rangle + \sqrt{\frac{2}{3}}|1\rangle$. Well, in that case, the unitary matrix that performs ...
3
votes
0answers
33 views

Stabilizer circuit synthesis via Clifford gates

I have been working with stabilizer codes and I understand the mathematical way that they are described and how to simulate such in a classical computer in order to check their performance. However, ...
2
votes
0answers
57 views

Simulation for the [5,1,3] stabilizer code in Qiskit

Sorry that I keep asking questions for the same subject. It is driving me crazy. I have followed the [5,1,3] stabilizer code circuit designed by Gottesman in page 35 in his paper (also illustrated in ...
2
votes
1answer
125 views

Why is implementation of controlled Hadamard on IBM Q so complex?

With reference to question how to implement CCH gate I easily realized that CH gate can be implemented with $\mathrm{Ry}$ gates and $\mathrm{CNOT}$ followingly: Note $\theta = \frac{\pi}{4}$ for ...
4
votes
2answers
100 views

How to implement the CCH gate in quantum computers available in clouds?

How to implement CCH gate in quantum computers available in clouds? If there is not any gate directly available for it, what are the possible ways to represent CCH?
5
votes
1answer
151 views

Uncomputation in quantum implementation of a classical algorithm

In Nielsens and Chuangs book, they present a way to implement a reversible version of any classical algorithm (section 3.2.5). In short, they use Fredkin and other simple reversible gates to ...
6
votes
1answer
127 views

Decomposing a $(w+1)$-qubit permutation gate into $w$-qubit permutation gates, SWAPs and NOTs

Say I have a quantum circuit of $w+1$ qubits with a permutation gate (mapping computational basis states to computational basis states) that does the permutation $(i, i+1)(i+4, i+5)$ on $w+1$ qubits ...

1
2 3 4 5