A quantum circuit is a graphical way to represent a sequence of quantum gates and measurements used to perform a quantum computation. In a quantum circuit, single-qubit gates are typically represented as boxes with a text label indicating the type of gate. For example, the symbols below depict the Pauli Y and Pauli Z gates.
An exception to the lettering system used for most single-qubit gates is the NOT gate (X gate), which is usually depicted as a circle with a cross inside, like this:
In a quantum circuit, time flows from left to right. In other words, quantum gates are ordered in chronological order. The left-most is the first gate applied to the qubits. In the diagram below, Gate A is performed first, then B then C.
Next, we introduce some common types of multi-qubit operations, which are controlled operations where one qubit controls the operations performed on other qubits. Multi-qubit gates are usually denoted by a line connecting the different qubits. A black circle denotes the quantum bit on which the gate is controlled, and the appropriate gate notation is used to indicate the unitary that is applied when the control qubit takes the value |1⟩ . For example, the diagrams below show a Controlled-NOT (CNOT) gate and a Controlled-Y gate. In both cases, the first qubit acts as the control and the operation will only be applied if the control qubit takes the value |1⟩.
Another common type of multi-qubit operation is a two-qubit SWAP gate which exchanges the state of two qubits. These unitaries are represented by a single box that covers all the appropriate set of qubits and are labeled by the unitary gate’s matrix.The circuit representation is show below:
Measurement is an important operation in quantum computing. Measurement takes a qubit register, measures it, and outputs the result as classical information. In a quantum circuit, the measurement operation is denoted by a meter symbol that always takes as input a qubit register (denoted by a solid line) and outputs classical information (denoted by a double line). Such a subcircuit looks like this:
Putting all this together, a circuit diagram with multiple gates and measurements may look like the diagram below. An annotated version of the circuit is provided next to the circuit diagram to help with interpretation.