54#include "./base/base_uses.f90"
60 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_scf_methods'
61 REAL(KIND=
dp),
PARAMETER :: ratio = 0.25_dp
73 MODULE PROCEDURE combine_ks_matrices_1, &
95 iter_delta, iter_count, diis, invert)
96 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: p_mix_new
100 REAL(kind=
dp),
INTENT(INOUT) :: iter_delta
101 INTEGER,
INTENT(IN) :: iter_count
102 LOGICAL,
INTENT(in),
OPTIONAL :: diis, invert
104 CHARACTER(len=*),
PARAMETER :: routinen =
'scf_env_density_mixing'
106 INTEGER :: handle, ic, ispin
107 LOGICAL :: my_diis, my_invert
108 REAL(kind=
dp) :: my_p_mix, tmp
110 CALL timeset(routinen, handle)
113 IF (
PRESENT(diis)) my_diis = diis
115 IF (
PRESENT(invert)) my_invert = invert
116 my_p_mix = mixing_store%alpha
117 IF (my_diis .OR. iter_count < mixing_store%nskip_mixing)
THEN
122 cpassert(
ASSOCIATED(p_mix_new))
123 DO ic = 1,
SIZE(p_mix_new, 2)
124 DO ispin = 1,
SIZE(p_mix_new, 1)
126 cpassert(my_p_mix /= 0.0_dp)
127 IF (my_p_mix /= 1.0_dp)
THEN
128 CALL dbcsr_add(matrix_a=p_mix_new(ispin, ic)%matrix, &
129 alpha_scalar=1.0_dp/my_p_mix, &
130 matrix_b=rho_ao(ispin, ic)%matrix, &
131 beta_scalar=(my_p_mix - 1.0_dp)/my_p_mix)
134 CALL cp_sm_mix(m1=p_mix_new(ispin, ic)%matrix, &
135 m2=rho_ao(ispin, ic)%matrix, &
139 iter_delta = max(iter_delta, tmp)
144 CALL timestop(handle)
165 cholesky_method, do_level_shift, &
166 level_shift, matrix_u_fm, use_jacobi)
170 INTEGER,
INTENT(inout) :: cholesky_method
171 LOGICAL,
INTENT(in) :: do_level_shift
172 REAL(kind=
dp),
INTENT(in) :: level_shift
173 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
174 LOGICAL,
INTENT(in) :: use_jacobi
176 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver'
178 INTEGER :: handle, homo, nao, nmo
179 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
182 CALL timeset(routinen, handle)
185 NULLIFY (mo_eigenvalues)
193 eigenvalues=mo_eigenvalues, &
196 SELECT CASE (cholesky_method)
200 IF (do_level_shift) &
201 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
202 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
206 IF (do_level_shift) &
207 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
212 "SOLVE", pos=
"RIGHT")
214 "SOLVE", pos=
"LEFT", transa=
"T")
216 IF (do_level_shift) &
217 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
218 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
223 IF (do_level_shift) &
224 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
230 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nao, alpha=1.0_dp)
232 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nao, alpha=1.0_dp)
234 IF (do_level_shift) &
235 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
236 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
240 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nmo, alpha=1.0_dp)
243 IF (do_level_shift) &
244 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
253 CALL timestop(handle)
265 TYPE(
cp_fm_type),
INTENT(INOUT) :: matrix_ks_fm
270 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_generalized'
272 INTEGER :: handle, nmo
273 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
278 CALL timeset(routinen, handle)
281 NULLIFY (mo_eigenvalues)
283 CALL get_mo_set(mo_set=mo_set, nmo=nmo, eigenvalues=mo_eigenvalues, mo_coeff=mo_coeff)
298 CALL timestop(handle)
313 TYPE(
cp_fm_type),
INTENT(INOUT) :: matrix_ks_fm
316 TYPE(
dbcsr_type),
INTENT(INOUT) :: ksbuf1, ksbuf2
318 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_dbcsr'
320 INTEGER :: handle, nao, nmo
321 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
325 CALL timeset(routinen, handle)
328 NULLIFY (mo_eigenvalues)
333 eigenvalues=mo_eigenvalues, &
338 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, ksbuf2, ortho_dbcsr, 0.0_dp, ksbuf1)
339 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, ortho_dbcsr, ksbuf1, 0.0_dp, ksbuf2)
343 CALL cp_fm_create(all_evecs, matrix_ks_fm%matrix_struct)
348 CALL cp_fm_to_fm(msource=all_evecs, mtarget=nmo_evecs, ncol=nmo)
355 CALL timestop(handle)
376 level_shift, matrix_u_fm, use_jacobi, jacobi_threshold, &
377 ortho_red, work_red, matrix_ks_fm_red, matrix_u_fm_red)
381 LOGICAL,
INTENT(IN) :: do_level_shift
382 REAL(kind=
dp),
INTENT(IN) :: level_shift
383 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
384 LOGICAL,
INTENT(IN) :: use_jacobi
385 REAL(kind=
dp),
INTENT(IN) :: jacobi_threshold
386 TYPE(
cp_fm_type),
INTENT(INOUT),
OPTIONAL :: ortho_red, work_red, matrix_ks_fm_red, &
389 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_symm'
391 INTEGER :: handle, homo, nao, nao_red, nelectron, &
393 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues
394 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
398 CALL timeset(routinen, handle)
401 NULLIFY (mo_eigenvalues)
409 nelectron=nelectron, &
410 eigenvalues=mo_eigenvalues, &
415 CALL cp_fm_symm(
"L",
"U", nao, homo, 1.0_dp, matrix_ks_fm, mo_coeff, 0.0_dp, work)
416 CALL parallel_gemm(
"T",
"N", homo, nao - homo, nao, 1.0_dp, work, mo_coeff, &
417 0.0_dp, matrix_ks_fm, b_first_col=homo + 1, c_first_col=homo + 1)
421 jacobi_threshold, homo + 1)
424 IF (
PRESENT(work_red) .AND.
PRESENT(ortho_red) .AND.
PRESENT(matrix_ks_fm_red))
THEN
426 CALL cp_fm_symm(
"L",
"U", nao, nao_red, 1.0_dp, matrix_ks_fm, ortho_red, 0.0_dp, work_red)
427 CALL parallel_gemm(
"T",
"N", nao_red, nao_red, nao, 1.0_dp, ortho_red, work_red, 0.0_dp, matrix_ks_fm_red)
429 IF (do_level_shift) &
430 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm_red, mo_coeff=mo_coeff, homo=homo, &
431 level_shift=level_shift, is_triangular=.false., matrix_u_fm=matrix_u_fm_red)
433 CALL cp_fm_create(work_red2, matrix_ks_fm_red%matrix_struct)
434 ALLOCATE (eigenvalues(nao_red))
436 mo_eigenvalues(1:min(nao_red, nmo)) = eigenvalues(1:min(nao_red, nmo))
437 CALL parallel_gemm(
"N",
"N", nao, nmo, nao_red, 1.0_dp, ortho_red, work_red2, 0.0_dp, &
441 CALL cp_fm_symm(
"L",
"U", nao, nao, 1.0_dp, matrix_ks_fm, ortho, 0.0_dp, work)
442 CALL parallel_gemm(
"T",
"N", nao, nao, nao, 1.0_dp, ortho, work, 0.0_dp, matrix_ks_fm)
443 IF (do_level_shift) &
444 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
445 level_shift=level_shift, is_triangular=.false., matrix_u_fm=matrix_u_fm)
447 CALL parallel_gemm(
"N",
"N", nao, nmo, nao, 1.0_dp, ortho, work, 0.0_dp, &
451 IF (do_level_shift) &
452 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
456 CALL timestop(handle)
473 level_shift, use_jacobi, jacobi_threshold)
478 LOGICAL,
INTENT(IN) :: do_level_shift
479 REAL(kind=
dp),
INTENT(IN) :: level_shift
480 LOGICAL,
INTENT(IN) :: use_jacobi
481 REAL(kind=
dp),
INTENT(IN) :: jacobi_threshold
483 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_simple'
485 INTEGER :: handle, homo, nao, nelectron, nmo
486 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
489 CALL timeset(routinen, handle)
492 NULLIFY (mo_eigenvalues)
498 nelectron=nelectron, &
499 eigenvalues=mo_eigenvalues, &
502 IF (do_level_shift)
THEN
504 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks, mo_coeff=mo_coeff, homo=homo, &
505 level_shift=level_shift, is_triangular=.false.)
509 CALL cp_fm_symm(
"L",
"U", nao, homo, 1.0_dp, matrix_ks, mo_coeff, 0.0_dp, work)
510 CALL parallel_gemm(
"T",
"N", homo, nao - homo, nao, 1.0_dp, work, mo_coeff, &
511 0.0_dp, matrix_ks, b_first_col=homo + 1, c_first_col=homo + 1)
513 CALL cp_fm_block_jacobi(matrix_ks, mo_coeff, mo_eigenvalues, jacobi_threshold, homo + 1)
522 IF (do_level_shift) &
523 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
525 CALL timestop(handle)
546 SUBROUTINE cp_sm_mix(m1, m2, p_mix, delta, para_env, m3)
549 REAL(kind=
dp),
INTENT(IN) :: p_mix
550 REAL(kind=
dp),
INTENT(OUT) :: delta
554 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_sm_mix'
556 INTEGER :: handle, i, iblock_col, iblock_row, j
558 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: p_delta_block, p_new_block, p_old_block
561 CALL timeset(routinen, handle)
568 block=p_old_block, found=found)
569 cpassert(
ASSOCIATED(p_old_block))
570 IF (
PRESENT(m3))
THEN
572 block=p_delta_block, found=found)
573 cpassert(
ASSOCIATED(p_delta_block))
575 DO j = 1,
SIZE(p_new_block, 2)
576 DO i = 1,
SIZE(p_new_block, 1)
577 p_delta_block(i, j) = p_new_block(i, j) - p_old_block(i, j)
578 delta = max(delta, abs(p_delta_block(i, j)))
582 DO j = 1,
SIZE(p_new_block, 2)
583 DO i = 1,
SIZE(p_new_block, 1)
584 p_new_block(i, j) = p_new_block(i, j) - p_old_block(i, j)
585 delta = max(delta, abs(p_new_block(i, j)))
586 p_new_block(i, j) = p_old_block(i, j) + p_mix*p_new_block(i, j)
593 CALL para_env%max(delta)
595 CALL timestop(handle)
607 SUBROUTINE combine_ks_matrices_1(ksa, ksb, occa, occb, roks_parameter)
619 REAL(KIND=
dp),
DIMENSION(:),
INTENT(IN) :: occa, occb
620 REAL(KIND=
dp),
DIMENSION(0:2, 0:2, 1:2), &
621 INTENT(IN) :: roks_parameter
623 CHARACTER(LEN=*),
PARAMETER :: routineN =
'combine_ks_matrices_1'
625 INTEGER :: handle, i, icol_global, icol_local, &
626 irow_global, irow_local, j, &
627 ncol_local, nrow_local
628 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
629 LOGICAL :: compatible_matrices
630 REAL(KIND=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
636 CALL timeset(routinen, handle)
639 matrix_struct=ksa_struct, &
640 nrow_local=nrow_local, &
641 ncol_local=ncol_local, &
642 row_indices=row_indices, &
643 col_indices=col_indices, &
647 matrix_struct=ksb_struct, &
651 cpassert(compatible_matrices)
653 IF (sum(occb) == 0.0_dp) fb = 0.0_dp
655 DO icol_local = 1, ncol_local
656 icol_global = col_indices(icol_local)
657 j = int(occa(icol_global)) + int(occb(icol_global))
658 DO irow_local = 1, nrow_local
659 irow_global = row_indices(irow_local)
660 i = int(occa(irow_global)) + int(occb(irow_global))
661 fa(irow_local, icol_local) = &
662 roks_parameter(i, j, 1)*fa(irow_local, icol_local) + &
663 roks_parameter(i, j, 2)*fb(irow_local, icol_local)
667 CALL timestop(handle)
669 END SUBROUTINE combine_ks_matrices_1
681 SUBROUTINE combine_ks_matrices_2(ksa, ksb, occa, occb, f, nalpha, nbeta)
693 REAL(KIND=
dp),
DIMENSION(:),
INTENT(IN) :: occa, occb
694 REAL(KIND=
dp),
INTENT(IN) :: f
695 INTEGER,
INTENT(IN) :: nalpha, nbeta
697 CHARACTER(LEN=*),
PARAMETER :: routineN =
'combine_ks_matrices_2'
699 INTEGER :: handle, icol_global, icol_local, &
700 irow_global, irow_local, ncol_local, &
702 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
703 LOGICAL :: compatible_matrices
704 REAL(KIND=
dp) :: beta, t1, t2, ta, tb
705 REAL(KIND=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
711 CALL timeset(routinen, handle)
714 matrix_struct=ksa_struct, &
715 nrow_local=nrow_local, &
716 ncol_local=ncol_local, &
717 row_indices=row_indices, &
718 col_indices=col_indices, &
722 matrix_struct=ksb_struct, &
726 cpassert(compatible_matrices)
728 beta = 1.0_dp/(1.0_dp - f)
730 DO icol_local = 1, ncol_local
732 icol_global = col_indices(icol_local)
734 DO irow_local = 1, nrow_local
736 irow_global = row_indices(irow_local)
738 t1 = 0.5_dp*(fa(irow_local, icol_local) + fb(irow_local, icol_local))
740 IF ((0 < irow_global) .AND. (irow_global <= nbeta))
THEN
741 IF ((0 < icol_global) .AND. (icol_global <= nbeta))
THEN
743 fa(irow_local, icol_local) = t1
744 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
746 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
747 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
748 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
749 fa(irow_local, icol_local) = t1 + (beta - 1.0_dp)*t2
752 fa(irow_local, icol_local) = t1
754 ELSE IF ((nbeta < irow_global) .AND. (irow_global <= nalpha))
THEN
755 IF ((0 < irow_global) .AND. (irow_global <= nbeta))
THEN
757 ta = 0.5_dp*(f - real(occa(irow_global), kind=
dp))/f
758 tb = 0.5_dp*(f - real(occb(irow_global), kind=
dp))/f
759 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
760 fa(irow_local, icol_local) = t1 + (beta - 1.0_dp)*t2
761 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
763 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
764 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
765 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
766 IF (irow_global == icol_global)
THEN
767 fa(irow_local, icol_local) = t1 - t2
769 fa(irow_local, icol_local) = t1 - 0.5_dp*t2
773 ta = 0.5_dp*(f - real(occa(irow_global), kind=
dp))/f
774 tb = 0.5_dp*(f - real(occb(irow_global), kind=
dp))/f
775 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
776 fa(irow_local, icol_local) = t1 - t2
779 IF ((0 < irow_global) .AND. (irow_global < nbeta))
THEN
781 fa(irow_local, icol_local) = t1
782 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
784 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
785 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
786 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
787 fa(irow_local, icol_local) = t1 - t2
790 fa(irow_local, icol_local) = t1
797 CALL timestop(handle)
799 END SUBROUTINE combine_ks_matrices_2
814 PURE SUBROUTINE correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
816 REAL(kind=
dp),
DIMENSION(:),
INTENT(inout) :: mo_eigenvalues
817 INTEGER,
INTENT(in) :: homo, nmo
818 REAL(kind=
dp),
INTENT(in) :: level_shift
822 DO imo = homo + 1, nmo
823 mo_eigenvalues(imo) = mo_eigenvalues(imo) - level_shift
826 END SUBROUTINE correct_mo_eigenvalues
841 SUBROUTINE shift_unocc_mos(matrix_ks_fm, mo_coeff, homo, &
842 level_shift, is_triangular, matrix_u_fm)
844 TYPE(
cp_fm_type),
INTENT(IN) :: matrix_ks_fm, mo_coeff
845 INTEGER,
INTENT(in) :: homo
846 REAL(kind=
dp),
INTENT(in) :: level_shift
847 LOGICAL,
INTENT(in) :: is_triangular
848 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
850 CHARACTER(len=*),
PARAMETER :: routineN =
'shift_unocc_mos'
852 INTEGER :: handle, nao, nao_red, nmo
853 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: weights
857 CALL timeset(routinen, handle)
859 IF (
PRESENT(matrix_u_fm))
THEN
861 CALL cp_fm_get_info(matrix_u_fm, nrow_global=nao_red, ncol_global=nao)
867 NULLIFY (ao_mo_fmstruct)
869 para_env=mo_coeff%matrix_struct%para_env, context=mo_coeff%matrix_struct%context)
877 IF (
PRESENT(matrix_u_fm))
THEN
878 IF (is_triangular)
THEN
881 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nmo, alpha=1.0_dp)
883 CALL parallel_gemm(
"N",
"N", nao_red, nmo, nao, 1.0_dp, matrix_u_fm, mo_coeff, 0.0_dp, u_mo)
895 ALLOCATE (weights(nmo))
896 weights(1:homo) = 0.0_dp
897 weights(homo + 1:nmo) = level_shift
904 CALL parallel_gemm(
"N",
"T", nao_red, nao_red, nmo, 1.0_dp, u_mo, u_mo_scaled, 1.0_dp, matrix_ks_fm)
909 CALL timestop(handle)
911 END SUBROUTINE shift_unocc_mos
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
subroutine, public dbcsr_multiply(transa, transb, alpha, matrix_a, matrix_b, beta, matrix_c, first_row, last_row, first_column, last_column, first_k, last_k, retain_sparsity, filter_eps, flop)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
subroutine, public cp_fm_uplo_to_full(matrix, work, uplo)
given a triangular matrix according to uplo, computes the corresponding full matrix
subroutine, public cp_fm_symm(side, uplo, m, n, alpha, matrix_a, matrix_b, beta, matrix_c)
computes matrix_c = beta * matrix_c + alpha * matrix_a * matrix_b computes matrix_c = beta * matrix_c...
subroutine, public cp_fm_triangular_multiply(triangular_matrix, matrix_b, side, transpose_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...
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_restore(fm_matrix, neig, fm_matrixb, fm_matrixout, op, pos, transa)
apply Cholesky decomposition op can be "SOLVE" (out = U^-1 * in) or "MULTIPLY" (out = U * in) pos can...
subroutine, public cp_fm_cholesky_reduce(matrix, matrixb, itype)
reduce a matrix pencil A,B to normal form B has to be cholesky decomposed with cp_fm_cholesky_decompo...
subroutine, public cp_fm_general_cusolver(amatrix, bmatrix, eigenvectors, eigenvalues)
Driver routine to solve generalized 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...
subroutine, public cp_fm_block_jacobi(matrix, eigenvectors, eigval, thresh, start_sec_block)
...
subroutine, public choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
Choose the Eigensolver depending on which library is available ELPA seems to be unstable for small sy...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
logical function, public cp_fm_struct_equivalent(fmstruct1, fmstruct2)
returns true if the two matrix structures are equivalent, false otherwise.
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp, nrow, ncol, set_zero)
creates a new full matrix with the given structure
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
module that contains the definitions of the scf types
Definition and initialisation of the mo data type.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
groups fairly general SCF methods, so that modules other than qs_scf can use them too split off from ...
subroutine, public eigensolver_simple(matrix_ks, mo_set, work, do_level_shift, level_shift, use_jacobi, jacobi_threshold)
...
subroutine, public eigensolver_dbcsr(matrix_ks, matrix_ks_fm, mo_set, ortho_dbcsr, ksbuf1, ksbuf2)
...
subroutine, public scf_env_density_mixing(p_mix_new, mixing_store, rho_ao, para_env, iter_delta, iter_count, diis, invert)
perform (if requested) a density mixing
subroutine, public eigensolver(matrix_ks_fm, mo_set, ortho, work, cholesky_method, do_level_shift, level_shift, matrix_u_fm, use_jacobi)
Diagonalise the Kohn-Sham matrix to get a new set of MO eigen- vectors and MO eigenvalues....
subroutine, public eigensolver_symm(matrix_ks_fm, mo_set, ortho, work, do_level_shift, level_shift, matrix_u_fm, use_jacobi, jacobi_threshold, ortho_red, work_red, matrix_ks_fm_red, matrix_u_fm_red)
...
subroutine, public eigensolver_generalized(matrix_ks_fm, matrix_s, mo_set, work)
Solve the generalized eigenvalue problem using cusolverMpSygvd.
subroutine, public cp_sm_mix(m1, m2, p_mix, delta, para_env, m3)
Perform a mixing of the given matrixes into the first matrix m1 = m2 + p_mix (m1-m2)
keeps the information about the structure of a full matrix
stores all the informations relevant to an mpi environment