53#include "./base/base_uses.f90"
59 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_scf_methods'
60 REAL(KIND=
dp),
PARAMETER :: ratio = 0.25_dp
71 MODULE PROCEDURE combine_ks_matrices_1, &
93 iter_delta, iter_count, diis, invert)
94 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: p_mix_new
98 REAL(kind=
dp),
INTENT(INOUT) :: iter_delta
99 INTEGER,
INTENT(IN) :: iter_count
100 LOGICAL,
INTENT(in),
OPTIONAL :: diis, invert
102 CHARACTER(len=*),
PARAMETER :: routinen =
'scf_env_density_mixing'
104 INTEGER :: handle, ic, ispin
105 LOGICAL :: my_diis, my_invert
106 REAL(kind=
dp) :: my_p_mix, tmp
108 CALL timeset(routinen, handle)
111 IF (
PRESENT(diis)) my_diis = diis
113 IF (
PRESENT(invert)) my_invert = invert
114 my_p_mix = mixing_store%alpha
115 IF (my_diis .OR. iter_count < mixing_store%nskip_mixing)
THEN
120 cpassert(
ASSOCIATED(p_mix_new))
121 DO ic = 1,
SIZE(p_mix_new, 2)
122 DO ispin = 1,
SIZE(p_mix_new, 1)
124 cpassert(my_p_mix /= 0.0_dp)
125 IF (my_p_mix /= 1.0_dp)
THEN
126 CALL dbcsr_add(matrix_a=p_mix_new(ispin, ic)%matrix, &
127 alpha_scalar=1.0_dp/my_p_mix, &
128 matrix_b=rho_ao(ispin, ic)%matrix, &
129 beta_scalar=(my_p_mix - 1.0_dp)/my_p_mix)
132 CALL cp_sm_mix(m1=p_mix_new(ispin, ic)%matrix, &
133 m2=rho_ao(ispin, ic)%matrix, &
137 iter_delta = max(iter_delta, tmp)
142 CALL timestop(handle)
163 cholesky_method, do_level_shift, &
164 level_shift, matrix_u_fm, use_jacobi)
168 INTEGER,
INTENT(inout) :: cholesky_method
169 LOGICAL,
INTENT(in) :: do_level_shift
170 REAL(kind=
dp),
INTENT(in) :: level_shift
171 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
172 LOGICAL,
INTENT(in) :: use_jacobi
174 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver'
176 INTEGER :: handle, homo, nao, nmo
177 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
180 CALL timeset(routinen, handle)
183 NULLIFY (mo_eigenvalues)
191 eigenvalues=mo_eigenvalues, &
194 SELECT CASE (cholesky_method)
198 IF (do_level_shift) &
199 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
200 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
204 IF (do_level_shift) &
205 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
210 "SOLVE", pos=
"RIGHT")
212 "SOLVE", pos=
"LEFT", transa=
"T")
214 IF (do_level_shift) &
215 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
216 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
221 IF (do_level_shift) &
222 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
228 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nao, alpha=1.0_dp)
230 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nao, alpha=1.0_dp)
232 IF (do_level_shift) &
233 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
234 level_shift=level_shift, is_triangular=.true., matrix_u_fm=matrix_u_fm)
238 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nmo, alpha=1.0_dp)
241 IF (do_level_shift) &
242 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
251 CALL timestop(handle)
266 TYPE(
cp_fm_type),
INTENT(INOUT) :: matrix_ks_fm
269 TYPE(
dbcsr_type),
INTENT(INOUT) :: ksbuf1, ksbuf2
271 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_dbcsr'
273 INTEGER :: handle, nao, nmo
274 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
278 CALL timeset(routinen, handle)
281 NULLIFY (mo_eigenvalues)
286 eigenvalues=mo_eigenvalues, &
291 CALL dbcsr_multiply(
'N',
'N', 1.0_dp, ksbuf2, ortho_dbcsr, 0.0_dp, ksbuf1)
292 CALL dbcsr_multiply(
'T',
'N', 1.0_dp, ortho_dbcsr, ksbuf1, 0.0_dp, ksbuf2)
296 CALL cp_fm_create(all_evecs, matrix_ks_fm%matrix_struct)
301 CALL cp_fm_to_fm(msource=all_evecs, mtarget=nmo_evecs, ncol=nmo)
308 CALL timestop(handle)
329 level_shift, matrix_u_fm, use_jacobi, jacobi_threshold, &
330 ortho_red, work_red, matrix_ks_fm_red, matrix_u_fm_red)
334 LOGICAL,
INTENT(IN) :: do_level_shift
335 REAL(kind=
dp),
INTENT(IN) :: level_shift
336 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
337 LOGICAL,
INTENT(IN) :: use_jacobi
338 REAL(kind=
dp),
INTENT(IN) :: jacobi_threshold
339 TYPE(
cp_fm_type),
INTENT(INOUT),
OPTIONAL :: ortho_red, work_red, matrix_ks_fm_red, &
342 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_symm'
344 INTEGER :: handle, homo, nao, nao_red, nelectron, &
346 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues
347 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
351 CALL timeset(routinen, handle)
354 NULLIFY (mo_eigenvalues)
362 nelectron=nelectron, &
363 eigenvalues=mo_eigenvalues, &
368 CALL cp_fm_symm(
"L",
"U", nao, homo, 1.0_dp, matrix_ks_fm, mo_coeff, 0.0_dp, work)
369 CALL parallel_gemm(
"T",
"N", homo, nao - homo, nao, 1.0_dp, work, mo_coeff, &
370 0.0_dp, matrix_ks_fm, b_first_col=homo + 1, c_first_col=homo + 1)
374 jacobi_threshold, homo + 1)
377 IF (
PRESENT(work_red) .AND.
PRESENT(ortho_red) .AND.
PRESENT(matrix_ks_fm_red))
THEN
379 CALL cp_fm_symm(
"L",
"U", nao, nao_red, 1.0_dp, matrix_ks_fm, ortho_red, 0.0_dp, work_red)
380 CALL parallel_gemm(
"T",
"N", nao_red, nao_red, nao, 1.0_dp, ortho_red, work_red, 0.0_dp, matrix_ks_fm_red)
382 IF (do_level_shift) &
383 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm_red, mo_coeff=mo_coeff, homo=homo, &
384 level_shift=level_shift, is_triangular=.false., matrix_u_fm=matrix_u_fm_red)
386 CALL cp_fm_create(work_red2, matrix_ks_fm_red%matrix_struct)
387 ALLOCATE (eigenvalues(nao_red))
389 mo_eigenvalues(1:min(nao_red, nmo)) = eigenvalues(1:min(nao_red, nmo))
390 CALL parallel_gemm(
"N",
"N", nao, nmo, nao_red, 1.0_dp, ortho_red, work_red2, 0.0_dp, &
394 CALL cp_fm_symm(
"L",
"U", nao, nao, 1.0_dp, matrix_ks_fm, ortho, 0.0_dp, work)
395 CALL parallel_gemm(
"T",
"N", nao, nao, nao, 1.0_dp, ortho, work, 0.0_dp, matrix_ks_fm)
396 IF (do_level_shift) &
397 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks_fm, mo_coeff=mo_coeff, homo=homo, &
398 level_shift=level_shift, is_triangular=.false., matrix_u_fm=matrix_u_fm)
400 CALL parallel_gemm(
"N",
"N", nao, nmo, nao, 1.0_dp, ortho, work, 0.0_dp, &
404 IF (do_level_shift) &
405 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
409 CALL timestop(handle)
426 level_shift, use_jacobi, jacobi_threshold)
431 LOGICAL,
INTENT(IN) :: do_level_shift
432 REAL(kind=
dp),
INTENT(IN) :: level_shift
433 LOGICAL,
INTENT(IN) :: use_jacobi
434 REAL(kind=
dp),
INTENT(IN) :: jacobi_threshold
436 CHARACTER(len=*),
PARAMETER :: routinen =
'eigensolver_simple'
438 INTEGER :: handle, homo, nao, nelectron, nmo
439 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
442 CALL timeset(routinen, handle)
445 NULLIFY (mo_eigenvalues)
451 nelectron=nelectron, &
452 eigenvalues=mo_eigenvalues, &
455 IF (do_level_shift)
THEN
457 CALL shift_unocc_mos(matrix_ks_fm=matrix_ks, mo_coeff=mo_coeff, homo=homo, &
458 level_shift=level_shift, is_triangular=.false.)
462 CALL cp_fm_symm(
"L",
"U", nao, homo, 1.0_dp, matrix_ks, mo_coeff, 0.0_dp, work)
463 CALL parallel_gemm(
"T",
"N", homo, nao - homo, nao, 1.0_dp, work, mo_coeff, &
464 0.0_dp, matrix_ks, b_first_col=homo + 1, c_first_col=homo + 1)
466 CALL cp_fm_block_jacobi(matrix_ks, mo_coeff, mo_eigenvalues, jacobi_threshold, homo + 1)
475 IF (do_level_shift) &
476 CALL correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
478 CALL timestop(handle)
499 SUBROUTINE cp_sm_mix(m1, m2, p_mix, delta, para_env, m3)
502 REAL(kind=
dp),
INTENT(IN) :: p_mix
503 REAL(kind=
dp),
INTENT(OUT) :: delta
507 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_sm_mix'
509 INTEGER :: handle, i, iblock_col, iblock_row, j
511 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: p_delta_block, p_new_block, p_old_block
514 CALL timeset(routinen, handle)
521 block=p_old_block, found=found)
522 cpassert(
ASSOCIATED(p_old_block))
523 IF (
PRESENT(m3))
THEN
525 block=p_delta_block, found=found)
526 cpassert(
ASSOCIATED(p_delta_block))
528 DO j = 1,
SIZE(p_new_block, 2)
529 DO i = 1,
SIZE(p_new_block, 1)
530 p_delta_block(i, j) = p_new_block(i, j) - p_old_block(i, j)
531 delta = max(delta, abs(p_delta_block(i, j)))
535 DO j = 1,
SIZE(p_new_block, 2)
536 DO i = 1,
SIZE(p_new_block, 1)
537 p_new_block(i, j) = p_new_block(i, j) - p_old_block(i, j)
538 delta = max(delta, abs(p_new_block(i, j)))
539 p_new_block(i, j) = p_old_block(i, j) + p_mix*p_new_block(i, j)
546 CALL para_env%max(delta)
548 CALL timestop(handle)
560 SUBROUTINE combine_ks_matrices_1(ksa, ksb, occa, occb, roks_parameter)
572 REAL(KIND=
dp),
DIMENSION(:),
INTENT(IN) :: occa, occb
573 REAL(KIND=
dp),
DIMENSION(0:2, 0:2, 1:2), &
574 INTENT(IN) :: roks_parameter
576 CHARACTER(LEN=*),
PARAMETER :: routineN =
'combine_ks_matrices_1'
578 INTEGER :: handle, i, icol_global, icol_local, &
579 irow_global, irow_local, j, &
580 ncol_local, nrow_local
581 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
582 LOGICAL :: compatible_matrices
583 REAL(KIND=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
589 CALL timeset(routinen, handle)
592 matrix_struct=ksa_struct, &
593 nrow_local=nrow_local, &
594 ncol_local=ncol_local, &
595 row_indices=row_indices, &
596 col_indices=col_indices, &
600 matrix_struct=ksb_struct, &
604 cpassert(compatible_matrices)
606 IF (sum(occb) == 0.0_dp) fb = 0.0_dp
608 DO icol_local = 1, ncol_local
609 icol_global = col_indices(icol_local)
610 j = int(occa(icol_global)) + int(occb(icol_global))
611 DO irow_local = 1, nrow_local
612 irow_global = row_indices(irow_local)
613 i = int(occa(irow_global)) + int(occb(irow_global))
614 fa(irow_local, icol_local) = &
615 roks_parameter(i, j, 1)*fa(irow_local, icol_local) + &
616 roks_parameter(i, j, 2)*fb(irow_local, icol_local)
620 CALL timestop(handle)
622 END SUBROUTINE combine_ks_matrices_1
634 SUBROUTINE combine_ks_matrices_2(ksa, ksb, occa, occb, f, nalpha, nbeta)
646 REAL(KIND=
dp),
DIMENSION(:),
INTENT(IN) :: occa, occb
647 REAL(KIND=
dp),
INTENT(IN) :: f
648 INTEGER,
INTENT(IN) :: nalpha, nbeta
650 CHARACTER(LEN=*),
PARAMETER :: routineN =
'combine_ks_matrices_2'
652 INTEGER :: handle, icol_global, icol_local, &
653 irow_global, irow_local, ncol_local, &
655 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
656 LOGICAL :: compatible_matrices
657 REAL(KIND=
dp) :: beta, t1, t2, ta, tb
658 REAL(KIND=
dp),
CONTIGUOUS,
DIMENSION(:, :), &
664 CALL timeset(routinen, handle)
667 matrix_struct=ksa_struct, &
668 nrow_local=nrow_local, &
669 ncol_local=ncol_local, &
670 row_indices=row_indices, &
671 col_indices=col_indices, &
675 matrix_struct=ksb_struct, &
679 cpassert(compatible_matrices)
681 beta = 1.0_dp/(1.0_dp - f)
683 DO icol_local = 1, ncol_local
685 icol_global = col_indices(icol_local)
687 DO irow_local = 1, nrow_local
689 irow_global = row_indices(irow_local)
691 t1 = 0.5_dp*(fa(irow_local, icol_local) + fb(irow_local, icol_local))
693 IF ((0 < irow_global) .AND. (irow_global <= nbeta))
THEN
694 IF ((0 < icol_global) .AND. (icol_global <= nbeta))
THEN
696 fa(irow_local, icol_local) = t1
697 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
699 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
700 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
701 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
702 fa(irow_local, icol_local) = t1 + (beta - 1.0_dp)*t2
705 fa(irow_local, icol_local) = t1
707 ELSE IF ((nbeta < irow_global) .AND. (irow_global <= nalpha))
THEN
708 IF ((0 < irow_global) .AND. (irow_global <= nbeta))
THEN
710 ta = 0.5_dp*(f - real(occa(irow_global), kind=
dp))/f
711 tb = 0.5_dp*(f - real(occb(irow_global), kind=
dp))/f
712 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
713 fa(irow_local, icol_local) = t1 + (beta - 1.0_dp)*t2
714 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
716 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
717 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
718 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
719 IF (irow_global == icol_global)
THEN
720 fa(irow_local, icol_local) = t1 - t2
722 fa(irow_local, icol_local) = t1 - 0.5_dp*t2
726 ta = 0.5_dp*(f - real(occa(irow_global), kind=
dp))/f
727 tb = 0.5_dp*(f - real(occb(irow_global), kind=
dp))/f
728 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
729 fa(irow_local, icol_local) = t1 - t2
732 IF ((0 < irow_global) .AND. (irow_global < nbeta))
THEN
734 fa(irow_local, icol_local) = t1
735 ELSE IF ((nbeta < icol_global) .AND. (icol_global <= nalpha))
THEN
737 ta = 0.5_dp*(f - real(occa(icol_global), kind=
dp))/f
738 tb = 0.5_dp*(f - real(occb(icol_global), kind=
dp))/f
739 t2 = ta*fa(irow_local, icol_local) + tb*fb(irow_local, icol_local)
740 fa(irow_local, icol_local) = t1 - t2
743 fa(irow_local, icol_local) = t1
750 CALL timestop(handle)
752 END SUBROUTINE combine_ks_matrices_2
767 PURE SUBROUTINE correct_mo_eigenvalues(mo_eigenvalues, homo, nmo, level_shift)
769 REAL(kind=
dp),
DIMENSION(:),
INTENT(inout) :: mo_eigenvalues
770 INTEGER,
INTENT(in) :: homo, nmo
771 REAL(kind=
dp),
INTENT(in) :: level_shift
775 DO imo = homo + 1, nmo
776 mo_eigenvalues(imo) = mo_eigenvalues(imo) - level_shift
779 END SUBROUTINE correct_mo_eigenvalues
794 SUBROUTINE shift_unocc_mos(matrix_ks_fm, mo_coeff, homo, &
795 level_shift, is_triangular, matrix_u_fm)
797 TYPE(
cp_fm_type),
INTENT(IN) :: matrix_ks_fm, mo_coeff
798 INTEGER,
INTENT(in) :: homo
799 REAL(kind=
dp),
INTENT(in) :: level_shift
800 LOGICAL,
INTENT(in) :: is_triangular
801 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: matrix_u_fm
803 CHARACTER(len=*),
PARAMETER :: routineN =
'shift_unocc_mos'
805 INTEGER :: handle, nao, nao_red, nmo
806 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: weights
810 CALL timeset(routinen, handle)
812 IF (
PRESENT(matrix_u_fm))
THEN
814 CALL cp_fm_get_info(matrix_u_fm, nrow_global=nao_red, ncol_global=nao)
820 NULLIFY (ao_mo_fmstruct)
822 para_env=mo_coeff%matrix_struct%para_env, context=mo_coeff%matrix_struct%context)
830 IF (
PRESENT(matrix_u_fm))
THEN
831 IF (is_triangular)
THEN
834 invert_tr=.false., uplo_tr=
"U", n_rows=nao, n_cols=nmo, alpha=1.0_dp)
836 CALL parallel_gemm(
"N",
"N", nao_red, nmo, nao, 1.0_dp, matrix_u_fm, mo_coeff, 0.0_dp, u_mo)
848 ALLOCATE (weights(nmo))
849 weights(1:homo) = 0.0_dp
850 weights(homo + 1:nmo) = level_shift
857 CALL parallel_gemm(
"N",
"T", nao_red, nao_red, nmo, 1.0_dp, u_mo, u_mo_scaled, 1.0_dp, matrix_ks_fm)
862 CALL timestop(handle)
864 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_cholesky_restore(fm_matrix, neig, fm_matrixb, fm_matrixout, op, pos, transa)
...
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_reduce(matrix, matrixb, itype)
reduce a matrix pencil A,B to normal form B has to be cholesky decomposed with cp_fm_cholesky_decompo...
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)
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 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