While reading the Quantum algorithm Wikipedia entry, I noticed that the sentence "A quantum circuit consists of simple quantum gates which act on at most a fixed number of qubits", was annotated with a "why?".
-
1That doesn't look like a good definition anyway. I don't see any particular reason to use the terms "simple" (without defining it) and "at most". – Sanchayan Dutta May 21 '19 at 17:34
1 Answers
Quantum circuits are a way to visualize a quantum operation/algorithm. As such, they are constrained by what you can reasonably express in a drawing. Simple algorithms on a small number of qubits are easy to express - for example, the ubiquitous teleportation circuit.
Algorithms on a variable number of qubits or algorithms that mix classical processing with quantum get harder to express, and the more complicated the algorithm is, the harder it gets.
- You can denote a variable number of qubits by crossing a wire and writing N on it.
- You can denote a loop by omitting some gates, replacing them with dots and specifying the number of iterations.
- You can replace both some wires and some gates with dots.
- But what do you do if the body of a loop consists of multiple gates that vary on each iteration? If there are classical controls involved? If the number of loop iterations depends on measurement results? If you want to measure a qubit and do something with it afterwards? If the algorithm takes a thousand gates, let alone a million? The circuit diagrams become rather unreadable rather fast.
This is similar to flow charts for classical algorithms - you can use them to visualize a small algorithm, maybe for educational purposes, or a high-level structure of a big algorithm, but you just can't express the internals of, say, a web-browser as a flow chart.

- 9,010
- 1
- 12
- 39
-
By way of agreement with @Mariia Mykhailova on this point, trying to express quantum phase estimation as a quantum circuit is already difficult, but iterative phase estimation algorithms often can't practically be expressed as circuits due to the use of classical logic as a part of the algorithm.
This is why I find thinking of quantum programs as classical programs with quantum side effects (intrinsic gates) to be a much more helpful model than quantum circuits.
– Chris Granade May 21 '19 at 18:06 -
@Chris I'd argue that quantum circuits aren't supposed to encapsulate classical logic, by definition. A quantum circuit is literally defined as a quadruplet $C=(V, I, O, G)$ where $V$ is the set of all qubits (including ancilla, input, and output), $I$ stands for the set of input qubits and $O$ stands for the set of output qubits. $G$ is a sequence of unitary transformations acting on a "bounded" number of qubits. This answer is kinda like saying "quantum circuits aren't useful for what they're not meant for in the first place"; isn't that obvious? I don't quite see the point here. – Sanchayan Dutta May 21 '19 at 18:28
-
That's kind of my point, really: quantum algorithms in general involve classical logic, such that a construct such as quantum circuits that precludes classical logic as a matter of definition isn't the most natural tool to help understand quantum algorithms. – Chris Granade May 21 '19 at 18:31
-
@SanchayanDutta I'm not sure I follow this definition - what about circuits which involve measurements, like teleportation? Explaining something that is obvious for some people is valuable for other people - the ones for whom it is not obvious. (Isn't it part of the goal of this website?) – Mariia Mykhailova May 21 '19 at 18:36