LightKrylov_ExpmLib Module

This module implements the evaluation of the "matrix-exponential times vector" procedure using Krylov methods.



Interfaces

public interface expm

Description

Evaluate the exponential of a dense matrix using Pade approximations.

Syntax

    E = expm(A, order)

Arguments

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.

  • private function expm_rsp(A, order) result(E)

    Arguments

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

    Matrix to be exponentiated.

    integer, intent(in), optional :: order

    Order of the Pade approximation.

    Return Value real(kind=sp), (size(A,1),size(A,1))

    Output matrix E = exp(tA).

  • private function expm_rdp(A, order) result(E)

    Arguments

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

    Matrix to be exponentiated.

    integer, intent(in), optional :: order

    Order of the Pade approximation.

    Return Value real(kind=dp), (size(A,1),size(A,1))

    Output matrix E = exp(tA).

  • private function expm_csp(A, order) result(E)

    Arguments

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

    Matrix to be exponentiated.

    integer, intent(in), optional :: order

    Order of the Pade approximation.

    Return Value complex(kind=sp), (size(A,1),size(A,1))

    Output matrix E = exp(tA).

  • private function expm_cdp(A, order) result(E)

    Arguments

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

    Matrix to be exponentiated.

    integer, intent(in), optional :: order

    Order of the Pade approximation.

    Return Value complex(kind=dp), (size(A,1),size(A,1))

    Output matrix E = exp(tA).

public interface k_exptA

Description

Utility function to evaluate the matrix-exponential times vector.

Syntax

    call k_exptA(vec_out, A, vec_in, tau, info, trans)

Arguments

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.

  • private subroutine k_exptA_rsp(vec_out, A, vec_in, tau, info, trans)

    Arguments

    Type IntentOptional 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 ?

  • private subroutine k_exptA_rdp(vec_out, A, vec_in, tau, info, trans)

    Arguments

    Type IntentOptional 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 ?

  • private subroutine k_exptA_csp(vec_out, A, vec_in, tau, info, trans)

    Arguments

    Type IntentOptional 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 ?

  • private subroutine k_exptA_cdp(vec_out, A, vec_in, tau, info, trans)

    Arguments

    Type IntentOptional 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 ?

public interface kexpm

Description

This interface provides methods to evaluate the matrix-vector product based on the Arnoldi method.

Syntax

    call kexpm(c, A, b, tau, tol, info [, trans] [, kdim])

Arguments

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.

  • private subroutine kexpm_vec_rsp(c, A, b, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_mat_rsp(C, A, B, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_vec_rdp(c, A, b, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_mat_rdp(C, A, B, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_vec_csp(c, A, b, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_mat_csp(C, A, B, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_vec_cdp(c, A, b, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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.

  • private subroutine kexpm_mat_cdp(C, A, B, tau, tol, info, trans, kdim)

    Arguments

    Type IntentOptional 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 Interfaces

abstract interface

  • public subroutine abstract_exptA_cdp(vec_out, A, vec_in, tau, info, trans)

    Abstract interface to define the matrix exponential-vector product.

    Arguments

    Type IntentOptional 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

  • public subroutine abstract_exptA_csp(vec_out, A, vec_in, tau, info, trans)

    Abstract interface to define the matrix exponential-vector product.

    Arguments

    Type IntentOptional 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

  • public subroutine abstract_exptA_rdp(vec_out, A, vec_in, tau, info, trans)

    Abstract interface to define the matrix exponential-vector product.

    Arguments

    Type IntentOptional 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

  • public subroutine abstract_exptA_rsp(vec_out, A, vec_in, tau, info, trans)

    Abstract interface to define the matrix exponential-vector product.

    Arguments

    Type IntentOptional 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 ?