Back to our qubit, the spin-1/2 particle. We know that while it can only be measured to have a spin of +1/2 or -1/2, it may in general be in a superposition of these states when we are not measuring it.

Let *x*_{1} be the eigenstate corresponding to the spin +1/2 state,
and let *x*_{0} be the eigenstate corresponding to the spin -1/2
state. Let *X* be the total state of the state vector, and let
*w*_{1} and *w*_{0} be the complex numbers that weight the
contribution of the base states to the total state, then in general:

| *X* > = *w*_{0}*| *x*_{0} > + *w*_{1}*| *x*_{1} > = = (*w*_{0}, *w*_{1})

At this point it should be remembered that *w*_{0} and *w*_{1}, the
weighting factors of the base states are complex numbers, and that
when the state of *X* is measured, we are guaranteed to find it to be
in either the state:

0*| *x*_{0} > + *w*_{1}*| *x*_{1} > = = (0, *w*_{1})

or the state

The state vector is a unit vector in a Hilbert space, which is similar to vector spaces you may be more familiar with, but it differs in that the lengths of the vectors are complex numbers. It is not necessary from a physics perspective for the state vector to be a unit vector (meaning it has a length of 1), but it makes for easier calculations further on, so we will assume from here on out that the state vector has length 1. This assumption does not invalidate any claims about the behavior of the state vector.

Thus we have fully defined the basic building block of a quantum computer, the qubit. It is fundamentally different from a classical bit in that it can exist in any superposition of the 0 and 1 states when it is not being measured. (Barenco, Ekert, Sanpera, Machiavello)