File Exchange

image thumbnail

Matrix exponential times a vector.

version (9.25 KB) by Nick Higham
Computing the matrix exponential times a vector without explicitly computing the matrix exponential.


Updated 30 Nov 2010

View License

This submission contains two functions for computing EXPM(t*A)*b without explicitly forming EXPM(t*A), where A is an n-by-n matrix and b is an n-by-1 vector. This is the problem of computing the action of the matrix exponential on a vector.

EXPMV(t,A,B, computes EXPM(t*A)*B, while EXPMV_TSPAN(A,b,t0,tmax,q) computes EXPM(t*A)*b for q+1 >= 2 equally spaced values of T between T0 and TMAX.

The functions work for any matrix A, and use just matrix-vector products with A and A^*.

Function TEST.M runs a simple test of the codes.

Details on the underlying algorithms can be found in

A. H. Al-Mohy and N. J. Higham. Computing the action of the matrix exponential, with an application to exponential integrators. MIMS EPrint 2010.30, The University of Manchester, 2010; to appear in SIAM J. Sci. Comput.

Cite As

Nick Higham (2021). Matrix exponential times a vector. (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Pontus Vikstål

Can I use this if expm(A(t))*b where A(t) is a linear function that depends on time?

Pontus Vikstål

How can I use this if I want to compute expm(t*A+B)*b ?

Raphael Kaubruegger

Nike Dattani

I am also interested in large matrices, and particularly on sparse large matrices that still take up ~ 100GB despite being sparse (!)



Has anyone used this algorithm with large matrices?
It seems to be extremely fast for small matrices, but on matrices on the order of gigabytes I get much slower results than simpler methods.

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!