The only vector operations that are used in our simulation of Shor's algorithm are addition, length determination, and scaling. The vector in question represents the state vector of a quantum mechanical system; a complex vector in a Hilbert Space. The vector can be represented by projections of the vector onto each of the perpendicular base vectors which define the Hilbert Space.
For example, an
state quantum system requires a
dimensional
Hilbert Space to represent its state vector. The quantum system can
be measured in any of the
states, and to represent this we imagine
each of the
states as mutually perpendicular axes within our
Hilbert space. Thus the state vector for a system in the
'th state
is equal to:
For the
states, where the number at the top of the column is the
length of the state vector projected onto the 1st state, and the 1
appears in the
'th row.
To add two vectors we simply add their components.
Since this vector lies in a Hilbert Space the projections of the state vector onto the coordinate axes are allowed to be complex numbers, thus the definition of length is slightly different from what is expected.
The length of a vector in a Hilbert space with
components
is defined to be:
where
is the value of the
'th component of the vector, and
is defined to be
times its complex conjugate, or when
,
.
To scale a vector by any length
you simply multiply each component
of the vector by the value
. In particular to scare a vector to
length 1 you multiply each component by the inverse length of the
vector.