4.1 Quantum circuits
When you have many qubits and you are applying lots of operations on them, you can easily lose track of what is going on. Just like a composer would write sheet music to neatly arrange the instructions for each musician of an orchestra telling them exactly what note to play at any given time, so do quantum circuits provide a nice pictorial description of what operation should be applied to any qubit at any given time. Different operations are like different notes and different qubits are like different musicians in an orchestra!
Unlike in an orchestra, however, some quantum operations affect two (or sometimes even three!) qubits at a time. This would be like asking the guitar player to strum the violin while the violinist is bowing the guitar! Such interactions between musicians (or qubits) can be a lot of fun and produce a much richer and complicated sound. However, they can be hard to perform in practice (as you can imagine, the violinist might have to run across the stage to reach the guitar player!). In addition, during this hectic collaboration between the two musicians, the violinist’s hair might get entangled with guitar player’s large earrings forcing them to play the rest of the song together.
The more interactions you perform between the qubits, the more entangled they will usually get. At the end of the song, typically all qubits end up being entangled with each other in such a way that it is completely impossible to tell them apart. The only way to sort them out and get them back to any reasonable state is by measuring them! Indeed, this is how a general quantum computation proceeds. More formally, a quantum circuit consists of three ingredients:
-
1.
an initial state, which is typically on each of the qubits,
-
2.
a sequence of quantum operations, where each operation typically acts on a few qubits at a time (usually, one or two qubits),
-
3.
measurements to read the information out (typically we measure all qubits).
We can represent quantum circuits graphically using the same pictures that we already know from Quirky. When discussing quantum circuits, operations and measurements are often called quantum gates (e.g., ‘Hadamard gate’ instead of ‘Hadamard operation’). Let us now look more closely at the three ingredients and see how they play out in a large orchestra of qubits.