Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [circuit-construction]

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

1
vote
0answers
8 views

Understanding CNOT gate for indirect measurement

I am trying to write a simple circuit to understand the process of finding the set of parameters such that the cost function of that circuit in question is minimized. For that I understand one has to ...
3
votes
0answers
16 views

How many two-qubit gates required for general N-qubit unitary?

Is there a known formula or a scaling behaviour for how many two-qubit gates are required to construct a general N-qubit unitary? I suppose there are several cases to consider: Exact representation ...
3
votes
1answer
47 views

Implementing a complex circuit for a Szegedy quantum walk in qiskit

Problem definition I'm implementing a quantum circuit in qiskit for a Szegedy quantum walk, (reference, Fig 21.). It uses two registers of dimension $N$ ($N=3$) each one. The challenges I'm facing ...
4
votes
1answer
27 views

Simulating a 3-local Hamiltonian Term

This may be a fairly basic question, but in Nielsen & Chuang, the following circuit is given for simulating $\exp\left(-i\Delta t Z_1 \otimes Z_2 \otimes Z_3\right)$: which uses an ancilla qubit ...
7
votes
2answers
118 views

How to program a controlled Hadamard-Hadamard gate?

I'm trying to program a controlled gate as the figure below in Qiskit. Should it be sufficient to separate and control individually the Hadamard gates?
3
votes
0answers
24 views

Can anybody explain or suggest a good reference on how to make a modular exponentiation circuit for N=15 with any coprime base?

I have read many papers related to it but in every paper, they just show the circuit of order finding algorithm for N=15, but did not explain what is the procedure to make it. It will be great if ...
6
votes
0answers
33 views

Sequential circuit using quantum gates

Without feedback/loop how can we build a sequential circuit? The basic feature of sequential circuit is that is depends not only on the current inputs but also on the previous inputs/outputs. I've ...
3
votes
1answer
55 views

Quantum Fourier Transform without SWAPs

The Quantum Fourier Transform from Nielsen and Chuang chapter 5 is pictured here: In the textbook the author refers to "swap gates at the end of the circuit which reverse the order of the qubits". ...
4
votes
1answer
41 views

Quantum gate teleportation T gate

I am faced with the problem of teleporting certain gates using modified Bell states. For example, I have solved the problem with the $S$ gate, which is defined as following: Alice and Bob share a ...
1
vote
0answers
19 views

Controlled controlled adder gates involved

Let's say I have a circuit that given in the figure As we can see that this circuit consists of $2$-Toffoli gates and $4$ C-NOT gates, and to construct this entire circuit using only single qubit ...
3
votes
1answer
35 views

Primer for learning about quantum circuits simulating systems

I am interested in a couple of books or arXiv links to learn how to develop quantum circuits for the purpose of simulating quantum multi-body systems. Moreover, I am interested in learning how to ...
7
votes
0answers
42 views

Summation of amplitudes [duplicate]

I was wondering how to create generalized entangled superpositions of qubits when I came to need of an algorithm to generate the following: Suppose we have two $n$ qubit states, $$|\psi\rangle = \...
2
votes
0answers
44 views

Restoring an initial state after computation

Let me first tell my problem statement. Suppose I have a uniform superposition of states $$|A\rangle=\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|0\rangle^{\otimes 8}|i\rangle|j\rangle|k\rangle,$$ where $|0\...
3
votes
1answer
74 views

2-qubit QFT in IBMQ: controlled phase rotation

I've started getting into quantum computing in the last few days. As part of the learning, I've figured it would be fun to implement some circuits on IBMQ Experience as I learn. So now I'm stuck with ...
2
votes
0answers
51 views

Tensorial notation for this quantum XOR circuit

Suppose I have this quantum XOR circuit; this is a quantum circuit for the classical XOR operation $$\begin{eqnarray*} x_1'= x_1\oplus x_2\oplus x_3\oplus x_4,\\ x_2'=x_2\oplus x_3\oplus x_4\oplus x_5,...
1
vote
1answer
47 views

Quantum operation in blocks

I have $n$ states in superposition $|A\rangle=\dfrac{1}{2^{l/2}}\sum_{i=0}^{2^l-1}\sum_{j=0}^{2^l-1}|0\rangle^{\otimes q}|i\rangle^{\otimes l}|j\rangle^{\otimes l}$. Now I have to apply the transform ...
1
vote
0answers
53 views

Quantum operation involving permutation

