Linear Algebra: an Overview [1]

Concepts of Linear Algebra

Useful Libraries

Vector Space

Basic Vector Operations

Important Vectors

Matrix Space

Important Matrices

Dot Product

Vector Norms

Also known as $l_p$ norms. Notice how the values decrease as $p$ increases.

Matrix Norms

Solving Linear Equations

The function np.linalg.solve solves linear equations using LAPACK [Linear Algebra PACKage] routines [2] that use $LU$ decomposition with partial pivoting and row interchanges [3], which is much faster than computing inverses.

Inverse and Pseudo-inverse

Eigen/Spectral Decomposition

Singular Value Decomposition

Symmetric Matrix, Trace, and Determinant

Gradient Vector: Numerical Computation

Hessian Matrix: Numerical Computation

Visualizations of Linear Algebra

Plotting Vectors

The function np.random.rand generates an array of the specified shape, filled with random samples from a uniform distribution over $[0, 1)$ [4]. Consequently, each execution of the cell below will plot a distinct vector on the $1 \times 1$ grid.

Unit Simplex

Geometry of Vector Norms

Norm Balls

This cell may take longer to execute. Note that the $l_{0.5}$ ball is incomplete. Due to memory and time constraints, the arguments of np.linspace are designed to produce insufficient points. For more comprehensive visualizations, refer to resources available online [5].

References

1. Dr. Hassan Mohy Ud Din, "Lecture 0 – Linear Algebra, A Review", 2024
2. numpy.linalg.solve
3. gesv: factor and solve
4. numpy.random.rand
5. Graphing the $p$-Norm Unit Ball in 3 Dimensions