54#if defined (__HAS_IEEE_EXCEPTIONS)
55 USE ieee_exceptions,
ONLY: ieee_get_halting_mode, &
56 ieee_set_halting_mode, &
59#include "../base/base_uses.f90"
64 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_cfm_diag'
83 TYPE(
cp_cfm_type),
INTENT(IN) :: matrix, eigenvectors
84 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
86 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_heevd'
90 CALL timeset(routinen, handle)
111 CALL cp_cfm_heevd_base(matrix, eigenvectors, eigenvalues)
117 CALL timestop(handle)
130 SUBROUTINE cp_cfm_heevd_base(matrix, eigenvectors, eigenvalues)
132 TYPE(
cp_cfm_type),
INTENT(IN) :: matrix, eigenvectors
133 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
135 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_heevd_base'
137 COMPLEX(KIND=dp),
DIMENSION(:),
POINTER :: work
138 COMPLEX(KIND=dp),
DIMENSION(:, :), &
140 INTEGER :: handle, info, liwork, &
142 INTEGER,
DIMENSION(:),
POINTER :: iwork
143 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rwork
144#if defined(__parallel)
145 INTEGER,
DIMENSION(9) :: descm, descv
146 COMPLEX(KIND=dp),
DIMENSION(:, :), &
149#if defined (__HAS_IEEE_EXCEPTIONS)
150 LOGICAL,
DIMENSION(5) :: halt
153 CALL timeset(routinen, handle)
155 n = matrix%matrix_struct%nrow_global
156 m => matrix%local_data
157 ALLOCATE (iwork(1), rwork(1), work(1))
163#if defined(__parallel)
164 v => eigenvectors%local_data
165 descm(:) = matrix%matrix_struct%descriptor(:)
166 descv(:) = eigenvectors%matrix_struct%descriptor(:)
167 CALL pzheevd(
'V',
'U', n, m(1, 1), 1, 1, descm, eigenvalues(1), v(1, 1), 1, 1, descv, &
168 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
171 lwork = ceiling(real(work(1), kind=
dp)) + 1000
173 lrwork = ceiling(rwork(1)) + 1000000
176 CALL zheevd(
'V',
'U', n, m(1, 1),
SIZE(m, 1), eigenvalues(1), &
177 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
178 lwork = ceiling(real(work(1), kind=
dp))
179 lrwork = ceiling(rwork(1))
183 DEALLOCATE (iwork, rwork, work)
184 ALLOCATE (iwork(liwork), rwork(lrwork), work(lwork))
188#if defined (__HAS_IEEE_EXCEPTIONS)
189 CALL ieee_get_halting_mode(ieee_all, halt)
190 CALL ieee_set_halting_mode(ieee_all, .false.)
192#if defined(__parallel)
193 CALL pzheevd(
'V',
'U', n, m(1, 1), 1, 1, descm, eigenvalues(1), v(1, 1), 1, 1, descv, &
194 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
196 CALL zheevd(
'V',
'U', n, m(1, 1),
SIZE(m, 1), eigenvalues(1), &
197 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
198 eigenvectors%local_data = matrix%local_data
200#if defined (__HAS_IEEE_EXCEPTIONS)
201 CALL ieee_set_halting_mode(ieee_all, halt)
204 DEALLOCATE (iwork, rwork, work)
205 IF (info /= 0) cpabort(
"Diagonalisation of a complex matrix failed")
207 CALL timestop(handle)
209 END SUBROUTINE cp_cfm_heevd_base
218 SUBROUTINE check_generalized_diag(overlap, eigenvectors, scratch, nvec)
221 TYPE(
cp_cfm_type),
INTENT(INOUT) :: overlap, scratch
222 INTEGER,
INTENT(IN) :: nvec
224 CHARACTER(LEN=*),
PARAMETER :: routinen =
'check_generalized_diag'
226 CHARACTER(LEN=default_string_length) :: diag_type_name
227 COMPLEX(KIND=dp) :: gold, test
228 INTEGER :: handle, i, j, ncol, nrow, output_unit
229 REAL(kind=
dp) :: eps, eps_abort, eps_warning
230#if defined(__parallel)
232 INTEGER :: il, jl, ipcol, iprow, &
233 mypcol, myprow, npcol, nprow
234 INTEGER,
DIMENSION(9) :: desca
237 CALL timeset(routinen, handle)
240 CALL timestop(handle)
246 eps_abort = 10.0_dp*eps_warning
248 nrow = eigenvectors%matrix_struct%nrow_global
249 ncol = min(eigenvectors%matrix_struct%ncol_global, nvec)
258#if defined(__parallel)
259 context => overlap%matrix_struct%context
260 myprow = context%mepos(1)
261 mypcol = context%mepos(2)
262 nprow = context%num_pe(1)
263 npcol = context%num_pe(2)
264 desca(:) = overlap%matrix_struct%descriptor(:)
265 outer:
DO j = 1, ncol
267 CALL infog2l(i, j, desca, nprow, npcol, myprow, mypcol, il, jl, iprow, ipcol)
268 IF ((iprow == myprow) .AND. (ipcol == mypcol))
THEN
270 test = overlap%local_data(il, jl)
271 eps = abs(test - gold)
272 IF (eps > eps_warning)
EXIT outer
277 outer:
DO j = 1, ncol
280 test = overlap%local_data(i, j)
281 eps = abs(test - gold)
282 IF (eps > eps_warning)
EXIT outer
287 IF (eps > eps_warning)
THEN
289 diag_type_name =
"HEGVX"
291 diag_type_name =
"CUSOLVER"
293 diag_type_name =
"ELPA"
296 diag_type_name =
"DLAF"
299 diag_type_name =
"generalized eigensolver"
301 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,T2,A,I0,A,I0,A,ES10.3,/,T2,A,F0.0,A,ES10.3)") &
302 "The generalized eigenvectors returned by "//trim(diag_type_name)//
" are not S-orthonormal", &
303 "Absolute deviation of matrix element (", i,
", ", j,
") is ", eps, &
304 "The deviation from the expected value ", real(gold, kind=
dp),
" is", eps
305 IF (eps > eps_abort)
THEN
306 cpabort(
"ERROR in "//routinen//
": Check of generalized matrix diagonalization failed")
308 cpwarn(
"Check of generalized matrix diagonalization failed in routine "//routinen)
312 CALL timestop(handle)
314 END SUBROUTINE check_generalized_diag
328 SUBROUTINE cp_cfm_geeig(amatrix, bmatrix, eigenvectors, eigenvalues, work, lowest_subset)
330 TYPE(
cp_cfm_type),
INTENT(IN) :: amatrix, bmatrix, eigenvectors
331 REAL(kind=
dp),
DIMENSION(:) :: eigenvalues
333 LOGICAL,
INTENT(IN),
OPTIONAL :: lowest_subset
335 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_geeig'
337 INTEGER :: handle, nao, nmo
338 LOGICAL :: check_eigenvectors, use_lowest_subset
339 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
342 CALL timeset(routinen, handle)
345 ALLOCATE (evals(nao))
346 nmo =
SIZE(eigenvalues)
348 use_lowest_subset = .false.
349 IF (
PRESENT(lowest_subset)) use_lowest_subset = lowest_subset .AND. nmo < nao
350#if !defined(__parallel)
351 use_lowest_subset = .false.
354 IF (use_lowest_subset)
THEN
355#if defined(__parallel)
356 IF (check_eigenvectors)
THEN
361 CALL cp_cfm_geeig_scalapack(amatrix, bmatrix, work, evals(1:nmo))
362 IF (check_eigenvectors)
THEN
363 CALL check_generalized_diag(overlap_check, work, scratch_check, nmo)
372 IF (check_eigenvectors)
THEN
378 IF (check_eigenvectors)
THEN
379 CALL check_generalized_diag(overlap_check, work, scratch_check, nmo)
395 IF (check_eigenvectors)
THEN
401 IF (check_eigenvectors)
THEN
402 CALL check_generalized_diag(overlap_check, work, scratch_check, nmo)
407#if defined(__parallel)
411 IF (check_eigenvectors)
THEN
416 CALL cp_cfm_geeig_scalapack(amatrix, bmatrix, work, evals)
417 IF (check_eigenvectors)
THEN
418 CALL check_generalized_diag(overlap_check, work, scratch_check, nmo)
432 CALL cp_cfm_heevd(matrix=amatrix, eigenvectors=work, eigenvalues=evals)
438 eigenvalues(1:nmo) = evals(1:nmo)
442 CALL timestop(handle)
453 SUBROUTINE cp_cfm_geeig_scalapack(amatrix, bmatrix, eigenvectors, eigenvalues)
455 TYPE(
cp_cfm_type),
INTENT(IN) :: amatrix, bmatrix, eigenvectors
456 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
458 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_geeig_scalapack'
460#if defined(__parallel)
461 REAL(kind=
dp),
PARAMETER :: orfac = -1.0_dp, &
465 COMPLEX(KIND=dp),
DIMENSION(:),
ALLOCATABLE :: work
466 COMPLEX(KIND=dp),
DIMENSION(:, :),
POINTER :: a, b, z
467 INTEGER :: handle, info, liwork, lwork, lrwork, &
468 m, n, nb, neig, npcol, nprow, nz
469 INTEGER,
DIMENSION(9) :: desca, descb, descz
470 INTEGER,
DIMENSION(:),
ALLOCATABLE :: iclustr, ifail, iwork
471 REAL(kind=
dp) :: abstol
472 REAL(kind=
dp),
DIMENSION(:),
ALLOCATABLE :: gap, rwork, w
474 INTEGER :: mq0, nn, np0, npe
475 INTEGER,
EXTERNAL :: iceil, numroc
476 REAL(kind=
dp),
EXTERNAL :: dlamch
477#if defined (__HAS_IEEE_EXCEPTIONS)
478 LOGICAL,
DIMENSION(5) :: halt
484 CALL timeset(routinen, handle)
486#if defined(__parallel)
487 n = amatrix%matrix_struct%nrow_global
488 neig = min(
SIZE(eigenvalues), n)
491 CALL timestop(handle)
495 IF (amatrix%matrix_struct%nrow_block /= amatrix%matrix_struct%ncol_block)
THEN
496 cpabort(
"ERROR in "//routinen//
": Invalid blocksize (no square blocks) found")
499 a => amatrix%local_data
500 b => bmatrix%local_data
501 z => eigenvectors%local_data
502 desca(:) = amatrix%matrix_struct%descriptor(:)
503 descb(:) = bmatrix%matrix_struct%descriptor(:)
504 descz(:) = eigenvectors%matrix_struct%descriptor(:)
506 nprow = amatrix%matrix_struct%context%num_pe(1)
507 npcol = amatrix%matrix_struct%context%num_pe(2)
509 nb = amatrix%matrix_struct%nrow_block
511 np0 = numroc(nn, nb, 0, 0, nprow)
512 mq0 = max(numroc(nn, nb, 0, 0, npcol), nb)
514 lwork = n + (np0 + mq0 + nb)*nb
515 lrwork = 4*n + max(5*nn, np0*mq0) + iceil(neig, npe)*nn + max(0, neig - 1)*n
516 liwork = 6*max(n, npe + 1, 4)
520 ALLOCATE (iclustr(2*npe))
524 ALLOCATE (iwork(liwork))
525 ALLOCATE (rwork(lrwork))
527 ALLOCATE (work(lwork))
529 abstol = 2.0_dp*dlamch(
"S")
531#if defined (__HAS_IEEE_EXCEPTIONS)
532 CALL ieee_get_halting_mode(ieee_all, halt)
533 CALL ieee_set_halting_mode(ieee_all, .false.)
535 CALL pzhegvx(1,
"V",
"I",
"U", n, a(1, 1), 1, 1, desca, b(1, 1), 1, 1, descb, &
536 vl, vu, 1, neig, abstol, m, nz, w(1), orfac, z(1, 1), 1, 1, descz, &
537 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, ifail(1), &
538 iclustr(1), gap(1), info)
539#if defined (__HAS_IEEE_EXCEPTIONS)
540 CALL ieee_set_halting_mode(ieee_all, halt)
543 IF (info /= 0 .OR. m < neig .OR. nz < neig)
THEN
544 cpabort(
"ERROR in PZHEGVX (ScaLAPACK), info="//trim(
cp_to_string(info)))
547 eigenvalues(:) = 0.0_dp
548 eigenvalues(1:neig) = w(1:neig)
550 DEALLOCATE (gap, iclustr, ifail, iwork, rwork, w, work)
554 mark_used(eigenvectors)
555 mark_used(eigenvalues)
556 cpabort(
"ERROR in "//routinen//
": PZHEGVX requested without ScaLAPACK support")
559 CALL timestop(handle)
561 END SUBROUTINE cp_cfm_geeig_scalapack
577 TYPE(
cp_cfm_type),
INTENT(IN) :: amatrix, bmatrix, eigenvectors
578 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
580 REAL(kind=
dp),
INTENT(IN) :: epseig
581 INTEGER,
INTENT(OUT),
OPTIONAL :: nmo_retained
583 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_geeig_canon'
585 COMPLEX(KIND=dp),
ALLOCATABLE,
DIMENSION(:) :: cevals
586 INTEGER :: handle, i, icol, irow, nao, nc, ncol, &
588 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
590 CALL timeset(routinen, handle)
594 nmo =
SIZE(eigenvalues)
595 ALLOCATE (evals(nao), cevals(nao))
603 IF (evals(i) < epseig)
THEN
617 DO icol = nc + 1, nao
623 evals(nc + 1:nao) = 1.0_dp
626 cevals(:) = cmplx(1.0_dp/sqrt(evals(:)), 0.0_dp, kind=
dp)
633 DO icol = nc + 1, nao
640 eigenvalues(1:nmo) = evals(1:nmo)
647 IF (
PRESENT(nmo_retained)) nmo_retained = nc
651 CALL timestop(handle)
667 TYPE(
cp_cfm_type),
INTENT(IN) :: amatrix, bmatrix, eigenvectors
668 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
670 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_geeig_local'
672 COMPLEX(KIND=dp),
ALLOCATABLE,
DIMENSION(:) :: work
673 COMPLEX(KIND=dp),
DIMENSION(:, :),
POINTER :: a, b, z
674 INTEGER :: handle, info, liwork, lrwork, lwork, &
676 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: iwork
677 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, rwork
678#if defined (__HAS_IEEE_EXCEPTIONS)
679 LOGICAL,
DIMENSION(5) :: halt
682 CALL timeset(routinen, handle)
684 cpassert(product(amatrix%matrix_struct%context%num_pe) == 1)
685 n = amatrix%matrix_struct%nrow_global
686 nmo = min(n,
SIZE(eigenvalues))
687 a => amatrix%local_data
688 b => bmatrix%local_data
689 z => eigenvectors%local_data
691 ALLOCATE (evals(n), iwork(1), rwork(1), work(1))
695 CALL zhegvd(1,
'V',
'U', n, a(1, 1),
SIZE(a, 1), b(1, 1),
SIZE(b, 1), evals(1), &
696 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
697 IF (info /= 0) cpabort(
"Local ZHEGVD workspace query failed, info="//trim(
cp_to_string(info)))
698 lwork = max(1, ceiling(real(work(1), kind=
dp)))
699 lrwork = max(1, ceiling(rwork(1)))
700 liwork = max(1, iwork(1))
701 DEALLOCATE (iwork, rwork, work)
702 ALLOCATE (iwork(liwork), rwork(lrwork), work(lwork))
704#if defined (__HAS_IEEE_EXCEPTIONS)
705 CALL ieee_get_halting_mode(ieee_all, halt)
706 CALL ieee_set_halting_mode(ieee_all, .false.)
708 CALL zhegvd(1,
'V',
'U', n, a(1, 1),
SIZE(a, 1), b(1, 1),
SIZE(b, 1), evals(1), &
709 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
710#if defined (__HAS_IEEE_EXCEPTIONS)
711 CALL ieee_set_halting_mode(ieee_all, halt)
713 IF (info /= 0) cpabort(
"Local ZHEGVD failed, info="//trim(
cp_to_string(info)))
715 eigenvalues(1:nmo) = evals(1:nmo)
716 z(1:n, 1:nmo) = a(1:n, 1:nmo)
718 DEALLOCATE (evals, iwork, rwork, work)
719 CALL timestop(handle)
734 TYPE(
cp_cfm_type),
INTENT(IN) :: amatrix, bmatrix, eigenvectors
735 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
737 REAL(kind=
dp),
INTENT(IN) :: epseig
739 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_geeig_canon_local'
741 COMPLEX(KIND=dp),
DIMENSION(:, :),
POINTER :: a, b, u, z
742 INTEGER :: handle, i, info, n, nc, nmo, nx
743 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
745 CALL timeset(routinen, handle)
747 cpassert(product(amatrix%matrix_struct%context%num_pe) == 1)
748 n = amatrix%matrix_struct%nrow_global
749 nmo = min(n,
SIZE(eigenvalues))
750 a => amatrix%local_data
751 b => bmatrix%local_data
753 z => eigenvectors%local_data
756 b(1:n, 1:n) = -b(1:n, 1:n)
757 CALL cp_cfm_heevd_local(b, u, evals, info)
758 IF (info /= 0) cpabort(
"Local overlap ZHEEVD failed, info="//trim(
cp_to_string(info)))
762 IF (evals(i) < epseig)
THEN
770 IF (nc < nmo) z(1:n, nc + 1:nmo) = u(1:n, nc + 1:nmo)
772 evals(nc + 1:n) = 1.0_dp
775 u(1:n, i) = u(1:n, i)/sqrt(evals(i))
778 CALL zgemm(
'C',
'N', n, n, n,
z_one, u(1, 1),
SIZE(u, 1), a(1, 1),
SIZE(a, 1), &
779 z_zero, b(1, 1),
SIZE(b, 1))
780 CALL zgemm(
'N',
'N', n, n, n,
z_one, b(1, 1),
SIZE(b, 1), u(1, 1),
SIZE(u, 1), &
781 z_zero, a(1, 1),
SIZE(a, 1))
784 a(i, i) = cmplx(10000.0_dp, 0.0_dp, kind=
dp)
788 CALL cp_cfm_heevd_local(a, b, evals, info)
789 IF (info /= 0) cpabort(
"Local Hamiltonian ZHEEVD failed, info="//trim(
cp_to_string(info)))
790 eigenvalues(1:nmo) = evals(1:nmo)
792 CALL zgemm(
'N',
'N', n, nx, nc,
z_one, u(1, 1),
SIZE(u, 1), b(1, 1),
SIZE(b, 1), &
793 z_zero, z(1, 1),
SIZE(z, 1))
796 CALL timestop(handle)
807 SUBROUTINE cp_cfm_heevd_local(matrix, vectors, eigenvalues, info)
809 COMPLEX(KIND=dp),
DIMENSION(:, :),
INTENT(INOUT) :: matrix, vectors
810 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
811 INTEGER,
INTENT(OUT) :: info
813 COMPLEX(KIND=dp),
ALLOCATABLE,
DIMENSION(:) :: work
814 INTEGER :: liwork, lrwork, lwork, n
815 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: iwork
816 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: rwork
817#if defined (__HAS_IEEE_EXCEPTIONS)
818 LOGICAL,
DIMENSION(5) :: halt
821 n =
SIZE(eigenvalues)
822 ALLOCATE (iwork(1), rwork(1), work(1))
826 CALL zheevd(
'V',
'U', n, matrix(1, 1),
SIZE(matrix, 1), eigenvalues(1), &
827 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
828 IF (info /= 0) cpabort(
"Local ZHEEVD workspace query failed, info="//trim(
cp_to_string(info)))
829 lwork = max(1, ceiling(real(work(1), kind=
dp)))
830 lrwork = max(1, ceiling(rwork(1)))
831 liwork = max(1, iwork(1))
832 DEALLOCATE (iwork, rwork, work)
833 ALLOCATE (iwork(liwork), rwork(lrwork), work(lwork))
834#if defined (__HAS_IEEE_EXCEPTIONS)
835 CALL ieee_get_halting_mode(ieee_all, halt)
836 CALL ieee_set_halting_mode(ieee_all, .false.)
838 CALL zheevd(
'V',
'U', n, matrix(1, 1),
SIZE(matrix, 1), eigenvalues(1), &
839 work(1), lwork, rwork(1), lrwork, iwork(1), liwork, info)
840#if defined (__HAS_IEEE_EXCEPTIONS)
841 CALL ieee_set_halting_mode(ieee_all, halt)
843 vectors(1:n, 1:n) = matrix(1:n, 1:n)
844 DEALLOCATE (iwork, rwork, work)
846 END SUBROUTINE cp_cfm_heevd_local
methods related to the blacs parallel environment
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_gemm(transa, transb, m, n, k, alpha, matrix_a, matrix_b, beta, matrix_c, a_first_col, a_first_row, b_first_col, b_first_row, c_first_col, c_first_row)
Performs one of the matrix-matrix operations: matrix_c = alpha * op1( matrix_a ) * op2( matrix_b ) + ...
subroutine, public cp_cfm_triangular_multiply(triangular_matrix, matrix_b, side, transa_tr, invert_tr, uplo_tr, unit_diag_tr, n_rows, n_cols, alpha)
Multiplies in place by a triangular matrix: matrix_b = alpha op(triangular_matrix) matrix_b or (if si...
subroutine, public cp_cfm_column_scale(matrix_a, scaling)
Scales columns of the full matrix by corresponding factors.
subroutine, public cp_cfm_triangular_invert(matrix_a, uplo, info_out)
Inverts a triangular matrix.
various cholesky decomposition related routines
subroutine, public cp_cfm_cholesky_decompose(matrix, n, info_out)
Used to replace a symmetric positive definite matrix M with its Cholesky decomposition U: M = U^T * U...
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_geeig_canon(amatrix, bmatrix, eigenvectors, eigenvalues, work, epseig, nmo_retained)
General Eigenvalue Problem AX = BXE Use canonical orthogonalization.
subroutine, public cp_cfm_geeig_canon_local(amatrix, bmatrix, eigenvectors, eigenvalues, work, epseig)
Canonical generalized complex diagonalization on a one-rank BLACS grid.
subroutine, public cp_cfm_heevd(matrix, eigenvectors, eigenvalues)
Perform a diagonalisation of a complex matrix.
subroutine, public cp_cfm_geeig_local(amatrix, bmatrix, eigenvectors, eigenvalues)
Solve a generalized complex eigenproblem using the local LAPACK backend. This routine is restricted t...
subroutine, public cp_cfm_geeig(amatrix, bmatrix, eigenvectors, eigenvalues, work, lowest_subset)
General Eigenvalue Problem AX = BXE Single option version: Cholesky decomposition of B.
subroutine, public cp_cfm_diag_dlaf(matrix, eigenvectors, eigenvalues)
DLA-Future eigensolver for complex Hermitian matrices.
subroutine, public cp_cfm_diag_gen_dlaf(amatrix, bmatrix, eigenvectors, eigenvalues)
DLA-Future generalized eigensolver for complex Hermitian matrices.
Wrapper for ELPA (complex matrices, i.e. cp_cfm_type).
subroutine, public cp_cfm_diag_elpa(matrix, eigenvectors, eigenvalues)
Driver routine to diagonalize a CFM matrix with the ELPA library.
logical function, public is_elpa_c_broken()
Returns .TRUE. if the runtime check detected broken BLOCK2 kernels.
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_cfm_set_element(matrix, irow_global, icol_global, alpha)
Set the matrix element (irow_global,icol_global) of the full matrix to alpha.
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, matrix_struct, para_env)
Returns information about a full matrix.
subroutine, public cp_dlaf_create_grid(blacs_context)
Create DLA-Future grid from BLACS context.
subroutine, public cp_dlaf_initialize()
Initialize DLA-Future and pika runtime.
subroutine, public cp_cfm_general_cusolver(amatrix, bmatrix, eigenvectors, eigenvalues)
Driver routine to solve generalized complex eigenvalue problem A*x = lambda*B*x with cuSOLVERMp.
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
integer, parameter, public fm_diag_type_cusolver
real(kind=dp), parameter, public set_removed_eigval_to
integer, parameter, public fm_diag_type_dlaf
integer, parameter, public fm_diag_type_scalapack
logical, save, public direct_generalized_diagonalization
integer, save, public elpa_neigvec_min
real(kind=dp) function, public diag_check_warning_threshold()
Return the warning threshold for diagonalization checks.
integer, save, public diag_type
integer, save, public dlaf_neigvec_min
integer, parameter, public fm_diag_type_elpa
integer, parameter, public cusolver_n_min
logical function, public diag_check_requested()
Return whether diagonalization checks should be performed.
logical, save, public diag_lib_explicit
various routines to log and control the output. The idea is that decisions about where to log should ...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Machine interface based on Fortran 2003 and POSIX.
integer, parameter, public default_output_unit
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_one
complex(kind=dp), parameter, public z_zero
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Represent a complex full matrix.