Orthonormal bases
On this page
Used in matrix multiplication. For two vectors use 1D array in python
import numpy as np
v = np.array([[1],[2],[3]])
g = np.array([[3],[2],[1]])
print((v.T@g)[0,0])
#or
print(np.dot(v.T,g)[0,0])
Definition:
Show code (13 lines)
Exercise 6.1.
Norm
Euclidean Norm is has a geometrical interpretation. Using pythagorean theorem as often as we get the norm or length of a vector
Linearity of the Euclidean norm doesn’t hold:
In fact:
Since geometrically x+y represents the fast way (Triangle inequality).
The dot product of a vector with itself is the squared Euclidean norm:
Manhattan norm
Defined by:
Norm
Metric
Orthogonal Projection
Orthogonal Projection onto a line spanned by vector v.
Find orthogonal vector w:
we can write w as and yields a decomposition of u as sum of two vectors which are orthogonal.
Orthonormal
A set is orthogonal if any two vectors in that set are orthogonal (i.e., linear independent: or ).
A set is orthonormal if any two vectors in that set are orthogonal and each vector is normalized (i.e., or ).
- An orthonormal set is also called orthonormal system (ONS for short).
- Normalize vectors by diving each components with the norm () of vector.
- Orthonormal basis span a vector space:
- each vector in that space can be formulated as linear transformation of those basis .
- Finding the coordinates can be done by and .
Whats the use of orthonormal basis (ONB)?
U linear subspace of and is orthonormal basis of U. Then, for each we have:
so we can decompose each vector into a linear combination of the orthonormal basis (think in geometrical terms where we scale and add x and y basis to display a vector). are the coordinates with respect to the basis and we normally have to solve a linear system with gaussian elimination to find these coordinates (where coordinates are the unknown: ).
But with ONB we can directly calculate these coordinates with dot product:
In with and :
The coordinate vector of is with respect to basis and but these are normally not the same.
Gram-Schmidt Process
Tips for normalizing (extract annoying variables that get canceld out later here ):
Python:
numpy.linalg.norm(v,1) #Manhattan-norm
numpy.linalg.norm(v,2) #Euclidean-norm Deafault
numpy.linalg.norm(v,np.inf) #Maxnorm
# Gram-Schmidt-Process
Q,R = numpy.linalg.qr(A) #retursn two matrices: Q is results, R additional Infos
Spectral Theorem
Facts about: symmetric matrices (A = A.T)
- Must be square matrix ()
- Diagonalizable (so there exist an eigenbasis of : so we can transfrom A with matrix consisting of eigenbasis)
- if eigenvectors are different -> eigenspaces of these vectors are orthogonal
- decomposed original space into subspaces which are orthogonal
- Applying Gram-Schmidt on all eigenspaces, one obtains an orthonormal basis consisting of eigenvectors of A$ ^n$
Facts about: Orthogonal Matrices:
- if and form ONB:
- Then the matrix V consisting of satisfies: since dot product of individual columns are zero except with itself (gives 1).
- Matrix V is called orthogonal (better: orthonormal?)
- Inverse of V is -Finally:
- Principal Axis Transformation(Matrix decomposition) $ A = VDV^T$
How to calculate V?:
- Find all eigenvectors(+values)
- Apply Gram-Schmidt to all eigenspaces
Singular Value Decomposition (SVD)
“Generalization of eigenvalue decomposition”. SVD exists for all matrices not just squared ones.
Principale Axis Decomposition:
- A symmetric:
- is orthogonal, diagonale
- If A symmetric then SVD is the same.
- A general (rectangle):
- orthogonal, orthogonal(“diagonal”)
has same shape as A with as diagonal entries everything else is zero. These entries are the singular values of A (generalization of eigenvalues). We are only interested in non-zero singular values which equals the rank of A.
Angles between vectors
Back to top