LightKrylov_AbstractLinops Module

This module provides the base classes abtract_linop_rsp, abstract_linop_rdp, abstract_linop_csp and abstract_linop_cdp which can be used to define your own linear operators. To do so, you simply need to provide two type-bound procedures:

  • matvec(self, vec_in, vec_out) : Computes the matrix-vector product.
  • rmatvec(self, vec_in, vec_out): Computes the transpose matrix-vector product.

It also provides extended types to define the identity operator, symmetric linear operators, scalar-multiplication of a linear multiplication, as well as addition of two linear operators.



Derived Types

type, public, extends(abstract_linop_cdp) ::  Id_cdp

Utility type to define the Identity operator. Note that the type-bound procedures for matvec and rmatvec do not have to be defined by the user.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => id_matvec_cdp
procedure, public, pass(self) :: rmatvec => id_matvec_cdp

type, public, extends(abstract_linop_csp) ::  Id_csp

Utility type to define the Identity operator. Note that the type-bound procedures for matvec and rmatvec do not have to be defined by the user.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => id_matvec_csp
procedure, public, pass(self) :: rmatvec => id_matvec_csp

type, public, extends(abstract_linop_rdp) ::  Id_rdp

Utility type to define the Identity operator. Note that the type-bound procedures for matvec and rmatvec do not have to be defined by the user.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => id_matvec_rdp
procedure, public, pass(self) :: rmatvec => id_matvec_rdp

type, public, extends(abstract_linop_rsp) ::  Id_rsp

Utility type to define the Identity operator. Note that the type-bound procedures for matvec and rmatvec do not have to be defined by the user.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => id_matvec_rsp
procedure, public, pass(self) :: rmatvec => id_matvec_rsp

type, public, abstract, extends(abstract_linop_cdp) ::  abstract_hermitian_linop_cdp

Abstract representation of an abstract hermitian (complex-valued) linear operator.

Type-Bound Procedures

procedure(abstract_matvec_cdp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_cdp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop_csp) ::  abstract_hermitian_linop_csp

Abstract representation of an abstract hermitian (complex-valued) linear operator.

Type-Bound Procedures

procedure(abstract_matvec_csp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_csp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract ::  abstract_linop

Base type to define an abstract linear operator. All other types defined in LightKrylov derive from this fundamental one.

Read more…

type, public, abstract, extends(abstract_linop) ::  abstract_linop_cdp

Base type to extend in order to define a complex(dp)-valued linear operator.

Type-Bound Procedures

procedure(abstract_matvec_cdp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_cdp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop) ::  abstract_linop_csp

Base type to extend in order to define a complex(sp)-valued linear operator.

Type-Bound Procedures

procedure(abstract_matvec_csp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_csp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop) ::  abstract_linop_rdp

Base type to extend in order to define a real(dp)-valued linear operator.

Type-Bound Procedures

procedure(abstract_matvec_rdp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_rdp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop) ::  abstract_linop_rsp

Base type to extend in order to define a real(sp)-valued linear operator.

Type-Bound Procedures

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop_rdp) ::  abstract_sym_linop_rdp

Abstract representation of an abstract symmetric (real valued) linear operator.

Type-Bound Procedures

procedure(abstract_matvec_rdp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_rdp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, abstract, extends(abstract_linop_rsp) ::  abstract_sym_linop_rsp

Abstract representation of an abstract symmetric (real valued) linear operator.

Type-Bound Procedures

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: matvec ../../

Procedure to compute the matrix-vector product .

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: rmatvec ../../

Procedure to compute the reversed matrix-vector product .

type, public, extends(abstract_linop_cdp) ::  adjoint_linop_cdp

Utility type to define an adjoint linear operator. The definition of matvec and rmatvec are directly inherited from those used to define A. Note that this utility does not compute the adjoint for you. It simply provides a utility to define a new operator with matvec and rmatvec being switched.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_cdp), public, allocatable :: A

Linear operator whose adjoint needs to be defined.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => adjoint_matvec_cdp
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_cdp

type, public, extends(abstract_linop_csp) ::  adjoint_linop_csp

Utility type to define an adjoint linear operator. The definition of matvec and rmatvec are directly inherited from those used to define A. Note that this utility does not compute the adjoint for you. It simply provides a utility to define a new operator with matvec and rmatvec being switched.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_csp), public, allocatable :: A

Linear operator whose adjoint needs to be defined.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => adjoint_matvec_csp
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_csp

type, public, extends(abstract_linop_rdp) ::  adjoint_linop_rdp

Utility type to define an adjoint linear operator. The definition of matvec and rmatvec are directly inherited from those used to define A. Note that this utility does not compute the adjoint for you. It simply provides a utility to define a new operator with matvec and rmatvec being switched.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rdp), public, allocatable :: A

Linear operator whose adjoint needs to be defined.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => adjoint_matvec_rdp
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_rdp

