Quantum Computing
Navigation
- Quantum bits
- Computational basis states
- General qubit states
- Common terminology
- Normalisation constraint
- Quantum logic gates
- Quantum circuits
- Multi-gate quantum circuits
- The Hadamard gate
- Measuring a qubit
- General single-qubit gates
- Unitary matrices
- The controlled-NOT gate
- Quantum computing summary
Quantum bits
- Computers provide information through units known as bits:
- Bits are likely stored as tiny electric charges on nanometer-scale capacitors;
- A bit can have a state of either 1 or 0;
- Everything a computer does can be broken down into a combination of 1’s and 0’s.
- Similarly, quantum computers use quantum bits, or qubits:
- Just like a bit, qubits have a state;
- Whereas the state of a bit is a number (0 or 1), the state of a qubit is a vector;
- Specifically, the state of a qubit is a vector in a two-dimensional vector space;
- This vector space is known as state space.
Possible qubit state
Review:
- The quantum equivalent of a bit is a qubit;
- Qubits have a state;
- Much like a bit, that state is an abstract mathematical object;
- Whereas a bit’s abstract state is a number, 0 or 1, the state of a qubit is a 2-dimensional vector;
- We call the 2-dimensional vector space where states live state space.
Henceforth we’ll use the phrase “classical bit”, after “classical physics” to describe the informational unit we are familiar with in ordinary computing.
Computational basis states
There are two special quantum states which correspond to the
A computational basis state
This notation with
- |0⟩ is a computational basis state for a qubit, and plays much the same role as 0 does for a classical bit
- There is a another computational basis state, denoted
, which plays the same role as 1 does for a bit - Like
, is just a notation for a two-dimensional vector, in this case:
Another computational basis state
General qubit states
The computational basis states

Example vector state
The state
Quantum states are not only two-dimensional vectors, they are complex vectors, that is, they can have complex numbers as entries. So, for instance, another quantum vector is the state:
which can be written in the conventional component vector representation as:
Common terminology
People will say a state like
Another common term is amplitude. An amplitude is the coefficient for a particular state in superposition. For instance, in the state
Normalisation constraint
Recall that a quantum state is a two-dimensional complex vector. Actually, it can’t be just any vector—there’s a constraint. The constraint is this: the sums of the squares of the amplitudes must be equal to 1.
For example, for the state
In more general states, the amplitudes can be complex numbers denoted by alpha
The normalisation constraint
It’s called that because if you think of

A normalised vector, visualised
Then the normalization constraint is the requirement that the length of the state is equal to 1. So it’s a unit vector, or a normalized vector, and that’s why this is called a normalization constraint.
The quantum state of a qubit is a vector of unit length in a two-dimensional complex vector space known as state space.
Quantum logic gates
In a classical NOT logic gate, the input and output are swapped. An input of
On a computational basis, the quantum NOT gate does the same:
The computational basis states aren’t the only states possible for a qubit. When a NOT gate is applied to a general superposition state, that is,
NOT gates are usually denoted by the symbol
Quantum circuits
So far we have seen algebraic ways of writing down the way the

A quantum circuit w/ X gate
The line from left to right is what’s called a quantum wire. A quantum wire represents a single qubit. The term “wire” and the way it’s drawn looks like the qubit is moving through space. But it's often helpful to instead think of left-to-right as representing the passage of time. So the initial segment of wire is just the passage of time, with nothing happening to the qubit. Then the
Sometimes we’ll put the input and output states explicitly in the quantum circuit, so we have something like:

Quantum circuit representation of the X gate
This may also be represented as a
Multi-gate quantum circuits
A simple multi-gate quantum circuit is shown below. It’s just a circuit with two

A simple multi-gate circuit
Visualising this in a matrix representation:
Thus, this circuit would be equivalent to a quantum wire:

Multi-gate equivalence
The Hadamard gate
The first quantum gate, the
Just like the
Measuring a qubit
- The quantum state of any system is not directly observable
- There is no way to figure out the identity of
or if they start out unknown - The amplitudes are kind of a hidden information
- There is no way to figure out the identity of
- Rather than somehow measuring these amplitudes, we can extract information by a process called measurement in the computational basis
- If we measure a qubit with state
in the computational basis, then the outcome is a classical bit- Either
, with a probability - Or
, with a probability
- Either
- The corresponding state of the qubit after the measurement is
or - After the the measurement, no matter what the outcome,
and are gone- This means you cannot store an infinite amount of classical information in a qubit
So the way a quantum computation works is that we manipulate a quantum state using a series of quantum gates, and then at the end of the computation (typically) we do a measurement to read out the result of the computation. If our quantum computer is just a single qubit, then that result will be a single classical bit. If, as is more usually the case, it’s multiple qubits, then the measurement result will be multiple classical bits.

