Content is user-generated and unverified.

Linear Algebra Algorithms Taxonomy

Based on "Matrix Computations" by Golub & Van Loan and "Numerical Linear Algebra" by Trefethen & Bau

Download Instructions: Copy this entire document and save it as a .md file (e.g., linear_algebra_taxonomy.md)

Code Examples Legend

  • 🐍 Python implementations
  • 💎 Ruby implementations
  • 📚 Educational/tutorial resources
  • 🏭 Production-ready libraries

Table of Contents

  1. Basic Vector and Matrix Operations
  2. Linear System Solution Algorithms
  3. Eigenvalue and Singular Value Algorithms
  4. Matrix Decomposition and Factorization
  5. Numerical Linear Algebra Infrastructure
  6. Advanced and Specialized Algorithms
  7. Additional Resources

I. Basic Vector and Matrix Operations

Vector Operations

AlgorithmDescriptionPythonRuby
Vector Addition/SubtractionElement-wise arithmeticNumPy basicsRuby Matrix
Scalar-Vector MultiplicationScaling by constantsNumPy broadcastingMatrix ops
Dot ProductInner product x^T ynumpy.dotNMatrix
Vector Norms‖x‖₁, ‖x‖₂, ‖x‖∞numpy.linalg.normNumo::Linalg
Cross Product3D vector x × ynumpy.crossVector class
Vector NormalizationConvert to unit lengthsklearn.preprocessingCustom Ruby
Hadamard ProductElement-wise multiplicationNumPy ufuncsNMatrix element-wise

Matrix-Vector Operations

AlgorithmDescriptionPythonRuby
Matrix-Vector MultiplicationComputing Axnumpy.dotMatrix multiply
Rank-1 UpdateA + uv^Tnumpy.outerOuter product
Outer ProductForm matrix from vectorsnumpy.outerRMatrix

Matrix-Matrix Operations

AlgorithmDescriptionPythonRuby
Matrix Addition/SubtractionElement-wise arithmeticNumPy operationsMatrix arithmetic
Standard Matrix MultiplyO(n³) algorithmnumpy.matmulMatrix multiply
Strassen's AlgorithmO(n^2.807)Strassen implRuby Strassen
Matrix TransposeComputing A^Tnumpy.transposeMatrix.transpose
Matrix Tracetr(A) = Σaᵢᵢnumpy.traceMatrix trace
Matrix PowersA^k efficientlymatrix_powerMatrix powers
Kronecker ProductA ⊗ Bnumpy.kronCustom Kronecker

II. Linear System Solution Algorithms

Direct Methods - Gaussian Elimination Family

AlgorithmDescriptionPythonRuby
Basic Gaussian EliminationForward elim + back subCustom implRuby GE
GE with Partial PivotingRow pivotingscipy.linalg.solveNMatrix
LU DecompositionA = LUscipy.linalg.luNMatrix LU
LU with PivotingPA = LUlu_factorNumo::Linalg

Direct Methods - Cholesky Family

AlgorithmDescriptionPythonRuby
Cholesky DecompositionA = LL^T (pos def)scipy.linalg.choleskyNMatrix Cholesky
LDL^T DecompositionA = LDL^Tscipy.linalg.ldlRuby LDL
Modified CholeskyFor indefinite matricesCustom implAdvanced Cholesky

Iterative Methods - Basic

AlgorithmDescriptionPythonRuby
Jacobi MethodSimple iterative solverJacobi implRuby Jacobi
Gauss-Seidel MethodSequential updatesGS solverIterative methods
SORSuccessive over-relaxationSOR implRuby SOR

Iterative Methods - Krylov Subspace

AlgorithmDescriptionPythonRuby
Conjugate GradientFor SPD systemsscipy.sparse.linalg.cgRuby CG
BiCG-STABStabilized BiCGbicgstabStabilized methods
GMRESGeneralized minimal residualgmresGMRES impl

III. Eigenvalue and Singular Value Algorithms

Eigenvalue Methods

AlgorithmDescriptionPythonRuby
QR AlgorithmAll eigenvaluesscipy.linalg.eigNMatrix eig
Power MethodDominant eigenvalueCustom powerRuby power
Inverse Power MethodSpecific eigenvalueInverse powerInverse iteration
Lanczos MethodSymmetric sparsescipy.sparse.linalg.eigshSparse methods
Arnoldi MethodNonsymmetric sparsescipy.sparse.linalg.eigsArnoldi impl