type, public, extends(abstract_linop_rsp) ::  adjoint_linop_rsp

Utility type to define an adjoint linear operator. The definition of matvec and rmatvec are directly inherited from those used to define A. Note that this utility does not compute the adjoint for you. It simply provides a utility to define a new operator with matvec and rmatvec being switched.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rsp), public, allocatable :: A

Linear operator whose adjoint needs to be defined.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => adjoint_matvec_rsp
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_rsp

type, public, extends(abstract_linop_cdp) ::  axpby_linop_cdp

Utility type to define a composite linear operator . The definitions of matvec and rmatvec are directly inherited from those used to define A and B.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_cdp), public, allocatable :: A

Underlying linear operators.

class(abstract_linop_cdp), public, allocatable :: B

Underlying linear operators.

complex(kind=dp), public :: alpha

Scaling factors.

complex(kind=dp), public :: beta

Scaling factors.

logical, public :: transA = .false.

Logical flag to control whether and/or need to be transposed.

logical, public :: transB = .false.

Logical flag to control whether and/or need to be transposed.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => axpby_matvec_cdp
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_cdp

type, public, extends(abstract_linop_csp) ::  axpby_linop_csp

Utility type to define a composite linear operator . The definitions of matvec and rmatvec are directly inherited from those used to define A and B.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_csp), public, allocatable :: A

Underlying linear operators.

class(abstract_linop_csp), public, allocatable :: B

Underlying linear operators.

complex(kind=sp), public :: alpha

Scaling factors.

complex(kind=sp), public :: beta

Scaling factors.

logical, public :: transA = .false.

Logical flag to control whether and/or need to be transposed.

logical, public :: transB = .false.

Logical flag to control whether and/or need to be transposed.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => axpby_matvec_csp
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_csp

type, public, extends(abstract_linop_rdp) ::  axpby_linop_rdp

Utility type to define a composite linear operator . The definitions of matvec and rmatvec are directly inherited from those used to define A and B.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rdp), public, allocatable :: A

Underlying linear operators.

class(abstract_linop_rdp), public, allocatable :: B

Underlying linear operators.

real(kind=dp), public :: alpha

Scaling factors.

real(kind=dp), public :: beta

Scaling factors.

logical, public :: transA = .false.

Logical flag to control whether and/or need to be transposed.

logical, public :: transB = .false.

Logical flag to control whether and/or need to be transposed.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => axpby_matvec_rdp
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_rdp

type, public, extends(abstract_linop_rsp) ::  axpby_linop_rsp

Utility type to define a composite linear operator . The definitions of matvec and rmatvec are directly inherited from those used to define A and B.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rsp), public, allocatable :: A

Underlying linear operators.

class(abstract_linop_rsp), public, allocatable :: B

Underlying linear operators.

real(kind=sp), public :: alpha

Scaling factors.

real(kind=sp), public :: beta

Scaling factors.

logical, public :: transA = .false.

Logical flag to control whether and/or need to be transposed.

logical, public :: transB = .false.

Logical flag to control whether and/or need to be transposed.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => axpby_matvec_rsp
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_rsp

type, public, extends(abstract_linop_cdp) ::  scaled_linop_cdp

Defines a scaled linear operator with a complex-valued operator and .

Components

Type Visibility Attributes Name Initial
class(abstract_linop_cdp), public, allocatable :: A

Base linear operator to be scaled.

complex(kind=dp), public :: sigma

Scaling factor.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => scaled_matvec_cdp
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_cdp

type, public, extends(abstract_linop_csp) ::  scaled_linop_csp

Defines a scaled linear operator with a complex-valued operator and .

Components

Type Visibility Attributes Name Initial
class(abstract_linop_csp), public, allocatable :: A

Base linear operator to be scaled.

complex(kind=sp), public :: sigma

Scaling factor.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => scaled_matvec_csp
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_csp

type, public, extends(abstract_linop_rdp) ::  scaled_linop_rdp

Defines a scaled linear operator with a real-valued operator and . The definitions of matvec and rmatvec are directly inherited from those used to define A and do not have to be defined by the user.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rdp), public, allocatable :: A

Base linear operator to be scaled.

real(kind=dp), public :: sigma

Scaling factor.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => scaled_matvec_rdp
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_rdp

type, public, extends(abstract_linop_rsp) ::  scaled_linop_rsp

Defines a scaled linear operator with a real-valued operator and . The definitions of matvec and rmatvec are directly inherited from those used to define A and do not have to be defined by the user.

Components

Type Visibility Attributes Name Initial
class(abstract_linop_rsp), public, allocatable :: A

Base linear operator to be scaled.

real(kind=sp), public :: sigma

Scaling factor.

Type-Bound Procedures

procedure, public, pass(self) :: matvec => scaled_matvec_rsp
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_rsp