## Documentation for module iterate_matrix

Routines useful for iterative matrix calculations

source: iterate_matrix.F

purify_mcweeny

#### public Subroutines/Functions:

invert a symmetric positive definite matrix by Hotelling's method explicit symmetrization makes this code not suitable for other matrix types Currently a bit messy with the options, to to be cleaned soon
compute the sign a matrix using Newton-Schulz iterations
compute the sqrt of a matrix via the sign function and the corresponding Newton-Schulz iterations the order of the algorithm should be 2..5, 3 or 5 is recommended

#### Generic procedure purify_mcweeny^

...

:: matrix_p(:) × ×
REAL(dp)
:: threshold × ×
INTEGER
:: max_steps × ×
:: matrix_s ×

#### SUBROUTINEinvert_hotelling(matrix_inverse, matrix, threshold, use_inv_as_guess, norm_convergence, filter_eps, silent)^

invert a symmetric positive definite matrix by Hotelling's method explicit symmetrization makes this code not suitable for other matrix types Currently a bit messy with the options, to to be cleaned soon

##### Arguments:
 TYPE(dbcsr_type), INTENT(inout), TARGET :: matrix_inverse ... TYPE(dbcsr_type), INTENT(inout), TARGET :: matrix ... REAL(dp), INTENT(in) :: threshold convergence threshold nased on the max abs LOGICAL, INTENT(in), OPTIONAL :: use_inv_as_guess logical whether input can be used as guess for inverse REAL(dp), INTENT(in), OPTIONAL :: norm_convergence convergence threshold for the 2-norm, useful for approximate solutions REAL(dp), INTENT(in), OPTIONAL :: filter_eps filter_eps for matrix multiplications, if not passed nothing is filteres LOGICAL, INTENT(in), OPTIONAL :: silent ...

#### SUBROUTINEmatrix_sign_newton_schulz(matrix_sign, matrix, threshold)^

compute the sign a matrix using Newton-Schulz iterations

##### Arguments:
 TYPE(dbcsr_type), INTENT(inout) :: matrix_sign ... TYPE(dbcsr_type), INTENT(inout) :: matrix ... REAL(dp), INTENT(in) :: threshold ...

#### SUBROUTINEmatrix_sqrt_newton_schulz(matrix_sqrt, matrix_sqrt_inv, matrix, threshold, order, eps_lanczos, max_iter_lanczos, converged)^

compute the sqrt of a matrix via the sign function and the corresponding Newton-Schulz iterations the order of the algorithm should be 2..5, 3 or 5 is recommended

##### Arguments:
 TYPE(dbcsr_type), INTENT(inout) :: matrix_sqrt ... TYPE(dbcsr_type), INTENT(inout) :: matrix_sqrt_inv ... TYPE(dbcsr_type), INTENT(inout) :: matrix ... REAL(dp), INTENT(in) :: threshold ... INTEGER, INTENT(in) :: order ... REAL(dp), INTENT(in) :: eps_lanczos ... INTEGER, INTENT(in) :: max_iter_lanczos ... LOGICAL, OPTIONAL :: converged ...

#### SUBROUTINEpurify_mcweeny_orth(matrix_p, threshold, max_steps)^

McWeeny purification of a matrix in the orthonormal basis

##### Arguments:
 TYPE(dbcsr_type) :: matrix_p(:) Matrix to purify (needs to be almost idempotent already) REAL(dp) :: threshold Threshold used as filter_eps and convergence criteria INTEGER :: max_steps Max number of iterations

#### SUBROUTINEpurify_mcweeny_nonorth(matrix_p, matrix_s, threshold, max_steps)^

McWeeny purification of a matrix in the non-orthonormal basis

##### Arguments:
 TYPE(dbcsr_type) :: matrix_p(:) Matrix to purify (needs to be almost idempotent already) TYPE(dbcsr_type) :: matrix_s Overlap-Matrix REAL(dp) :: threshold Threshold used as filter_eps and convergence criteria INTEGER :: max_steps Max number of iterations