![]() |
(git:298f7c4)
|
Routines useful for iterative matrix calculations. More...
Data Types | |
| interface | purify_mcweeny |
Functions/Subroutines | |
| recursive subroutine, public | determinant (matrix, det, threshold) |
| Computes the determinant of a symmetric positive definite matrix using the trace of the matrix logarithm via Mercator series: det(A) = det(S)det(I+X)det(S), where S=diag(sqrt(Aii),..,sqrt(Ann)) det(I+X) = Exp(Trace(Ln(I+X))) Ln(I+X) = X - X^2/2 + X^3/3 - X^4/4 + .. The series converges only if the Frobenius norm of X is less than 1. If it is more than one we compute (recursevily) the determinant of the square root of (I+X). | |
| subroutine, public | invert_taylor (matrix_inverse, matrix, threshold, use_inv_as_guess, norm_convergence, filter_eps, accelerator_order, max_iter_lanczos, eps_lanczos, silent) |
| invert a symmetric positive definite diagonally dominant matrix | |
| subroutine, public | invert_hotelling (matrix_inverse, matrix, threshold, use_inv_as_guess, norm_convergence, filter_eps, accelerator_order, max_iter_lanczos, eps_lanczos, 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 | |
| subroutine, public | matrix_sign_newton_schulz (matrix_sign, matrix, threshold, sign_order, iounit) |
| compute the sign a matrix using Newton-Schulz iterations | |
| subroutine, public | matrix_sign_proot (matrix_sign, matrix, threshold, sign_order) |
| compute the sign a matrix using the general algorithm for the p-th root of Richters et al. Commun. Comput. Phys., 25 (2019), pp. 564-585. | |
| subroutine, public | matrix_sign_submatrix (matrix_sign, matrix, threshold, sign_order, submatrix_sign_method) |
| Submatrix method. | |
| subroutine, public | matrix_sign_submatrix_mu_adjust (matrix_sign, matrix, mu, nelectron, threshold, variant) |
| Submatrix method with internal adjustment of chemical potential. | |
| subroutine, public | matrix_sqrt_newton_schulz (matrix_sqrt, matrix_sqrt_inv, matrix, threshold, order, eps_lanczos, max_iter_lanczos, symmetrize, converged, iounit) |
| 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 | |
| subroutine, public | matrix_sqrt_proot (matrix_sqrt, matrix_sqrt_inv, matrix, threshold, order, eps_lanczos, max_iter_lanczos, symmetrize, converged) |
| compute the sqrt of a matrix via the general algorithm for the p-th root of Richters et al. Commun. Comput. Phys., 25 (2019), pp. 564-585. | |
| subroutine, public | matrix_exponential (matrix_exp, matrix, omega, alpha, threshold) |
| ... | |
Routines useful for iterative matrix calculations.
| recursive subroutine, public iterate_matrix::determinant | ( | type(dbcsr_type), intent(inout) | matrix, |
| real(kind=dp), intent(inout) | det, | ||
| real(kind=dp), intent(in) | threshold | ||
| ) |
Computes the determinant of a symmetric positive definite matrix using the trace of the matrix logarithm via Mercator series: det(A) = det(S)det(I+X)det(S), where S=diag(sqrt(Aii),..,sqrt(Ann)) det(I+X) = Exp(Trace(Ln(I+X))) Ln(I+X) = X - X^2/2 + X^3/3 - X^4/4 + .. The series converges only if the Frobenius norm of X is less than 1. If it is more than one we compute (recursevily) the determinant of the square root of (I+X).
| matrix | ... |
| det | - determinant |
| threshold | ... |
Definition at line 84 of file iterate_matrix.F.
| subroutine, public iterate_matrix::invert_taylor | ( | type(dbcsr_type), intent(inout), target | matrix_inverse, |
| type(dbcsr_type), intent(inout), target | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| logical, intent(in), optional | use_inv_as_guess, | ||
| real(kind=dp), intent(in), optional | norm_convergence, | ||
| real(kind=dp), intent(in), optional | filter_eps, | ||
| integer, intent(in), optional | accelerator_order, | ||
| integer, intent(in), optional | max_iter_lanczos, | ||
| real(kind=dp), intent(in), optional | eps_lanczos, | ||
| logical, intent(in), optional | silent | ||
| ) |
invert a symmetric positive definite diagonally dominant matrix
| matrix_inverse | ... |
| matrix | ... |
| threshold | convergence threshold nased on the max abs |
| use_inv_as_guess | logical whether input can be used as guess for inverse |
| norm_convergence | convergence threshold for the 2-norm, useful for approximate solutions |
| filter_eps | filter_eps for matrix multiplications, if not passed nothing is filteres |
| accelerator_order | ... |
| max_iter_lanczos | ... |
| eps_lanczos | ... |
| silent | ... |
Definition at line 284 of file iterate_matrix.F.
| subroutine, public iterate_matrix::invert_hotelling | ( | type(dbcsr_type), intent(inout), target | matrix_inverse, |
| type(dbcsr_type), intent(inout), target | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| logical, intent(in), optional | use_inv_as_guess, | ||
| real(kind=dp), intent(in), optional | norm_convergence, | ||
| real(kind=dp), intent(in), optional | filter_eps, | ||
| integer, intent(in), optional | accelerator_order, | ||
| integer, intent(in), optional | max_iter_lanczos, | ||
| real(kind=dp), intent(in), optional | eps_lanczos, | ||
| logical, intent(in), optional | 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
| matrix_inverse | ... |
| matrix | ... |
| threshold | convergence threshold nased on the max abs |
| use_inv_as_guess | logical whether input can be used as guess for inverse |
| norm_convergence | convergence threshold for the 2-norm, useful for approximate solutions |
| filter_eps | filter_eps for matrix multiplications, if not passed nothing is filteres |
| accelerator_order | ... |
| max_iter_lanczos | ... |
| eps_lanczos | ... |
| silent | ... |
Definition at line 470 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sign_newton_schulz | ( | type(dbcsr_type), intent(inout) | matrix_sign, |
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in), optional | sign_order, | ||
| integer, intent(in), optional | iounit | ||
| ) |
compute the sign a matrix using Newton-Schulz iterations
| matrix_sign | ... |
| matrix | ... |
| threshold | ... |
| sign_order | ... |
| iounit | ... |
Definition at line 681 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sign_proot | ( | type(dbcsr_type), intent(inout) | matrix_sign, |
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in), optional | sign_order | ||
| ) |
compute the sign a matrix using the general algorithm for the p-th root of Richters et al. Commun. Comput. Phys., 25 (2019), pp. 564-585.
| matrix_sign | ... |
| matrix | ... |
| threshold | ... |
| sign_order | ... |
Definition at line 1013 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sign_submatrix | ( | type(dbcsr_type), intent(inout) | matrix_sign, |
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in), optional | sign_order, | ||
| integer, intent(in) | submatrix_sign_method | ||
| ) |
Submatrix method.
| matrix_sign | ... |
| matrix | ... |
| threshold | ... |
| sign_order | ... |
| submatrix_sign_method | ... |
Definition at line 1364 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sign_submatrix_mu_adjust | ( | type(dbcsr_type), intent(inout) | matrix_sign, |
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(inout) | mu, | ||
| integer, intent(in) | nelectron, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in) | variant | ||
| ) |
Submatrix method with internal adjustment of chemical potential.
| matrix_sign | ... |
| matrix | ... |
| mu | ... |
| nelectron | ... |
| threshold | ... |
| variant | ... |
Definition at line 1441 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sqrt_newton_schulz | ( | type(dbcsr_type), intent(inout) | matrix_sqrt, |
| type(dbcsr_type), intent(inout) | matrix_sqrt_inv, | ||
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in) | order, | ||
| real(kind=dp), intent(in) | eps_lanczos, | ||
| integer, intent(in) | max_iter_lanczos, | ||
| logical, optional | symmetrize, | ||
| logical, optional | converged, | ||
| integer, intent(in), optional | iounit | ||
| ) |
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
| matrix_sqrt | ... |
| matrix_sqrt_inv | ... |
| matrix | ... |
| threshold | ... |
| order | ... |
| eps_lanczos | ... |
| max_iter_lanczos | ... |
| symmetrize | ... |
| converged | ... |
| iounit | ... |
Definition at line 1624 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_sqrt_proot | ( | type(dbcsr_type), intent(inout) | matrix_sqrt, |
| type(dbcsr_type), intent(inout) | matrix_sqrt_inv, | ||
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | threshold, | ||
| integer, intent(in) | order, | ||
| real(kind=dp), intent(in) | eps_lanczos, | ||
| integer, intent(in) | max_iter_lanczos, | ||
| logical, optional | symmetrize, | ||
| logical, optional | converged | ||
| ) |
compute the sqrt of a matrix via the general algorithm for the p-th root of Richters et al. Commun. Comput. Phys., 25 (2019), pp. 564-585.
| matrix_sqrt | ... |
| matrix_sqrt_inv | ... |
| matrix | ... |
| threshold | ... |
| order | ... |
| eps_lanczos | ... |
| max_iter_lanczos | ... |
| symmetrize | ... |
| converged | ... |
Definition at line 1876 of file iterate_matrix.F.
| subroutine, public iterate_matrix::matrix_exponential | ( | type(dbcsr_type), intent(inout) | matrix_exp, |
| type(dbcsr_type), intent(inout) | matrix, | ||
| real(kind=dp), intent(in) | omega, | ||
| real(kind=dp), intent(in) | alpha, | ||
| real(kind=dp), intent(in) | threshold | ||
| ) |
...
| matrix_exp | ... |
| matrix | ... |
| omega | ... |
| alpha | ... |
| threshold | ... |
Definition at line 2107 of file iterate_matrix.F.