SVD Methods

AlgorithmDescriptionPythonRuby
Full SVDAll singular valuesscipy.linalg.svdNMatrix SVD
Truncated SVDLargest k valuesscipy.sparse.linalg.svdsTruncated SVD
Randomized SVDApproximate SVDsklearn randomized_svdRandom methods

IV. Matrix Decomposition and Factorization Algorithms

QR Decomposition

AlgorithmDescriptionPythonRuby
Householder QRUsing reflectorsscipy.linalg.qrNMatrix QR
Givens QRUsing rotationsGivens implRuby Givens
Modified Gram-SchmidtOrthogonalizationMGS implGram-Schmidt

Least Squares

AlgorithmDescriptionPythonRuby
Normal EquationsA^T A x = A^T bCustom implNormal eq
QR Least SquaresUsing QR decompscipy.linalg.lstsqNMatrix lstsq
Ridge RegressionL2 regularizedsklearn RidgeRuby ridge
LASSOL1 regularizedsklearn LassoLASSO methods

V. Numerical Linear Algebra Infrastructure

BLAS (Basic Linear Algebra Subprograms)

LevelOperationsPythonRuby
Level 1Vector-vector (AXPY, DOT, NRM2)NumPy basicsNumo::Linalg
Level 2Matrix-vector (GEMV, GER)scipy.linalg.blasBLAS wrappers
Level 3Matrix-matrix (GEMM, TRMM)scipy.linalg.blasMatrix ops

LAPACK Routines

CategoryRoutinesPythonRuby
Linear SolversGESV, POSVscipy.linalg.solveLAPACK bindings
Least SquaresGELS, GELSYscipy.linalg.lstsqLS solvers
EigenvaluesSYEV, GEEVscipy.linalg.eigEigensolvers
SVDGESVD, GESDDscipy.linalg.svdSVD routines

VI. Advanced and Specialized Algorithms

Matrix Functions

FunctionDescriptionPythonRuby
Matrix Exponentiale^Ascipy.linalg.expmMatrix exp
Matrix Logarithmlog(A)scipy.linalg.logmMatrix log
Matrix Square RootA^(1/2)scipy.linalg.sqrtmMatrix sqrt

Structured Matrices

TypeDescriptionPythonRuby
ToeplitzConstant diagonalsscipy.linalg.toeplitzToeplitz algs
HankelConstant anti-diagonalsscipy.linalg.hankelHankel methods
CirculantFFT-based operationsscipy.linalg.circulantCirculant algs
VandermondeFast solversnumpy.vanderVandermonde

Randomized Linear Algebra

AlgorithmDescriptionPythonRuby
Random ProjectionsJL embeddingssklearn random_projectionRandom proj
SketchingMatrix sketchingCustom implSketching methods

Additional Resources

Comprehensive Libraries

Python Ecosystem 🐍

Ruby Ecosystem 💎

Educational Resources 📚

Python

Ruby

Textbook References 📖

  1. "Matrix Computations" by Gene H. Golub and Charles F. Van Loan
  2. "Numerical Linear Algebra" by Lloyd N. Trefethen and David Bau III
  3. "Applied Numerical Linear Algebra" by James W. Demmel
  4. "Iterative Methods for Sparse Linear Systems" by Yousef Saad

Performance Libraries 🏭

  • Intel MKL - Optimized BLAS/LAPACK
  • OpenBLAS - Open source BLAS
  • ATLAS - Automatically Tuned Linear Algebra Software
  • cuBLAS - GPU-accelerated BLAS (NVIDIA)

How to Use This Document

For Learners

  1. Start with Section I for basic operations
  2. Progress to Section II for solving linear systems
  3. Study Section III for eigenvalue problems
  4. Explore advanced topics in Sections IV-VI

For Practitioners

  • Use the table format to quickly find implementations
  • Compare Python and Ruby approaches
  • Reference production libraries for actual work
  • Use educational links for understanding algorithms

For Researchers

  • Check textbook references for theoretical foundations
  • Explore specialized algorithms in Section VI
  • Review performance-oriented implementations
  • Consider contributing to open-source projects

License: This taxonomy is provided for educational purposes. Individual implementations are subject to their respective licenses.

Last Updated: December 2024

Contributors Welcome: Submit issues or pull requests to improve this taxonomy.

Content is user-generated and unverified.
    Linear Algebra Algorithms Taxonomy: Complete Guide | Claude