Shortcut to this page: ntrllog.netlify.app/quantum
Notes provided by Professor Negin Forouzesh (CSULA) and Quantum Computing for Computer Scientists
Apparently complex numbers are used a lot in quantum mechanics. So this will start off with some light review of complex numbers and linear algebra.
A complex number `c` is an expression `c=a+bi` where `a,b in RR`. `a` is referred to as the real part of `c` and `b` is the imaginary part of `c`.
With this in mind, we can also define a complex number as an ordered pair of real numbers: `c=(a,b)`.
Let `c_1=(a_1,b_1)` and `c_2=(a_2,b_2)` be two complex numbers.
`c_1+c_2=(a_1,b_1)+(a_2,b_2)=(a_1+a_2,b_1+b_2)`
`c_1-c_2=(a_1,b_1)-(a_2,b_2)=(a_1-a_2,b_1-b_2)`
`c_1xxc_2=(a_1,b_1)xx(a_2,b_2)=(a_1a_2-b_1b_2,a_1b_2+a_2b_1)`
This comes from the same idea as FOIL.
`c_1xxc_2=(a_1+b_1i)xx(a_2+b_2i)`
`=a_1a_2+a_1b_2i+b_1ia_2+b_1b_2i^2`
`=a_1a_2+a_1b_2i+b_1ia_2-b_1b_2`
`=a_1a_2-b_1b_2+a_1b_2i+a_2b_1i`
`=(a_1a_2-b_1b_2)+(a_1b_2+a_2b_1)i`
`c_1/c_2=\frac{(a_1,b_1)}{(a_2,b_2)}=(a_1a_2+b_1b_2)/(a_2^2+b_2^2)+(a_2b_1-a_1b_2)/(a_2^2+b_2^2)i`
Let `(x,y)=\frac{(a_1,b_1)}{(a_2,b_2)}` be the quotient of two complex numbers.
From this, we get
`(a_1,b_1)=(x,y)xx(a_2,b_2)=(a_2x-b_2y,a_2y+b_2x)`
So we have
`(1): a_1=a_2x-b_2y`
`(2): b_1=a_2y+b_2x`
We can solve for `x` by multiplying `(1)` by `a_2` and multiplying `(2)` by `b_2`:
`a_1a_2=a_2^2x-b_2a_2y`
`b_1b_2=a_2b_2y+b_2^2x`
`a_1a_2+b_1b_2=a_2^2x-b_2a_2y+a_2b_2y+b_2^2x`
`a_1a_2+b_1b_2=a_2^2x+b_2^2x`
`a_1a_2+b_1b_2=x(a_2^2+b_2^2)`
`x=\frac{a_1a_2+b_1b_2}{a_2^2+b_2^2}`
We can solve for `y` by multiplying `(1)` by `b_2` and multiplying `(2)` by `-a_2`:
`a_1b_2=a_2b_2x-b_2^2y`
`-b_1a_2=-a_2^2y-a_2b_2x`
`a_1b_2-b_1a_2=a_2b_2x-b_2^2y-a_2^2y-a_2b_2x`
`a_1b_2-b_1a_2=-b_2^2y-a_2^2y`
`a_1b_2-b_1a_2=-y(b_2^2y+a_2^2)`
`\frac{a_1b_2-b_1a_2}{a_2^2+b_2^2}=-y`
`y=\frac{a_2b_1-a_1b_2}{a_2^2+b_2^2}`
Changing the sign of only the imaginary part of a complex number is called conjugation. Formally, if `c=a+bi`, then the conjugate of `c` is
`bar c=a-bi`.
The modulus of a complex number `c=a+bi` is
`+sqrt(a^2+b^2)`
and is denoted as `abs(c)`.
The modulus is a generalization of the absolute value operation for real numbers.
`abs(a)=+sqrt(a^2)`
As we've seen, we can represent complex numbers as ordered pairs. This naturally lends itself to being graphable on a plane.
For example, the complex number `2+3i` would look like
The complex plane (where the real numbers sit on the horizontal axis and the imaginary numbers sit on the vertical axis) is also called the Argand plane.
So we can think of complex numbers as vectors on the complex plane.
Notice that if we calculate the length of the vector, we get the modulus.
To convert a complex number from Cartesian coordinates to polar coordinates, we need `rho` and `theta`:
`rho=sqrt(a^2+b^2)`
`theta=tan^(-1)(b/a)`
To go back from polar to Cartesian:
`a=rho cos(theta)`
`b=rho sin(theta)`
Let `c_1=(rho_1,theta_1)` and `c_2=(rho_2,theta_2)`.
`c_1xxc_2=(rho_1,theta_1)xx(rho_2,theta_2)=(rho_1rho_2,theta_1+theta_2)`
A complex vector space is a set of vectors where each element of a vector is a complex number.
For example, `CC^4` is the set of `4`-element vectors and an element of `CC^4` would look like this:
`[[6-4i],[7+3i],[4.2-8.1i],[-3i]]`
Just like with regular vectors, adding complex vectors is the same.
`CC^n` with vector addition is an Abelian group, which means:
(The first four properties are what makes a group and the last property is what makes a group Abelian.)
And so is scalar multiplication.
`CC^n` with scalar multiplication (and vector addition) is a complex vector space, which means:
`CC^(mxxn)` is the set of `mxxn` matrices, and it is also a complex vector space.
Matrix addition, scalar multiplication, and the transpose is the same as regular matrices.
For a complex matrix `A`,
A set of complex vectors `B` is a basis of a complex vector space if
The dimension of a complex vector space is the number of elements in a basis of the space.
For two vectors `V_1=[[r_0],[r_1],[vdots],[r_n]]` and `V_2=[[r_0'],[r_1'],[vdots],[r_n']]`, the inner product is defined as
`(:V_1,V_2:)=V_1^T***V_2=sum_(j=0)^nr_jr_j'`
For two matrices `A,B in RR^(nxxn)`, the inner product is defined as
`(:A,B:)=Trace(A^T***B)`
where the trace of a matrix is the sum of the diagonal elements of the matrix.
For complex vectors, the inner product is defined as
`(:V_1,V_2:)=V_1^†***V_2`
For two matrices `A,B in CC^(nxxn)`, the inner product is defined as
`(:A,B:)=Trace(A^†***B)`
The norm (length) of a vector `V` is defined as
`abs(V)=sqrt((:V,V:))`
Two vectors are orthogonal if their inner product is equal to `0`.
A basis is orthogonal if all the vectors in the basis are pairwise orthogonal to each other.
`(:V_j,V_k:)=0` for `j ne k`
An orthogonal basis is orthonormal if all the vectors in the basis is of norm `1`.
`(:V_j,V_k:)={(1,if j=k),(0,if j ne k):}`
In `RR^3`, the inner product `(:V,V':)` is the same as
`abs(V)abs(V')costheta`
where `theta` is the angle between `V` and `V'`.
For a matrix `A in CC^(nxxn)`, if there is a number `c in CC` and a vector `V ne 0` such that
`AV=c cdotV`
then `c` is an eigenvalue of `A` and `V` is an eigenvector of `A` associated with `c`.
A complex matrix `A` is hermitian if `A^†=A`.
A matrix is unitary if the matrix is invertible, and its inverse is its adjoint.
`U***U^†=U^†***U=I`
A matrix `A` is invertible if there exists `A^(-1)` such that
`A***A^(-1)=A^(-1)***A=I`
`I` is the identity matrix, which means only `1`s along the diagonal and `0`s everywhere else.
Unitary matrices preserve inner products: `(:UV,UV':)=(:V,V':)`.
`(:UV,UV':)`
`=(UV)^†***UV'`
`=V^†U^†***UV'`
`=V^†***I***V'`
`=V^†***V'`
`=(:V,V':)`
Unitary matrices also preserve norms: `abs(UV)=abs(V)`
`abs(UV)`
`sqrt((:UV,UV:))`
`=sqrt((:V,V:))`
`=abs(V)`
For vectors,
`[[x],[y]]ox[[a],[b],[c]]=[[x cdot [[a],[b],[c]]],[y cdot [[a],[b],[c]]]]`
For matrices,
`[[a_(0,0),a_(0,1)],[a_(1,0),a_(1,1)]]ox[[b_(0,0),b_(0,1),b_(0,2)],[b_(1,0),b_(1,1),b_(1,2)],[b_(2,0),b_(2,1),b_(2,2)]]=[[a_(0,0) cdot [[b_(0,0),b_(0,1),b_(0,2)],[b_(1,0),b_(1,1),b_(1,2)],[b_(2,0),b_(2,1),b_(2,2)]], a_(0,1) cdot [[b_(0,0),b_(0,1),b_(0,2)],[b_(1,0),b_(1,1),b_(1,2)],[b_(2,0),b_(2,1),b_(2,2)]]], [a_(1,0) cdot [[b_(0,0),b_(0,1),b_(0,2)],[b_(1,0),b_(1,1),b_(1,2)],[b_(2,0),b_(2,1),b_(2,2)]], a_(1,1) cdot [[b_(0,0),b_(0,1),b_(0,2)],[b_(1,0),b_(1,1),b_(1,2)],[b_(2,0),b_(2,1),b_(2,2)]]]]`
`=[[a_(0,0)xxb_(0,0),a_(0,0)xxb_(0,1),a_(0,0)xxb_(0,2),a_(0,1)xxb_(0,0),a_(0,1)xxb_(0,1),a_(0,1)xxb_(0,2)],[a_(0,0)xxb_(1,0),a_(0,0)xxb_(1,1),a_(0,0)xxb_(1,2),a_(0,1)xxb_(1,0),a_(0,1)xxb_(1,1),a_(0,1)xxb_(1,2)],[a_(0,0)xxb_(2,0),a_(0,0)xxb_(2,1),a_(0,0)xxb_(2,2),a_(0,1)xxb_(2,0),a_(0,1)xxb_(2,1),a_(0,1)xxb_(2,2)],[a_(1,0)xxb_(0,0),a_(1,0)xxb_(0,1),a_(1,0)xxb_(0,2),a_(1,1)xxb_(0,0),a_(1,1)xxb_(0,1),a_(1,1)xxb_(0,2)],[a_(1,0)xxb_(1,0),a_(1,0)xxb_(1,1),a_(1,0)xxb_(1,2),a_(1,1)xxb_(1,0),a_(1,1)xxb_(1,1),a_(1,1)xxb_(1,2)],[a_(1,0)xxb_(2,0),a_(1,0)xxb_(2,1),a_(1,0)xxb_(2,2),a_(1,1)xxb_(2,0),a_(1,1)xxb_(2,1),a_(1,1)xxb_(2,2)]]`