Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
26
votes
4answers
3k 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 ...
26
votes
2answers
1k 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 ...
18
votes
2answers
432 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 ...
14
votes
3answers
2k 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$ ...
14
votes
2answers
1k views

Do multi-qubit measurements make a difference in quantum circuits?

Consider the unitary circuit model of quantum computation. If we need to generate entanglement between the input qubits with the circuit, it must have multi-qubit gates such as CNOT, as entanglement ...
13
votes
2answers
1k 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 ...
12
votes
2answers
505 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 ...
11
votes
1answer
257 views

What is the quantum circuit equivalent of a (delayed choice) quantum eraser?

Quantum computers are efficiently able to simulate any other quantum system. Hence there must be some sort of equivalent of a (possibly simulated) quantum eraser setup. I would like to see such an ...
11
votes
2answers
254 views

Jones Polynomial

There are many fairly standard quantum algorithms that can all be understood within a very similar framework, from Deutsch's algorithm Simon's problem, Grover's search, Shor's algorithm and so on. ...
10
votes
1answer
188 views

What do double wires mean in quantum circuits, and how do they relate to if statements?

The circuit can be translated to the following code: ...
10
votes
1answer
147 views

Simulating Clifford + few-T circuits

I want to simulate large stabilizer circuits (H/S/CNOT/MEASURE/feedforward) with a small number of T gates mixed in. How can I do this in a way that scales exponentially only in the number of T gates? ...
9
votes
2answers
411 views

Shortest sequence of universal quantum gates that correspond to a given unitary

Question: Given a unitary matrix acting on $n$ qubits, can we find the shortest sequence of Clifford + T gates that correspond to that unitary? For background on the question, two important ...
9
votes
2answers
274 views

How to create quantum circuits from scratch

I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak. Getting through the earlier chapters and exercises went ...
9
votes
3answers
301 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 ...
8
votes
2answers
162 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?
8
votes
2answers
337 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. ...
8
votes
1answer
574 views

How to prevent future loops using a control qubit?

I am trying to construct a quantum multiplier using the method described here: https://arxiv.org/abs/quant-ph/0403048. However, it seems that the control qubit would only disable the following gates ...
8
votes
1answer
237 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 &...
8
votes
0answers
79 views

How many two-qubit gates are required to implement a 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 ...
7
votes
2answers
153 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
2answers
220 views

Minimum number of CNOTs for Toffoli with non-adjacent controls

I want to decompose a Toffoli gate into CNOTs and arbitrary single-qubit gates. I want to minimize the number of CNOTs. I have a locality constraint: because the Toffoli is occurring in a linear array,...
7
votes
2answers
172 views

Is there a general method to implement a 'greater than' quantum circuit?

I am interesting in finding a circuit to implement the operation $f(x) > y$ for an arbitrary value of $y$. Below is the circuit I would like to build: I use the first three qubits to encode $|x⟩$, ...
7
votes
1answer
256 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 ...
7
votes
1answer
61 views

How to avoid error when applying certain combinations of degree of freedom rotations using a quantum circuit?

When applying each of the six degree of freedom rotations (or certain combinations of them) in an SO(4) using quantum gates, the results I expected are produced. For example, the following circuit in ...
7
votes
1answer
501 views

Decomposition of arbitrary 2 qubit operator

As you know, universal quantum computing is the ability to construct a circuit from a finite set of operations that can approximate to arbitrary accuracy any unitary operation. There also exist some ...
7
votes
0answers
44 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 = \...
7
votes
0answers
77 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 ...
6
votes
3answers
178 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$. $\...
6
votes
2answers
112 views

What is the smallest quantum circuit to produce two-qubit state (a,b,b,b)?

How can I synthesis a two-qubit quantum state of the state vector (a,b,b,b) using basic quantum-gate circuit (arbitrary single-qubit rotation and controlled $Z$ gate)? And further, can I know a given ...
6
votes
3answers
87 views

$R_z$ gate representations

Why is the $R_z$ gate sometimes written as: $$ R_{z}\left(\theta\right)=\begin{pmatrix}1 & 0\\ 0 & e^{i\theta} \end{pmatrix}, $$ while other times it is written as: $$ R_{z}\left(\theta\...
6
votes
3answers
142 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 ...
6
votes
2answers
284 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
739 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 ...
6
votes
1answer
40 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 ...
6
votes
0answers
45 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 ...
5
votes
3answers
530 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^{-...
5
votes
1answer
246 views

Classical XOR gate in Quantum Circuit

Can we use classical XOR gate in a quantum circuit? Or are there any alternatives for XOR gate?
5
votes
1answer
61 views

A basic question on circuits and matrix representation

I have several (rather basic) questions on matrix representation of circuits and I would be very grateful to anyone that could clear up my confusion, thank you in advance. 1) When reading circuit ...
5
votes
2answers
91 views

Is there a simple, formulaic way to construct a modular exponentiation circuit?

I'm a newcomer to quantum computing and circuit construction, and I've been struggling to understand how to make a modular exponentiation circuit. From what I know, there are several papers on the ...
5
votes
2answers
102 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 ...
5
votes
1answer
86 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 ...
5
votes
3answers
88 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$, ...
5
votes
1answer
152 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), ...
5
votes
1answer
63 views

Mapping Algebraic Normal Form of Exclusive Sum of Products to Toffoli Network

How does one map an ANF to a toffoli network? Is there a straight-forward procedure for doing this? For example, given the ANF for the Sum function of an adder: $$S = A \oplus B \oplus C \oplus ABC$$ ...
5
votes
3answers
232 views

Showing the equivalence of two simple {NOT, CNOT} circuits

As a beginner, for exercise purpose, I’ve studied this two quantum circuits. They are equivalent, and for 2 qubits it’s easy to write the unitary transformation matrix. Looking for another method I ...
5
votes
1answer
175 views

Implementation of quantum adder

I'm looking at this paper and try to implement the Quantum adders they define myself. Suppose we have a number $b=b_{n-1}\dots b_1b_0$ and they want to add a constant number $a=a_{n-1}\dots a_1a_0$. ...
5
votes
1answer
84 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
2answers
63 views

Fault tolerant quantum measurement: how is implemented the “majority vote”

As a fundamental component for a quantum computation, the measurement needs to be implemented in a fault tolerant way. As indicated in Chuang and Nielsen Quantum Computation and Quantum Information, ...
5
votes
0answers
136 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.
5
votes
0answers
52 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 ...