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.

8
votes
2answers
264 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. ...
-1
votes
0answers
15 views

What is the physics behind a quantum classifier for labeling quantum states? [on hold]

I am trying to understand what physics is found behind labeling quantum states on the Ising Model.
3
votes
0answers
89 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
507 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
116 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
124 views

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

I have a certain transformations that goes as follows: Given $A=|abc\rangle$, $B=|xyz\rangle$, now I have cases as: $$\text{if }c=1,z=1, b\oplus y=1 \implies \text{flip}(x)$$ $$\text{if }c=1, z=1 \...
4
votes
1answer
95 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
35 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
56 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
78 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
80 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
70 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
174 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
45 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
63 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
49 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
34 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
111 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
119 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
62 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
60 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. ...
2
votes
1answer
167 views

Decompose a general two-qubit gate into general controlled-qubit gates

We often seek to decompose multi-qubit unitaries into single-qubit rotations and controlled-rotations, minimising the latter or restricting to gates like CNOTs. I'm interested in expressing a general ...
4
votes
2answers
123 views

Constructing a circuit which performs the transformation $|x,y\rangle \to |x, x + y \bmod 4\rangle$

When faced with exercises like these, I find it hard to know how to construct the circuits due to the amount of input one needs to account for. I have seen the solution provided here however, I don't ...
3
votes
2answers
213 views

SWAP test inputs

I'm using the SWAP test circuit for implementing a qubit registers comparison From the documentation I could find I've understood it can be applied to input qubits |$\alpha\rangle$ and |$\beta\...
2
votes
1answer
63 views

Forming states of the form $\sqrt{p}\vert 0\rangle+\sqrt{1-p}\vert 1\rangle$

I'm curious about how to form arbitrary-sized uniform superpositions, i.e., $$\frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}\vert x\rangle$$ for $N$ that is not a power of 2. If this is possible, then one can ...
5
votes
3answers
447 views

Is there any method of adding two operators in a circuit?

I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is $$U(t)=e^{-...
1
vote
1answer
67 views

Measurement of a qubit and storage of the information on a bit

Suppose we have the quantum circuit below with a quantum register of 2 qubits and a classical register of 2 bits. The Hadamard gates and CNOT gate are not important for the question. When we measure a ...
4
votes
1answer
88 views

How to construct a quantum circuit (QIP system) for the graph non-isomorphism problem?

I'm having some trouble understanding quantum interactive proof systems (QIP systems) and the related circuit constructions. Interactive proof systems model these type of situations: Interactive ...
2
votes
2answers
51 views

What's my computational basis if I want to define a unitary operator that implements a function such as $f(i) = 2^{i+1} \text{mod 21}$?

I know I must define $U_f$, the unitary operator, on the computational basis. But what's my computational basis here?
5
votes
1answer
129 views

Status of software packages for quantum compiling

By "quantum compiling", what I mean is classical algorithms to solve the following problem: given a $SU(D)$ matrix $U$ (the goal) and a set of $SU(D)$ unitary matrices $V_1 \cdots V_N$ (the gates), ...
2
votes
0answers
41 views

Implement a circuit as a matrix in ProjectQ

Suppose a have a circuit coded up in ProjectQ, suppose also it is that large to be hard enough to write it down as a unitary matrix by hands (e.g. order-finding, which is rather standard, but turns ...
4
votes
0answers
46 views

Correspondence between the Topological model and Quantum Circuit model

For example, given the $R$ & $F$ gates and Toric codes for a given problem, how to convert this code into the conventional circuit model and vice versa. From the literature developed, it seems ...
4
votes
1answer
86 views

Problem with approximating adiabatic evolution with quantum circuit

I am reading on how to approximate adiabatic evolution with quantum circuit and I had some trouble following the arguments given in the early papers which proves this results. I am mainly following ...
3
votes
1answer
62 views

Programming quantum half adder

While computing the carry bit [C=0 XOR (AB)] I am unable to compute that AB in Qiskit. I don't whether Toffoli gate is available in Qiskit. So does anyone know how to perform AB, which is basically ...
3
votes
1answer
127 views

How to decompose 4 qubits Toffoli-gate into two-qubits CNOT gate?

Can I decompose a 4-qubit Toffoli gate into two qubit CNOT gate without ancillary state?
1
vote
1answer
52 views

Multiple random coin flips without measurements

The question is similar to this one. As suggested in the answer, I can easily do this with just one qubit: I repeatedly Hadamard it and measure in order to have a fair coin flip at every point. The ...
2
votes
1answer
141 views

qiskit - Is there any way to discard the results of a measurement?

I have a circuit composed by n qubits, plus a single one which is an ancilla. I'm making multiple measurements on the ancilla at different stages of the circuit, ...
4
votes
2answers
89 views

How to get all combinations of given input?

I'm stuck with a very specific problem that I'm not sure on how to implement using quantum gates. Suppose I have an n qubit circuit and that I want in output a ...
1
vote
1answer
52 views

Why are these circuits not producing the same output?

I am simulating the phase shift algorithm on the Quirk platform. Even when the endian-ness of the built-in inverse QFT gate is corrected for, the circuits still output different results. Shouldn't the ...
3
votes
1answer
118 views

Implementation of inverse QFT?

When implementing the inverse quantum Fourier transform, in addition to reversing the circuit, does one need to take the conjugate transpose of the phase shift gates in the circuit as well?
1
vote
1answer
45 views

Why are these circuits not producing the expected output?

This circuit was created on the Quirk platform. I'm trying to implement a basic case of phase estimation. For some reason, I'm getting this strange result. When the Inverse QFT is broken down, it ...
2
votes
1answer
45 views
2
votes
1answer
85 views

A quantum circuit with entanglement with Eve

I'm trying to work through a self-made exercise, which may be ill formed as a question. Any general advice in dealing with these types of problems is also much appreciated! I'm looking at a quantum ...
4
votes
1answer
100 views

How to analyze highly entangled quantum circuits?

I came across a quantum circuit very similar to the phase estimation circuit, which is shown below: In the ...
2
votes
1answer
79 views

List of known circuits and their expected output

I've written an API which takes in a circuit scaffold, according to some specifications, and outputs the results of simulating the circuit. The circuit constraints are that the measurements are ...
3
votes
5answers
607 views

What circuit or operation corresponds to the tensor product?

What Clifford gate circuit operating on states $|\psi_1\rangle$ and $|\psi_2\rangle$ prepares the state $|\Psi\rangle=|\psi_1\rangle \otimes |\psi_2\rangle$ ?
2
votes
1answer
87 views

How to you encode a network as an adjacency-list in the quantum-gate model?

I have a network problem that I believe would be represented as an adjacency-list on a quantum circuit. Typically, the list is up for traversing from various perspectives (e.g., shortest-path between ...
5
votes
2answers
97 views

Reversible computation without inverting the circuit

I know that if you have a circuit $U$ that transforms $A → B$, it's possible to construct an inverse, ${U\dagger}(B) → A$. Is it also possible to transform the states with $T_{i,o}$ so that I can use ...
3
votes
3answers
100 views

Can we do adiabatic quantum computing with a quantum circuit model and how?

This is a question that must be asked a lot but is it possible? And if in theory possible, what are the challenges to do it, and what are the drawbacks?
7
votes
0answers
75 views

Is it better to use fewer gates or fewer working qubits? [closed]

I have a script that takes a while to simulate. I can modify it in such a way where I can use fewer qubits at a time, but it will require more iterations of manipulation. I believe this will cut down ...