This module implements the evaluation of the "matrix-exponential times vector" procedure using Krylov methods.
Evaluate the exponential of a dense matrix using Pade approximations.
E = expm(A, order)
E
: real
or complex
rank-2 array with .
A
: real
or complex
matrix that needs to be exponentiated.
order
(optional) : Order of the Pade approximation. By default order = 10
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | A(:,:) |
Matrix to be exponentiated. |
||
integer, | intent(in), | optional | :: | order |
Order of the Pade approximation. |
Output matrix E = exp(tA).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | A(:,:) |
Matrix to be exponentiated. |
||
integer, | intent(in), | optional | :: | order |
Order of the Pade approximation. |
Output matrix E = exp(tA).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(in) | :: | A(:,:) |
Matrix to be exponentiated. |
||
integer, | intent(in), | optional | :: | order |
Order of the Pade approximation. |
Output matrix E = exp(tA).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in) | :: | A(:,:) |
Matrix to be exponentiated. |
||
integer, | intent(in), | optional | :: | order |
Order of the Pade approximation. |
Output matrix E = exp(tA).
Utility function to evaluate the matrix-exponential times vector.
call k_exptA(vec_out, A, vec_in, tau, info, trans)
vec_out
: Output vector.
A
: Matrix to be exponentiated.
vec_in
: Input vector.
tau
: Integration time.
info
: Information flag.
trans
: Whether or is being used.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rsp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_rsp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rsp), | intent(in) | :: | vec_in |
Input vector to be multiplied by . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use adjoint ? |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rdp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_rdp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rdp), | intent(in) | :: | vec_in |
Input vector to be multiplied by . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use adjoint ? |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_csp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_csp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_csp), | intent(in) | :: | vec_in |
Input vector to be multiplied by . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use adjoint ? |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_cdp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_cdp), | intent(in) | :: | vec_in |
Input vector to be multiplied by . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use adjoint ? |
This interface provides methods to evaluate the matrix-vector product based on the Arnoldi method.
call kexpm(c, A, b, tau, tol, info [, trans] [, kdim])
c
: Output vector (or vectors). It is an intent(out)
argument.
A
: Linear operator to be exponentiated. It is an intent(in)
argument.
b
: Vector to be multiplied by . It is an intent(in)
argument.
tau
: real
(singe or double) time over which the matrix exponential needs to
be computed. It is an intent(in)
argument.
info
: integer
Information flag.
trans
(optional) : Whether or is being used.
(default trans=.false.
)
kdim
(optional) : Dimension of the Krylov subspace used in the Arnoldi method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rsp), | intent(out) | :: | c |
Best approximation of in the computed Krylov subspace |
||
class(abstract_linop_rsp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rsp), | intent(in) | :: | b |
Input vector on which to apply . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=sp), | intent(in) | :: | tol |
Solution tolerance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rsp), | intent(out) | :: | C(:) |
Best Krylov approximation of . |
||
class(abstract_linop_rsp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rsp), | intent(in) | :: | B(:) |
Input matrix on which to apply . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=sp), | intent(in) | :: | tol |
Solution toleance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rdp), | intent(out) | :: | c |
Best approximation of in the computed Krylov subspace |
||
class(abstract_linop_rdp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rdp), | intent(in) | :: | b |
Input vector on which to apply . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=dp), | intent(in) | :: | tol |
Solution tolerance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rdp), | intent(out) | :: | C(:) |
Best Krylov approximation of . |
||
class(abstract_linop_rdp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rdp), | intent(in) | :: | B(:) |
Input matrix on which to apply . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=dp), | intent(in) | :: | tol |
Solution toleance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_csp), | intent(out) | :: | c |
Best approximation of in the computed Krylov subspace |
||
class(abstract_linop_csp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_csp), | intent(in) | :: | b |
Input vector on which to apply . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=sp), | intent(in) | :: | tol |
Solution tolerance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_csp), | intent(out) | :: | C(:) |
Best Krylov approximation of . |
||
class(abstract_linop_csp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_csp), | intent(in) | :: | B(:) |
Input matrix on which to apply . |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=sp), | intent(in) | :: | tol |
Solution toleance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(out) | :: | c |
Best approximation of in the computed Krylov subspace |
||
class(abstract_linop_cdp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_cdp), | intent(in) | :: | b |
Input vector on which to apply . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=dp), | intent(in) | :: | tol |
Solution tolerance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(out) | :: | C(:) |
Best Krylov approximation of . |
||
class(abstract_linop_cdp), | intent(in) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_cdp), | intent(in) | :: | B(:) |
Input matrix on which to apply . |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for the exponentiation. |
||
real(kind=dp), | intent(in) | :: | tol |
Solution toleance based on error estimates. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
|
integer, | intent(in), | optional | :: | kdim |
Maximum size of the Krylov subspace. |
Abstract interface to define the matrix exponential-vector product.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_cdp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_cdp), | intent(in) | :: | vec_in |
Input vector. |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for integration. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
Abstract interface to define the matrix exponential-vector product.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_csp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_csp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_csp), | intent(in) | :: | vec_in |
Input vector. |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for integration. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
Abstract interface to define the matrix exponential-vector product.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rdp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_rdp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rdp), | intent(in) | :: | vec_in |
Input vector. |
||
real(kind=dp), | intent(in) | :: | tau |
Time horizon for integration. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |
Abstract interface to define the matrix exponential-vector product.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_rsp), | intent(out) | :: | vec_out |
Solution vector. |
||
class(abstract_linop_rsp), | intent(inout) | :: | A |
Linear operator to be exponentiated. |
||
class(abstract_vector_rsp), | intent(in) | :: | vec_in |
Input vector. |
||
real(kind=sp), | intent(in) | :: | tau |
Time horizon for integration. |
||
integer, | intent(out) | :: | info |
Information flag. |
||
logical, | intent(in), | optional | :: | trans |
Use transpose ? |