Suppose I have the state $\frac{1}{2^l/2}\sum_{i=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |i\rangle^{\otimes}|0\rangle_i^{\otimes l}$. I perform some unitary transformation between the registers $|i\...
3
votes
1answer
787 views

Can someone walk us through Nielsen's proof on a circuit for quantum teleportation?

Michael Nielsen posted on Twitter about a proof on a circuit for quantum teleportation. Had some fun this afternoon re-analyzing the circuit for quantum teleportation. Here's a proof I found that ...
4
votes
1answer
75 views

Most efficient way for general state generation

Assume we are given an $n$-qubit system and complex numbers $a_0, \ldots, a_{m-1}$ with $m = 2^n$. Assume further we start with the initial state $|0 \ldots 0\rangle$ and want to make the ...
5
votes
1answer
47 views

How to encode MNIST data set on a quantum circuit to study supervised learning with QNN?

I am trying to implement arXiv:1802.06002†. I do not understand how to take the data set from MNIST and apply it to a quantum circuit. [†]: Classification with Quantum Neural Networks on Near Term ...
2
votes
1answer
155 views

Circuit construction and Dirac notation of the following operation

I have a state $$ |\tilde{\Phi_2}\rangle =\dfrac{1}{2^{3l/2}}\sum_{x=0}^{2^l-1}\sum_{y=0}^{2^l-1}\sum_{z=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |x\rangle^{\otimes l}\otimes |y\rangle^{\otimes l}\...
4
votes
1answer
84 views

Circuit construction for execution of conditional statements using least significant bit

Suppose I have integers and encode them as binary strings for example: $$|0\rangle=|00\rangle,|1\rangle= |01\rangle,|2\rangle=|10\rangle,|3\rangle=|11\rangle.$$ Now an $n$ bit integer, say $x$, is ...
0
votes
1answer
127 views

How do I translate a quantum circuit for computing x + y mod 8 into a program?

I have made the above quantum circuit that gives the mod $8=2^3$ operation between $|x\rangle$ and $|y\rangle$. Now I want to write its corresponding program using some language. Where can I do that i....
1
vote
1answer
55 views

Implementing a controlled sum operation

I want to implement a controlled operation that involves the following: we have the following qubits: $|x_0\rangle,|x_1\rangle,|0\rangle,|1\rangle,|z_0\rangle,|z_1\rangle$. I want to add the first ...
1
vote
0answers
24 views

Implementing conditional operators in a quantum circuit

I have 4 states say $|00\rangle, |01\rangle,|10\rangle, |11\rangle$. I want to add the states in a manner such that $|a\rangle=|00\rangle\otimes|01\rangle\to |00\rangle\otimes|01\rangle$ and $|b\...
1
vote
1answer
49 views

Implementing piecewise functions on a quantum computer

I am curious about how to do implement functions like $$f(x)=\begin{cases} 2x &\text{if} &0\leq x <0.5 \\ x/2 &\text{if} &0.5\leq x<1 \end{cases}$$ Do we implement this like ...
3
votes
1answer
63 views

Cost of implementing Boolean function quantumly?

Say, I wanted to implement a unitary $U_f$ to compute a Boolean function $f:B_n \to B_n$. This is done by the unitary $$U_f|x\rangle | y \rangle = |x\rangle|y\oplus f(x)\rangle$$ which one can ...
3
votes
0answers
57 views

How to implement the mixed quantum state fidelity in a quantum circuit?

Suppose we use Uhlmann-Josza fidelity $F(\rho, \sigma):=(\mathrm{tr}\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}})^2$, can we construct a quantum circuit that help us to calculate the fidelity of two mixed ...
2
votes
2answers
72 views

Tips and tricks for constructing circuits to generate arbitrary quantum states

I see a question quite a lot in past exam papers that goes like propose a quantum circuit that generates the state $|\psi \rangle$ given the initial state $|\phi\rangle$ Here's an example: Given the ...
2
votes
1answer
55 views

Is it possible to construct an equivalent quantum circuit from a CORDIC-based digital circuit?

DaftWullie mentions an interesting point here: let's assume that we know an efficient classical computation of $f(x)$. That means we can build a reversible quantum computation that runs in the same ...
8
votes
2answers
306 views

How is it possible to implement unitary operator when its size is exponential in inputs?

A quantum circuit can use any unitary operator. Its matrix is exponential in the number of input bits. In practice how can this ever be possible (aside from operators which are tensor products), i.e. ...
4
votes
0answers
109 views

How to build a quantum circuit representing the Ising Model?

Can someone explain to me how to build a quantum circuit representing the Ising Model? I just want to understand how to represent the Ising Model for the purposes of quantum state label classification....
4
votes
2answers
533 views

How to superpose two composite qubit states?

