Tag: linear algebra
-
Krylov Matrix Exponential
Welcome file The Matrix exponential Consider a vector-valued function v⃗(t)\vec{v}(t)v(t) whose total derivative with respect to its argument is given explicitly by a linear operator AAA (which we’ll represent as a matrix): dv⃗(t)dt=v⃗(t)A.\frac{d\vec{v}(t)}{dt} = \vec{v}(t) A .dtdv(t)=v(t)A. Suppose at some ttt we know the function’s value v⃗(0)\vec{v}(0)v(0). (N.B. We’ve chosen t=0t=0t=0 here without losing generality;…
-
Sparse Matrices in Numba
Welcome file Introduction What is a sparse matrix? Creating a sparse matrix Adding and subtracting sparse matrices Multiplying sparse matrices Multiply matrix and vector The dot function Summing over a dimension Wall time comparison Using smn within a Numba compiled function Conclusion Introduction Numba is a widely-used just-in-time (JIT) compiler for Python that optimizes the…