For questions about the construction of complex circuits using elementary quantum gates.
Questions tagged [circuit-construction]
699 questions
10
votes
1 answer
Minimum number of T gates needed to perform two overlapping Toffolis
Consider this circuit:
How many T gates are needed to implement it, in the stabilizer+T gate set? The circuit can use cliffords, measurement, classical feedback, ancilla qubits, and T gates. Only T gates cost.
I know how to do it with 8 T gates,…

Craig Gidney
- 36,389
- 1
- 29
- 95
7
votes
2 answers
How to do quantum circuit arithmetic?
I'm looking at a circuit from this paper on quantum machine learning.
So to introduce my own notation:
we start with $|\psi_0⟩ = |0,a,b⟩ = a_0b_0|000⟩ + a_0b_1|001⟩ + a_1b_0|010⟩ + a_1b_1|011⟩$
after the first $H$-gate we have $|\psi_1⟩$
after the…

Alexander Soare
- 636
- 4
- 16
5
votes
3 answers
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 wrote what follows, but I’m not sure about…

Fabrizio R.
- 93
- 4
4
votes
2 answers
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?

David
- 81
- 2
4
votes
0 answers
How to generate the following $n$-level $n$-particle singlet state?
Could you please give a direction/reference towards realising the following using any set of realisable quantum gates
$$\boxed{|S_{n}\rangle = \frac{1} {\sqrt{n!}} \sum_{S\in P_n^{n}} ( \,-1) \,^{\Gamma(S)}|s_{0}\rangle |s_{1}\rangle…

qcnoob
- 87
- 2
4
votes
0 answers
Does delaying measurements change the complexity of the circuit?
It's often said that for any quantum circuit with intermediate measurements, there exists an equivalent circuit where all measurements are at the end of the circuit.
Is anything ever argued about the complexity of the circuit with delayed…

Ethan
- 61
- 3
4
votes
1 answer
Prepare superposition of quantum states weighted by fidelity with reference state
Given a list of $m$ quantum states $$|\phi_0\rangle, |\phi_1\rangle, ... |\phi_{m-1}\rangle$$
each on $n$ qubits, with unitaries to prepare these ($U_0, U_1, ...$), I'd like to prepare a superposition of these states weighted by their overlap with…

Nikhil Khatri
- 41
- 1
3
votes
1 answer
Circuit for controlled rotations conditioned on a $d$ bit precision estimate of $\theta$ for $O(d)$ gates
Suppose I have a $d$-bit estimate of $\theta \in (0, 2 \pi]$, say a register of qubits $|\tilde{\theta} \rangle = |z_1 \rangle \ldots |z_d \rangle$ for $|z_i \rangle \in \{|0 \rangle, |1 \rangle \}$ where $\theta \approx \sum_{i=1}^{d} z_i \pi…

IntegrateThis
- 545
- 4
- 14
3
votes
1 answer
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 the circuit works.
The circuit to be verified: top…

0x90
- 263
- 1
- 6
3
votes
1 answer
Matrix mod 2 multiplication
There was a similar question asked here, but I feel like mine is even more basic.
What's the easiest way to implement a circuit $U$ corresponding to a matrix-vector multiplication modulo 2?
$$
|x_1x_2x_3\ldots x_n\rangle \mapsto |y_1y_2y_3\ldots…

mavzolej
- 1,921
- 7
- 17
2
votes
2 answers
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 ancilla qubits required to make a transformation…

More Anonymous
- 429
- 3
- 15
2
votes
2 answers
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?

R. Chopin
- 1,199
- 6
- 17
2
votes
0 answers
Reasons for Google's calibration policy of fitting to Alternating Single/Two-qubit gate pattern
In Cirq document that describes 'best practices' for manually optimizing circuits, they recommend to construct a circuit in a pattern that alternate 'single-qubit gates with two-qubit gates in each layer'.
Regarding this, I have few questions:
(1)…

Changu Kang
- 73
- 4
2
votes
0 answers
Preparing arbitrary two- and multi-qubit states with real amplitudes
Is it correct that the following circuit can produce any two-qubit state with real amplitudes? (Meaning that for any set of the four real amplitudes there exists a set of angles...)
If so, should I generally expect that arbitrary state…

mavzolej
- 1,921
- 7
- 17
1
vote
1 answer
Is it possible to simulate any classical algorithm with the same efficiency on quantum computer?
Consider any data structure based on the binary search trees, e.g. set. Classical computers can make queries (insert, remove, test if element present), into this structure in $O(\log n)$ time, where $n$ is the number of elements.
Using the quantum…
user7988