WOLFRAM

gives the matrix exponential of m.

MatrixExp[m,v]

gives the matrix exponential of m applied to the vector v.

Details and Options

  • MatrixExp[m] effectively evaluates the power series for the exponential function, with ordinary powers replaced by matrix powers. »
  • MatrixExp works only on square matrices.

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Exponential of a 3×3 numerical matrix:

Out[4]=4

This is not simply the exponential of each entry in the matrix:

Exponential of a 2×2 symbolic matrix:

Exponential applied to a vector:

Out[1]=1

Scope  (12)Survey of the scope of standard use cases

Basic Uses  (7)

Exponentiate a machine-precision matrix:

Out[1]=1

Exponentiate a complex matrix:

Out[1]=1

Compute the exponential of an exact matrix:

Out[1]=1

The exponential of an arbitrary-precision matrix:

Out[1]=1

Exponential of a symbolic matrix:

Out[1]=1

Computing the exponential of large machine-precision matrices is efficient:

Out[2]=2

Directly applying the exponential to a single vector is even more efficient:

Out[3]=3

The exponential of a CenteredInterval matrix:

Find a random representative mrep of m:

Verify that mexp contains the exponential of mrep:

Special Matrices  (5)

The exponential of an exact sparse matrix is typically returned as a normal matrix:

Out[1]=1
Out[2]=2

Format the result:

If the sparse matrix contains machine-precision elements, the result is typically sparse:

Out[4]=4

The two results are equal:

Out[5]=5

Directly apply the matrix exponential of a sparse matrix to a sparse vector:

Out[1]=1
Out[2]=2

Compute the exponential of a structured array:

Out[1]=1
Out[2]=2

Exponentiate IdentityMatrix:

Out[1]=1

More generally, the exponential of any diagonal matrix is the exponential of its diagonal elements:

Out[2]=2

Exponentiate HilbertMatrix:

Applications  (5)Sample problems that can be solved with this function

Suppose a particle is moving in a planar force field and its position vector satisfies and , where and are as follows. Solve this initial problem for :

The solution to this differential equation is :

Out[3]=3

Verify the solution using DSolveValue:

Out[4]=4

A system of first-order linear differential equations:

Write the system in the form with :

The matrix exponential gives the basis for the general solution:

Out[4]=4

The matrix exponential applied to a vector gives a particular solution:

Out[6]=6

In quantum mechanics, the energy operator is called the Hamiltonian . Given the Hamiltonian for a spin-1 particle in constant magnetic field in the direction, find the state at time of a particle that is initially in the state representing :

The system evolves according to the Schrödinger equation :

Out[2]=2

Cross products with respect to fixed three-dimensional vectors can be represented by matrix multiplication, which is useful in studying rotational motion. Construct the antisymmetric matrix representing the linear operator , where is an angular velocity about the axis:

Verify that the action of is the same as doing a cross product with :

Out[3]=3

The rotation matrix at time is the matrix exponential of times the previous matrix:

Verify using RotationMatrix:

Out[5]=5

The point at time zero will be at time :

Out[6]=6

The velocity of will be given by :

Out[7]=7

And the vector from the axis of rotation to is (v(t)xomega)/(TemplateBox[{omega}, Norm]^2):

Out[8]=8

Visualize this motion and the associated vectors:

Out[9]=9

The matrix s approximates the second derivative periodic on on the grid x:

Out[1]=1

A vector representing a soliton on the grid x:

Out[2]=2

Propagate the solution of using a splitting :

Out[3]=3

Plot the solution and 10 times the error from the solution of the cubic Schrödinger equation:

Out[4]=4

Properties & Relations  (10)Properties of the function, and connections to other functions

MatrixExp effectively uses the power series for Exp, with Power replaced by MatrixPower:

Out[2]=2

Equivalently, MatrixExp is MatrixFunction applied to Exp:

Out[3]=3

The matrix exponential of a diagonal matrix is a diagonal matrix with the diagonal entries exponentiated:

Out[2]=2
Out[3]=3

If m is diagonalizable with , then exp(m)=TemplateBox[{v}, Inverse].exp(d).v:

Out[2]=2
Out[3]=3

MatrixExp[m] is always invertible, and the inverse is given by MatrixExp[-m]:

Out[2]=2
Out[3]=3

MatrixExp of a real, antisymmetric matrix is orthogonal:

Out[2]=2
Out[3]=3

MatrixExp of an antihermitian matrix is unitary:

Out[2]=2
Out[3]=3

MatrixExp of a Hermitian matrix is positive-definite:

Out[2]=2
Out[3]=3

MatrixExp satisfies :

Out[2]=2

The matrix exponential of a nilpotent matrix is a polynomial in the exponentiation parameter:

Confirm that is nilpotent ( for some ):

Out[3]=3

can be computed from the JordanDecomposition as s.exp(j).TemplateBox[{s}, Inverse]

Out[1]=1

Moreover, is zero except in upper triangular blocks delineated by s in the superdiagonal:

Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

For a large sparse matrix, computing the matrix exponential may take a long time:

Out[1]=1
Out[2]=2

Computing the application of it to a vector uses less memory and is much faster:

Out[3]=3

The results are essentially the same:

Out[4]=4

Neat Examples  (1)Surprising or curious use cases

Out[2]=2
Wolfram Research (1991), MatrixExp, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixExp.html (updated 2024).
Wolfram Research (1991), MatrixExp, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixExp.html (updated 2024).

Text

Wolfram Research (1991), MatrixExp, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixExp.html (updated 2024).

Wolfram Research (1991), MatrixExp, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixExp.html (updated 2024).

CMS

Wolfram Language. 1991. "MatrixExp." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MatrixExp.html.

Wolfram Language. 1991. "MatrixExp." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MatrixExp.html.

APA

Wolfram Language. (1991). MatrixExp. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixExp.html

Wolfram Language. (1991). MatrixExp. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixExp.html

BibTeX

@misc{reference.wolfram_2025_matrixexp, author="Wolfram Research", title="{MatrixExp}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixExp.html}", note=[Accessed: 29-March-2025 ]}

@misc{reference.wolfram_2025_matrixexp, author="Wolfram Research", title="{MatrixExp}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixExp.html}", note=[Accessed: 29-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_matrixexp, organization={Wolfram Research}, title={MatrixExp}, year={2024}, url={https://reference.wolfram.com/language/ref/MatrixExp.html}, note=[Accessed: 29-March-2025 ]}

@online{reference.wolfram_2025_matrixexp, organization={Wolfram Research}, title={MatrixExp}, year={2024}, url={https://reference.wolfram.com/language/ref/MatrixExp.html}, note=[Accessed: 29-March-2025 ]}