Assuming we have two sets of $n$ qubits. The first set of $n$ qubits is in state $|a\rangle$ and second set in $|b\rangle$. Is there a fixed procedure that generates a superposed state of the two $|a\...
2
votes
1answer
142 views

Quantum addition and modulo operation using gates

I have a matrix equation $X_{\text{new}}=AX_{\text{old}}$, where $A=\begin{bmatrix}1 & 1 & 1\\ 2 & 3 &2\\ 3&4&4 \end{bmatrix}\bmod 64$, and $X_{\text{old, new}}\in \{1,2,...64\}...
1
vote
1answer
163 views

How to construct a quantum circuit for the following state transformation?

                       I have a certain transformations that goes as follows: Given $A=|...
4
votes
1answer
129 views

Understanding quantum circuit diagrams: a circuit that compares two states $|YX\rangle$ and $|AB\rangle$

I have a quantum circuit which I would like to understand, which compares two standard basis states $|YX\rangle$ and $|AB\rangle$. It operates on the corresponding bits in each of the two states: i.e.,...
2
votes
0answers
45 views

N&C quantum circuit for Grover's algorithm

In the chapter about the Grover algorithm, it is suggested that the gate which executes the phase shift is given in the following form: Now I have looked at this gate in detail and come to the ...
2
votes
1answer
76 views

Evolving a quantum circuit using a genetic algorithm

I've written a small quantum circuit simulator in python, so now I'm trying to evolve some circuits via genetic algorithms. My encoding is very simple, it's just a rectangular table of strings ...
4
votes
2answers
141 views

How to calculate circuit depth properly?

Is the circuit depth the longest sequence of gates applied on one of the qubits? Or is it something more complicated?
5
votes
3answers
85 views

Summing states of two qubit registers

I'm addressing the implementation with gates of an algorithm where there is the need of creating a qubit register $|\Psi\rangle$ starting from two input qubit registers $|a\rangle$ and $|b\rangle$, ...
2
votes
1answer
172 views

Deutsch–Jozsa algorithm: why is $f$ constant?

I'm trying to understand how the Deutsch–Jozsa algorithm works with the following circuit: Circuit in Quirk Since we have the top 2 wires measuring $|0\rangle$ with 100% probability, it means $U_f$ ...
4
votes
1answer
215 views

How to complete this teleportation circuit? How to create a copy of $|\psi〉$?

This is a quantum circuit. M represents the act of making a measurement on the first two qubits. The circuit is supposed to transfer the state $|\psi\rangle = a |0\rangle + b |1\rangle$ ($a, b \in \...
2
votes
1answer
50 views

Estimation of Z in the quantum Euclidean algorithm

In this paper there is a quantum algorithm that can estimate the distance between a given vector U and a set of vectors V (by taking the mean). In some part of the algorithm, we need to find the sum ...
2
votes
1answer
81 views

Implementing an oracle

Suppose $x$ is an $N=2^n$ elements database. Let's define a $2N$-bit database with $y \in \{0,1\}^{2N}$ indexed by $(n+1)$-bit strings $j=j_1\ldots j_n j_{n+1}$, where \begin{align} y_j=\begin{cases}...
3
votes
2answers
55 views

How can I invert the least significant bit of a certain term of a superposed state?

Say I have $$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|0\rangle + |3\rangle|73\rangle|2\rangle\bigr).$$ How can I change that into $$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|1\rangle + |...
2
votes
0answers
39 views

How to simulate a simple circuit to add two numbers in Quirk?

I am new and I don't understand where I should give the input and where I should get the output. Please explain with an example of a circuit run on the Quirk simulator. How to add two numbers?
4
votes
2answers
115 views

POVM three-qubit circuit for symmetric quantum states

I have been reading this paper but don't yet understand how to implement a circuit to determine in which state the qubit is not for a cyclic POVM. More specifically, I want to implement a cyclic POVM ...
5
votes
0answers
130 views

Circuit construction for Hamiltonian simulation

I would like to know how to design a quantum circuit that given a Hermitian matrix $\hat{H}$ and time $t$, maps $|\psi\rangle$ to $e^{i\hat{H}t} |\psi\rangle$. Thank you for your answer.
2
votes
1answer
121 views

Building an N-qubit Controlled S Gate

I've been beating my head against this problem for three days now and I just can't seem to crack it. To construct an N-qubit controlled Unitary gate, I can do something like this (note I'm using ...
4
votes
1answer
73 views

Garbage-Free Reversible Binary-To-Unary Decoder Construction

In designing reversible circuits one of the useful circuits is the decoder. The operation of a decoder is naturally reversible, so it makes sense to be able to create one with no garbage outputs. ...