Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
28
votes
2answers
2k views

How is the oracle in Grover's search algorithm implemented?

Grover's search algorithm provides a provable quadratic speed-up for unsorted database search. The algorithm is usually expressed by the following quantum circuit: In most representations, a crucial ...
13
votes
2answers
2k views

Given a decomposition for a unitary $U$, how do you decompose the corresponding controlled unitary gate $C(U)$?

Suppose we have a circuit decomposition of a unitary $U$ using some universal gate set (for example CNOT-gates and single qubit unitaries). Is there a direct way to write down the circuit of the ...
8
votes
2answers
357 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.
8
votes
1answer
315 views

Understanding the Group Leaders Optimization Algorithm

Context: I have been trying to understand the genetic algorithm discussed in the paper Decomposition of unitary matrices for finding quantum circuits: Application to molecular Hamiltonians (Daskin &...
32
votes
4answers
6k views

How do I add 1+1 using a quantum computer?

This can be seen as the software complement to How does a quantum computer do basic math at the hardware level? The question was asked by a member of the audience at the 4th network of the Spanish ...
7
votes
2answers
2k 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?
7
votes
1answer
1k views

How exactly does Simon's algorithm solve the Simon's problem?

Problem Statement: We are given a $2-1$ function $f:\{0,1\}^{n}\to\{0,1\}^{n}$ such that: there is a secret string $s\in\{0,1\}^{n}$ such that: $f(x)=f(x\oplus s)$. Challenge: find $s$. Simon's ...
2
votes
1answer
179 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 ...
3
votes
2answers
431 views

How to decompose this two-qubit unitary matrix to the standard gate set?

I have read some of the other decomposition questions here however still don't understand how to do it manually. The matrix I wish to decompose is the following for 2 qubits: $M=\frac{1}{\sqrt2}\...
13
votes
2answers
769 views

Automatic compilation of quantum circuits

A recent question here asked how to compile the 4-qubit gate CCCZ (controlled-controlled-controlled-Z) into simple 1-qubit and 2-qubit gates, and the only answer given so far requires 63 gates! The ...
9
votes
3answers
372 views

What would be the simplest addition that would make the D-Wave architecture universal?

The D-Wave system, as I understand it, allows us to program Ising models and to find their ground states. In this form, it is not universal for quantum computation: it can not simulate a circuit model ...
3
votes
2answers
95 views

Quantum circuit for a three-qubit bit-flip code

I know a three-qubit bit-flip code has a common encoding circuit as follows, Further, as in page 35 in Gottesman's paper, the encoding circuit can also be constructed through stabilizer generators. ...
4
votes
2answers
693 views

Trying to build a circuit for quantum teleportation on IBMQ I get ERROR_RUNNING_JOB error

I am trying to build a circuit for quantum teleportation. On the simulator, everything runs fine and according to expectations, however, I am not able to run the algorithm on the real quantum ...
7
votes
2answers
186 views

Topological Circuit Simulator

Does something like Quirk exist for topological (eg. braided) circuits? Alternatively, any ideas on how @CraigGidney is getting these circuits (or something similar)?
7
votes
1answer
357 views

SWAP gate(s) in the $R(\lambda^{-1})$ step of the HHL circuit for $4\times 4$ systems

Context: On the 5th page of the paper Quantum circuit design for solving linear systems of equations (Cao et al, 2012) there's this circuit: Schematic: A brief schematic of what's actually ...
6
votes
3answers
174 views

Generalization for $n$ quantum teleportations

In Breaking Down the Quantum Swap, it is stated: Thanks to the CNOT, we can implement a xor-swap on a quantum computer. All we need to do is chain three CNOTs back and forth. In a comment to a ...
4
votes
4answers
639 views

How to re-create the following circuit image?

What would be the best way to re-create the following image of the HHL quantum circuit without compromising on image quality (the image is from this review paper)? Using qasm2circ I can create the ...
4
votes
2answers
549 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\...
3
votes
1answer
66 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 ...
21
votes
2answers
732 views

Why is it important to eliminate the garbage qubits?

Most reversible quantum algorithms use standard gates like Toffoli gate (CCNOT) or Fredkin gate (CSWAP). Since some operations require a constant $\left|0\right>$ as input and the number ...
19
votes
5answers
3k views

How can I build a circuit to generate an equal superposition of 3 outcomes for 2 qubits?

Given a $2$ qubit-system and thus $4$ possible measurements results in the basis $\{|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle\}$, how can I prepare the state, where: only $3$ of these $4$ ...
5
votes
0answers
335 views

Error: Simulation of “Quantum algorithm for linear systems of equations” for $4\times 4$ systems on Quirk (without SWAP) - Global phase

Following @DaftWullie's answer I tried to simulate the circuit given in Fig. 4 of the paper (arXiv pre-print): Quantum circuit design for solving linear systems of equations (Cao et al, 2012), on ...
4
votes
3answers
188 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
3answers
237 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 ...
3
votes
1answer
82 views

How to approximate $Rx$, $Ry$ and $Rz$ gates?

Quantum Inspire is a quantum computing platform provided by QuTech. It consists of two real quantum processors - Starmon-5 and Spin-2. Whereas it is possible to use rotation gates $Rx$, $Ry$ and $Rz$ ...
3
votes
1answer
67 views

Problem with building quantum circuit for Hamiltonian operation

In the book, Nielsen and Chuang, there is a section on quantum simulation of the quantum search algorithm. Hamiltonion operator is defined as follows- $$ H = |x\rangle\langle x| + |\psi\rangle\langle\...
2
votes
1answer
345 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\}...
7
votes
2answers
353 views

