Skip to main content
Share Your Experience: Take the 2024 Developer Survey
35 votes
Accepted

An impossible quantum adder claimed by a journal article?

it's from International Journal of Theoretical Physics - reputable journal Consider this paper your lesson in how reliable "reputability" is. Look at Figure 5 from the paper: Specifically ...
Craig Gidney's user avatar
  • 37.5k
24 votes
Accepted

What's meant by the depth of a quantum circuit?

The depth of a circuit is the longest path in the circuit. The path length is always an integer number, representing the number of gates it has to execute in that path. For example, the following ...
KAJ226's user avatar
  • 13.9k
13 votes
Accepted

How to check if a quantum circuit can be constructed for a given matrix representation?

Correct, unitarity is a sufficient and necessary condition. From Nielson and Chuang page 18: Amazingly, this unitary constraint is the only constraint on quantum gates. Any unitary matrix specifies a ...
ryanhill1's user avatar
  • 2,503
13 votes
Accepted

Minimum number of 2 qubit gates to build any unitary

Theoretical lower bound In contrast to the answer by Bertrand, I will assume that along with a $CNOT$ gate we have arbitrary single-qubit unitaries on our disposal. In this case, one can derive the ...
Nikita Nemkov's user avatar
13 votes

Why can all quantum circuits be converted into circuits that use only real matrices?

The fact that "we need work only with quantum Turing machines (QTMs) with real-valued transitions" is proved by Bernstein and Vazirani in their paper Quantum complexity theory (1993). ...
Egretta.Thula's user avatar
10 votes
Accepted

How to distinguish between collapsed and uncertain qubits in a quantum circuit?

Consider a quantum circuit on one qubit initialized in the state $|0\rangle$ and consisting of two Hadamard gates where we can insert a measurement between the Hadamards. The input state is $|0\rangle$...
Adam Zalcman's user avatar
  • 22.9k
10 votes
Accepted

Building a controlled NOT gate which is controlled by the qubit it is acting on

The operation you want is impossible, because it is not reversible. It sends both |1> and |0> to |0>, so afterwards if you see |0> you can't tell if it came from |1> or from |0>. So ...
Craig Gidney's user avatar
  • 37.5k
9 votes

Superposition of quantum circuits

As Davit Khachatryan's answer points out, the task is impossible / ill-defined, since the desired target state is generally not normalized and it depends on the relative global phases of the two ...
Māris Ozols's user avatar
9 votes

How to check if a quantum circuit can be constructed for a given matrix representation?

Right. But when you build a quantum computer, you want to have a certain set of gates that you want to implement, and all other gates (unitary matrices) can be built from that set of gates. This is ...
KAJ226's user avatar
  • 13.9k
9 votes
Accepted

Why is depth complexity relevant?

Circuit depth matters because qubits have finite coherence time. You could imagine two circuits, each with $N$ gates, where the first circuit can implement them all in parallel and thus finish in one ...
chrysaor4's user avatar
  • 1,386
9 votes
Accepted

Do quantum loops exist?

It depends what you mean by "loop". Nielsen and Chuang are referring to loops like the ones that appear in an SR latch. Wires literally running backwards to earlier in the circuit, creating ...
Craig Gidney's user avatar
  • 37.5k
8 votes
Accepted

How could one implement a circuit using Grover's algorithm to solve a linear system of equations?

You certainly could use Grover's search. You would create 2 registers. This first, of 3 qubits, would effectively store the $\{s_0,s_1,s_2\}$. This is the standard register for Grovers on which you ...
DaftWullie's user avatar
  • 58.7k
8 votes
Accepted

How to perform a controlled Pauli string rotation gate?

This is nearly a built-in decomposition in cirq. Here's what happens when you decompose a Pauli product: ...
Craig Gidney's user avatar
  • 37.5k
7 votes
Accepted

How to reason about absorbing Pauli Product rotations into measurements?

First of all, let us consider an arbitrary unitary $U$. If we first apply $U$ and then measure a POVM $\{E_a\}$, then this is equivalent to doing nothing and measuring the POVM $\{U^\dagger E_a U\}$ ...
Markus Heinrich's user avatar
7 votes
Accepted

Qiskit - Circuit drawing aesthetics - Can I force the measurements in my circuit to show at the end?

You can add a barrier before the measure: ...
luciano's user avatar
  • 5,793
7 votes
Accepted

Is the complexity of a quantum circuit constant in the depth of the circuit?