Example measurement denotation
It’s a single-qubit quantum circuit, with input the state
General single-qubit gates
We now know about the NOT and Hadamard gates, and also about the measurement process that can be used to extract classical information from our quantum circuits. In this section, let’s return to quantum gates, and take a look at the most general single-qubit gate. To do that it helps to recall the matrix representations of the NOT and Hadamard gates:
If the input to these gates is the quantum state
A general single-qubit gate works similarly. In particular, a general single-qubit gate can be represented as a
What does it mean for a matrix
So for a
The
As well as the
Another good example of a quantum gate is a rotation, the kind of matrix you’ve most likely been seeing since high school. It’s just the ordinary rotation of the 2-dimensional plane by an angle
Unitary matrices
- Unitary matrices preserve the length of their inputs
- If we take any vector
and compute the length it’s always equal to the length of the original vector - They’re much like rotations or reflections in ordinary (real) space, which also don’t change lengths
- In a sense, the unitary matrices are a complex generalization of real rotations and reflections
- This is good for qunatum gates because the input state will be normalized (have length 1), since that’s a requirement for a quantum state
- Fortunately, the length-preserving property of unitary matrices ensures the output state is properly normalized
Not only are gates unitary, to ensure that states remain normalized; also, quantum states are normalized, since measurement probabilities must sum to 1. It all fits together. In fact, it turns out that unitary matrices are the only matrices which preserve length in this way. And so a good way of thinking about unitary matrices is that they’re exactly the class of matrices which preserve length. That’s the geometric interpretation (and intuitive meaning) of the algebraic condition
The controlled-NOT gate
We’ve developed most of the ideas needed to do universal quantum computing. We understand qubits, quantum states, and have a repertoire of quantum gates. However, all our gates involve just a single qubit. To compute, we need some way for qubits to interact with one another. That is, we need quantum gates which involve two (or more) qubits.
An example of such a gate is the controlled-NOT (or CNOT) gate. In the quantum circuit language we have two wires, representing two qubits, and the following notation to represent the CNOT gate:

The CNOT gate
- The top wire with the small, filled dot is called the control qubit
- The bottom wire with the larger, unfilled circle on it is called the target qubit
The four computational basis states, corresponding to the four possible states of a two-bit system, are:
And, for a two-qubit system, not only can we have those four states, we can also have superpositions (i.e., linear combinations) of them:
The amplitudes
The CNOT gate operates very simply. If the control qubit is set to 1, as in the states
The CNOT can be thought of as a very simple kind of if-then
statement: if
the control qubit is set, then
NOT the target qubit. But while simple, it can be used as a building block to build up other, more complex kinds of conditional behavior.
Summing all four equations above into a single equation, suppose
The above equation makes clear that the CNOT leaves the control qubit
Of course, the CNOT doesn’t just appear in two-qubit computations. It also appears in computations involving more qubits. Let’s suppose we have three qubits, for instance, and computational basis states such as

Three-qubit computation diagram
What goes on? Well, we can write out what happens on an arbitrary computational basis state,
CNOT has been described as a “classical” gate, but it can be combined with single-qubit gates to do non-classical things. An example is the diagram below, a two-qubit computation starting with the

Non-classical example
Recall that for a single qubit the Hadamard gate takes
Next we apply the CNOT gate. This leaves the
This output state is a highly non-classical state – it’s actually a type of state called an entangled state. There’s no obvious interpretation of this state as a classical state, unlike say a computational basis state such as
Quantum computing summary
We can summarize the three steps in a quantum computation as follows:
- Start in a computational basis state
- Apply a sequence of CNOT and single-qubit gates
- To obtain the result, measure in the computational basis. The probability of any result, say 00...0, is just the square of the absolute value of the corresponding amplitude
That’s all a general quantum computation is! If you understand this model, you know what a quantum computer is.