matrix_exp Interface

public interface matrix_exp

Matrix exponential: subroutine interface version : experimental

Computes the exponential of a matrix using a rational Pade approximation. (Specification)

Description

This interface provides methods for computing the exponential of a matrix represented as a standard Fortran rank-2 array. Supported data types include real and complex.

By default, the order of the Pade approximation is set to 10. It can be changed via the order argument that must be non-negative.

If the input matrix is non-square or the order of the Pade approximation is negative, the function returns an error state.

Example

 real(dp) :: A(3, 3), E(3, 3)

 A = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

 ! Default Pade approximation of the matrix exponential.
 call matrix_exp(A, E) ! Out-of-place
 ! call matrix_exp(A) for in-place computation.

 ! Pade approximation with specified order.
 call matrix_exp(A, E, order=12)

Subroutines

private module subroutine stdlib_linalg_c_expm(A, E, order, err)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: A(:,:)

Input matrix A(n, n)

complex(kind=sp), intent(out) :: E(:,:)

Output matrix exponential E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_c_expm_inplace(A, order, err)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(inout) :: A(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_d_expm(A, E, order, err)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)

Input matrix A(n, n)

real(kind=dp), intent(out) :: E(:,:)

Output matrix exponential E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_d_expm_inplace(A, order, err)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: A(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_s_expm(A, E, order, err)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: A(:,:)

Input matrix A(n, n)

real(kind=sp), intent(out) :: E(:,:)

Output matrix exponential E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_s_expm_inplace(A, order, err)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: A(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_z_expm(A, E, order, err)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: A(:,:)

Input matrix A(n, n)

complex(kind=dp), intent(out) :: E(:,:)

Output matrix exponential E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.

private module subroutine stdlib_linalg_z_expm_inplace(A, order, err)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout) :: A(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

type(linalg_state_type), intent(out), optional :: err

[optional] Error handling.