The same could be said about any classically computable function. We could use the Cook-Levin theorem to unroll any Turing machine into a single but complicated $n$-input gate, and then claim it's $o(...
Mark Spinelli's user avatar
7 votes

Apply readout error mitigation to mid-circuit measurement

That's a very interesting question, I haven't thought about it before, thanks for that! Now, the way I see this, you have 2 different potential paths to investigate. 1 The first one would be the same ...
Lena's user avatar
  • 2,597
7 votes
Accepted

Why do we care about the number of $T$ gates in a quantum circuit?

If you are trying to implement a fault-tolerant quantum computation, you need to implement unitary gates that act on logical qubits. You typically have a finite set of these gates available, and what ...
DaftWullie's user avatar
  • 58.7k
7 votes
Accepted

What is this circuit doing?

The first part of the circuit is to create a GHZ state $$|\psi\rangle = \dfrac{|000\rangle + |111\rangle}{\sqrt{2}} $$ The second part of the circuit is to change the basis of measurement to $XYY$. ...
KAJ226's user avatar
  • 13.9k
7 votes

What is this circuit doing?

This looks like one case of a GHZ bell test. It's preparing a GHZ state and then measuring the qubits in the X, Y, and Y bases respectively. In the full experiment the three players prepare the state ...
Craig Gidney's user avatar
  • 37.5k
7 votes
Accepted

Transforming a Quantum State to a superposition of its inverse

It's not possible to build such a quantum gate. First of all, what would be the inverse of: $$|+\rangle=\frac12\left(|00\rangle+|01\rangle+|10\rangle+|11\rangle\right)$$ ? You can convince yourself ...
Tristan Nemoz's user avatar
  • 6,432
7 votes
Accepted

Where does the Clifford circuits stand in the complexity hierarchy?

Clifford circuits alone are not universal for classical computation, at least not under common complexity-theoretic assumptions. More precisely, Aaronson and Gottesman showed that deciding whether the ...
Markus Heinrich's user avatar
6 votes
Accepted

How does this represent modular multiplication

Applying a NOT gate to every qubit in an $n$ bit register performs the transformation $f(x) = 2^n - 1 - x$. In this case that's $f(x) = 16-1-x = -x \pmod{15}$. So the NOT gates are equivalent to ...
Craig Gidney's user avatar
  • 37.5k
6 votes

How to compute the measurement probability in swap test?

It's a fantastic question because the typical measurement intuition we apply no longer is sufficient - it's really necessary to formalize measurement. Specifically, we create a set of nonlinear ...
C. Kang's user avatar
  • 1,726
6 votes

How to visualize Hadamard gate as $X$-$Z$-$X$ decomposition?

As mentioned in the other answer, the Hadamard gate is a pi rotation (180 degree) around the $X + Z$ axis. That is, it is a 180 degree rotation around the purple axis indicated in the below figure: ...
KAJ226's user avatar
  • 13.9k
6 votes

Why is depth complexity relevant?

Great answer by chrysaor4! To give another example: implementing Toffoli gates in a fault-tolerant quantum computer. The most time-consuming gate to implement in a fault-tolerant setting will be the T ...
sheesymcdeezy's user avatar
6 votes
Accepted

What is the correlation between Toffoli and a more generic rotation shown in qiskit textbook

The first diagram is a generic construction showing how it is possible to build a $\mathsf{CC}\mathbf{U}$ gate, which is the gate that applies $\mathbf{U}$ to the third qubit only if both first qubits ...
Tristan Nemoz's user avatar
  • 6,432
6 votes
Accepted

Initial state preparation for Hadamard test

You could almost do it. In fact, the following circuit would work: You can convince yourself that what you do is in fact applying the unitary $\mathbf{VUV^\dagger}$, which will allow you to evaluate ...
Tristan Nemoz's user avatar
  • 6,432
6 votes
Accepted

What is the fastest classical simulator for quantum circuits with only Clifford gates?

As far as I know, the current fastest simulator for stabilizer circuits is my simulator Stim (source code on github, paper in Quantum, python package on pypi). This is especially true if you're doing ...
Craig Gidney's user avatar
  • 37.5k
6 votes
Accepted

What is a simple example showing the issues of not doing the "uncomputation" step?

In general, the state of auxiliary qubits which are used during computation is entangled with the state of output qubits. This entanglement prevents interference from happening, which in turn leads to ...
Egretta.Thula's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible