17 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 ...
user avatar
  • 12.3k
10 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 ...
user avatar
  • 1,626
9 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$...
user avatar
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 ...
user avatar
  • 46.1k
7 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 ...
user avatar
7 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 ...
user avatar
  • 12.3k
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 ...
user avatar
  • 3,771
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(...
user avatar
  • 6,767
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 ...
user avatar
  • 2,334
7 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 ...
user avatar
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 ...
user avatar
  • 46.1k
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 ...
user avatar
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 ...
user avatar
  • 1,511
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: ...
user avatar
  • 12.3k
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 ...
user avatar
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 ...
user avatar
6 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$. ...
user avatar
  • 12.3k
6 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 ...
user avatar
  • 21.8k
5 votes
Accepted

Unknown quantum circuit symbol

The picture has two parts: The first goes until the dots. It is simply three $|0\rangle$ states. (The ground state.) You will recognize that the same picture -- but only until the dot -- is used in ...
user avatar
5 votes

Superposition of quantum circuits

A counterexample that shows that this is not possible in the general case (here I am neglecting post-selection possibility discussed in the comments of the question and in the accepted answer): $$ C_1 ...
user avatar
5 votes
Accepted

Why are 3, rather than 2 gates used in quantum variational circuits?

At the start of the circuit you're right that you only need two parameters. This is actually easy to show if you decompose into a sequence of rotations starting with a Z rotation, because Z rotations ...
user avatar
  • 21.8k
5 votes
Accepted

Does QFT exploit entanglement?

Yes, the formula you have shows that applying QFT to a given computational basis state $|j\rangle = |j_1 j_2 \dots j_n\rangle$ results in an unentangled output state. However when applied to ...
user avatar
  • 4,507
5 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 ...
user avatar
  • 21.8k
5 votes
Accepted

Confusion with the number of CNOTs in a circuit

I think the key fact you're missing is that $Z_2 \otimes Z_3 \otimes Z_4 = Z_2 \otimes Z_3$ when you know qubit 4 is in the $|0\rangle$ state; in the +1 eigenstate of $Z$. I'm not sure why that paper ...
user avatar
  • 21.8k
5 votes

Find a circuit implementing a 3-qubit unitary matrix preparing $|b\rangle\simeq(0,c,c,c,c,c,c,0)$ with $c=1/\sqrt6$

Here's a circuit for it: Where I'm using an "odds gate": $$\text{Unitary}(a:b) = \begin{bmatrix} \sqrt{a} & -\sqrt{b} \\ \sqrt{b} & \sqrt{a}\end{bmatrix} / \sqrt{a + b}$$ The key ...
user avatar
  • 21.8k
5 votes

Are ancillary qubits necessary to represent a syndrome measurement in the circuit model?

You can create circuits that perform the stabilizer measurements without using ancilla qubits. For example, you can take a data-qubit-only surface code and do a pattern of CNOT gates that temporarily ...
user avatar
  • 21.8k
5 votes

Is there a way to decompose a quantum circuit into a Clifford subcircuit and a non-Clifford subcircuit?

You can make it even stronger than that. Any circuit can be approximated using the Clifford+T gate set. Then you can replace every T gate with gate teleportation through a T state. So any circuit can ...
user avatar
  • 21.8k
4 votes
Accepted

A CNOT between two Hadamard gates: why does the CNOT changed the output of the second Hadamard gate?

This is because the CNOT gate created an an entangled state and the system after the CNOT gate can't be written individually. That is, you can't stay that your first qubit is in the state $\dfrac{|0\...
user avatar
  • 12.3k
4 votes
Accepted

Understanding the implementation of Grover's diffusion operator using the oracle qubit

Let's take a look at the part of the diffusion operator between the columns of Hadamard gates. This part is supposed to perform a conditional phase shift, giving a phase of $-1$ to the state $|0...0\...
user avatar
4 votes

Understanding quantum circuit diagrams: a circuit that compares two states $|YX\rangle$ and $|AB\rangle$

How to read the circuit You should think of this as a diagram describing a transformation of the qubits. The input state of the qubits is on the left, and describes the state $|Y\rangle \otimes |X\...
user avatar

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