Why do we need a Classical Register for carrying out Quantum Computations?

I've just started to mess about with QISKit on Python and one thing is confusing me a fair bit. Given that we are building Quantum Circuits what is the need for a classical register ? Is it because ...
6
votes
1answer
57 views

Implementation of filter operation

If I want to implement the measurement operation corresponding to filtering, i.e. $$ M_1=\left(\begin{array}{cc}1 & 0 \\ 0 & \alpha \end{array}\right)\qquad M_2=\left(\begin{array}{cc}0 & ...
5
votes
1answer
176 views

Can a Toffoli gate be implemented using Fredkin gates?

Even though this seems to be a much asked basic question, I couldn't find a reputed answer to this: Implement a 3-qubit Toffoli gate using 3-qubit Fredkin gates. The best I could do was using 4 ...
5
votes
1answer
987 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?
4
votes
1answer
112 views

How are two different registers being used as “control”?

On page 2 of the paper Quantum Circuit Design for Solving Linear Systems of Equations (Cao et al.,2012) there's this circuit: It further says: After the inverse Fourier transform is executed on ...
4
votes
2answers
110 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?
3
votes
1answer
37 views

Implementing a controlled-controlled-U using controlled-U

Suppose I know how to implement a 2 qubit gate $C-U$ (i.e controlled U), and I want to implement $CC-U$ using $C-U$ and other 1 or 2 qubit gates, is that possible?
2
votes
1answer
181 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 ...
1
vote
1answer
267 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 ...
6
votes
3answers
219 views

What's an example of building a circuit $U_f$ that implements a simple function $f$?

I'd like to be able to program simple functions into simulators such as QCL. I read that any function $f$ can be implemented, but I don't know how to get say a unitary matrix that implements $f$. $\...
4
votes
1answer
103 views

Developing quantum circuits for specific quantum chemistry configurations

I am interested in learning more about the following: would it be possible for me to simulate a molecule consisting of copper ions through a quantum circuit? And if so, can that circuit allow me to ...
4
votes
2answers
96 views

How to construct the unitary representation of the function $f(x, y, z) = (x \oplus y, y \oplus z)$?

Consider the function $f:\{0, 1\}^3\to\{0, 1\}^2$ with $f(x, y, z) = (x \oplus y, y \oplus z)$. How would you construct its standard unitary representation?
3
votes
2answers
78 views

Minimum number of ancilla qubits required to make a transformation unitary?

Background The counterpart of a NOT gate is the CNOT gate. They make use of ancilla qubits to achieve this. Question Given an arbitrary non-unitary transformation what are the minimum number of ...
3
votes
1answer
297 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 ...
2
votes
1answer
207 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}\...
1
vote
2answers
57 views

How can you construct the different two-qubit Bell states?

How can you construct the different Bell states? For example $$\frac{|01⟩-|10⟩}{\sqrt{2}}$$
1
vote
1answer
196 views

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

                       I have a certain transformations that goes as follows: Given $A=|...
1
vote
2answers
161 views

How can the state $\lvert0\rangle+M^{-1/2}\sum_{j=1}^M\lvert j\rangle$ be generated?

I was wondering if anybody to help me to generate the following state. It would be preferable if you use only Hadamard, CNOT and T-gates, on $\lceil\log_2(M+1)\rceil$ qubits: $$|\psi\rangle = \frac{1}{...
0
votes
1answer
62 views

Is this interpretation of quantum circuits right?

Just need some clarification: Results derived as the output of "running" a "quantum circuit" constructed from "quantum gates" are distributed in a certain way, based on the design, and the multiple ...