# Questions tagged [circuit-construction]

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

148 questions
Filter by
Sorted by
Tagged with
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 ...
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 ...
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 ...
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$ ...
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 ...
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 ...
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 ...
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 ...
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. ...
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: ...
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? ...
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 ...
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 ...
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 ...
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?
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. ...
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 ...
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 &...
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 ...
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)?
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,...
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⟩$, ...
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 ...
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 ...
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 ...
44 views

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 ...
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 ...
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 ...
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 ...
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 ...
530 views

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 ...
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$. ...
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 ...
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, ...
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.
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 ...