(git:27c966b)
Loading...
Searching...
No Matches
gw_utils_fm Module Reference

Full-matrix operations not provided by the CP2K FM packages. More...

Data Types

interface  fm_contract_aba

Functions/Subroutines

subroutine, public cfm_contract_aba (matrix_a, matrix_b, matrix_c, workspace)
 Computes A^H B A for complex full matrices.
subroutine, public local_add_on_diag (matrix, alpha)
 Add a scalar to the diagonal of a local complex matrix.
subroutine, public local_complex_power (matrix, exponent, eps, cond_nr, min_ev, max_ev, relative_eps)
 Compute a spectral power of a local complex Hermitian matrix. Eigenvalues not larger than eps (or relative_eps times the largest one) are discarded.
subroutine, public fm_invert (matrix_a, eigenvalue_threshold, unit_nr)
 Inverts a symmetric matrix. First, Cholesky decomposition is tried. If it fails, the matrix is diagonalized and inverted by taking inverse eigenvalues.
subroutine, public fm_sqrt (matrix_a, matrix_b, eigenvalue_threshold, unit_nr)
 For input A, computes B such that B^T B=A. First, Cholesky decomposition is tried. If it fails, B is computed by diagonalizing A.
subroutine, public fm_contract_aba (matrix_a, matrix_b, matrix_c)
 Computes A^T B A.

Detailed Description

Full-matrix operations not provided by the CP2K FM packages.

History
09.2026 created Jan Wilhelm

Function/Subroutine Documentation

◆ cfm_contract_aba()

subroutine, public gw_utils_fm::cfm_contract_aba ( type(cp_cfm_type), intent(in) matrix_a,
type(cp_cfm_type), intent(inout) matrix_b,
type(cp_cfm_type), intent(inout), optional matrix_c,
type(cp_cfm_type), intent(inout), optional workspace )

Computes A^H B A for complex full matrices.

Parameters
matrix_Aleft and right matrix A; H denotes its Hermitian transpose
matrix_Binput matrix B; overwritten by A^H B A if matrix_C is absent
matrix_Coptional output matrix C=A^H B A
workspaceoptional reusable scratch matrix with the same layout as A; its contents are overwritten and it must not alias the input or output matrices

Definition at line 58 of file gw_utils_fm.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ local_add_on_diag()

subroutine, public gw_utils_fm::local_add_on_diag ( complex(kind=dp), dimension(:, :), intent(inout) matrix,
complex(kind=dp), intent(in) alpha )

Add a scalar to the diagonal of a local complex matrix.

Parameters
matrixinput/output matrix
alphascalar added to each diagonal element

Definition at line 107 of file gw_utils_fm.F.

Here is the caller graph for this function:

◆ local_complex_power()

subroutine, public gw_utils_fm::local_complex_power ( complex(kind=dp), dimension(:, :), intent(inout) matrix,
real(kind=dp), intent(in) exponent,
real(kind=dp), intent(in) eps,
real(kind=dp), intent(out), optional cond_nr,
real(kind=dp), intent(out), optional min_ev,
real(kind=dp), intent(out), optional max_ev,
real(kind=dp), intent(in), optional relative_eps )

Compute a spectral power of a local complex Hermitian matrix. Eigenvalues not larger than eps (or relative_eps times the largest one) are discarded.

Parameters
matrixinput/output matrix
exponentmatrix exponent
epseigenvalue threshold
cond_nroptional condition number
min_evoptional minimum absolute eigenvalue
max_evoptional maximum absolute eigenvalue
relative_epsoptional threshold relative to the largest eigenvalue

Definition at line 133 of file gw_utils_fm.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fm_invert()

subroutine, public gw_utils_fm::fm_invert ( type(cp_fm_type), intent(inout) matrix_a,
real(kind=dp), intent(in), optional eigenvalue_threshold,
integer, intent(in), optional unit_nr )

Inverts a symmetric matrix. First, Cholesky decomposition is tried. If it fails, the matrix is diagonalized and inverted by taking inverse eigenvalues.

Parameters
matrix_Ainput A; output inverse or filtered pseudoinverse
eigenvalue_thresholdoptional relative eigenvalue threshold
unit_nroptional output unit for a failed Cholesky decomposition

Definition at line 189 of file gw_utils_fm.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fm_sqrt()

subroutine, public gw_utils_fm::fm_sqrt ( type(cp_fm_type), intent(in) matrix_a,
type(cp_fm_type), intent(inout) matrix_b,
real(kind=dp), intent(in), optional eigenvalue_threshold,
integer, intent(in), optional unit_nr )

For input A, computes B such that B^T B=A. First, Cholesky decomposition is tried. If it fails, B is computed by diagonalizing A.

Parameters
matrix_Asymmetric input matrix A, retained unchanged
matrix_Boutput matrix B
eigenvalue_thresholdoptional relative eigenvalue threshold
unit_nroptional output unit for a failed Cholesky decomposition

Definition at line 235 of file gw_utils_fm.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fm_contract_aba()

subroutine, public gw_utils_fm::fm_contract_aba ( type(cp_fm_type), intent(in) matrix_a,
type(cp_fm_type), intent(inout) matrix_b,
type(cp_fm_type), intent(inout), optional matrix_c )

Computes A^T B A.

Parameters
matrix_Aleft and right matrix A
matrix_Binput matrix B; overwritten by A^T B A if matrix_C is absent
matrix_Coptional output matrix C=A^T B A

Definition at line 287 of file gw_utils_fm.F.