98#include "./base/base_uses.f90"
104 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_fb_env_methods'
132 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_s
134 LOGICAL,
INTENT(INOUT) :: diis_step
136 CHARACTER(LEN=*),
PARAMETER :: routinen =
'fb_env_do_diag'
138 CHARACTER(len=2) :: spin_string
139 CHARACTER(len=default_string_length) :: name
140 INTEGER :: filtered_nfullrowsorcols_total, handle, homo_filtered, ispin, lfomo_filtered, &
141 my_nmo, nao, ndep, nelectron, nmo, nmo_filtered, nspin, original_nfullrowsorcols_total
142 INTEGER,
DIMENSION(:),
POINTER :: filtered_roworcol_block_sizes, &
143 original_roworcol_block_sizes
144 LOGICAL :: collective_com
145 REAL(kind=
dp) :: diis_error, eps_default, eps_diis, eps_eigval, fermi_level, filter_temp, &
146 flexible_electron_count, kts_filtered, maxocc, mu_filtered
147 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, eigenvalues_filtered, occ, &
151 TYPE(
cp_fm_type) :: fm_matrix_filter, fm_matrix_filtered_ks, &
152 fm_matrix_filtered_s, fm_matrix_ortho, &
154 TYPE(
cp_fm_type),
POINTER :: mo_coeff, mo_coeff_filtered
155 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_filter
156 TYPE(
dbcsr_type) :: matrix_filtered_ks, matrix_filtered_s, &
158 TYPE(
dbcsr_type),
POINTER :: matrix_filtered_p
161 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos, mos_filtered
169 CALL timeset(routinen, handle)
171 NULLIFY (scf_env, scf_control, para_env, blacs_env, particle_set)
172 NULLIFY (eigenvalues, eigenvalues_filtered, occ, occ_filtered)
173 NULLIFY (mos, mos_filtered)
174 NULLIFY (matrix_filter, matrix_filtered_p)
175 NULLIFY (fm_struct, filter_fm_struct)
176 NULLIFY (mo_coeff_filtered, mo_coeff)
180 NULLIFY (original_roworcol_block_sizes, filtered_roworcol_block_sizes)
185 scf_control=scf_control, &
187 blacs_env=blacs_env, &
188 particle_set=particle_set, &
191 nspin =
SIZE(matrix_ks)
199 scf_env%scf_work1(ispin))
202 eps_diis = scf_control%eps_diis
203 eps_eigval = epsilon(0.0_dp)
205 IF (scf_env%iter_count > 1 .AND. .NOT. scf_env%skip_diis)
THEN
206 CALL qs_diis_b_step(scf_env%scf_diis_buffer, mos, scf_env%scf_work1, &
207 scf_env%scf_work2, scf_env%iter_delta, &
208 diis_error, diis_step, eps_diis, scf_control%nmixing, &
209 s_matrix=matrix_s, scf_section=scf_section)
215 scf_env%iter_param = diis_error
216 scf_env%iter_method =
"DIIS/Filter"
218 IF (scf_env%mixing_method == 0)
THEN
219 scf_env%iter_method =
"NoMix/Filter"
220 ELSE IF (scf_env%mixing_method == 1)
THEN
221 scf_env%iter_param = scf_env%p_mix_alpha
222 scf_env%iter_method =
"P_Mix/Filter"
223 ELSE IF (scf_env%mixing_method > 1)
THEN
224 scf_env%iter_param = scf_env%mixing_store%alpha
225 scf_env%iter_method = trim(scf_env%mixing_store%iter_method)//
"/Filter"
234 filter_temperature=filter_temp, &
235 atomic_halos=atomic_halos, &
236 eps_default=eps_default)
240 CALL fb_env_build_trial_fns_auto(fb_env, qs_env, maxocc)
254 WRITE (spin_string, fmt=
"(I1)") ispin
255 name = trim(
"FILTER MATRIX SPIN "//spin_string)
261 collective_com=collective_com)
262 IF (collective_com)
THEN
264 s_mat=matrix_s(1)%matrix, &
265 atomic_halos=atomic_halos, &
266 trial_fns=trial_fns, &
268 particle_set=particle_set, &
269 fermi_level=fermi_level, &
270 filter_temp=filter_temp, &
272 filter_mat=matrix_filter(ispin)%matrix, &
273 tolerance=eps_default)
276 s_mat=matrix_s(1)%matrix, &
277 atomic_halos=atomic_halos, &
278 trial_fns=trial_fns, &
280 particle_set=particle_set, &
281 fermi_level=fermi_level, &
282 filter_temp=filter_temp, &
284 filter_mat=matrix_filter(ispin)%matrix, &
285 tolerance=eps_default)
301 row_blk_size=original_roworcol_block_sizes, &
302 nfullrows_total=original_nfullrowsorcols_total)
304 col_blk_size=filtered_roworcol_block_sizes, &
305 nfullcols_total=filtered_nfullrowsorcols_total)
310 ALLOCATE (mos_filtered(nspin))
314 nelectron=nelectron, &
315 flexible_electron_count=flexible_electron_count)
317 nao=filtered_nfullrowsorcols_total, &
318 nmo=filtered_nfullrowsorcols_total, &
319 nelectron=nelectron, &
320 n_el_f=real(nelectron,
dp), &
322 flexible_electron_count=flexible_electron_count)
329 CALL dbcsr_create(matrix=matrix_filtered_ks, template=matrix_ks(1)%matrix, &
330 name=trim(
"FILTERED_KS_MATRIX"), &
331 matrix_type=dbcsr_type_no_symmetry, &
332 row_blk_size=filtered_roworcol_block_sizes, &
333 col_blk_size=filtered_roworcol_block_sizes)
345 CALL dbcsr_create(matrix=matrix_filtered_s, template=matrix_s(1)%matrix, &
346 name=trim(
"FILTERED_S_MATRIX"), &
347 matrix_type=dbcsr_type_no_symmetry, &
348 row_blk_size=filtered_roworcol_block_sizes, &
349 col_blk_size=filtered_roworcol_block_sizes)
354 CALL dbcsr_create(matrix=matrix_tmp, template=matrix_s(1)%matrix, &
355 name=trim(
"TEMPORARY_MATRIX"), &
356 matrix_type=dbcsr_type_no_symmetry, &
357 row_blk_size=original_roworcol_block_sizes, &
358 col_blk_size=filtered_roworcol_block_sizes)
365 nrow_global=filtered_nfullrowsorcols_total, &
366 ncol_global=filtered_nfullrowsorcols_total)
371 name=
"FM_MATRIX_FILTERED_S")
374 name=
"FM_MATRIX_FILTERED_KS")
376 CALL cp_fm_create(fm_matrix_work, fm_struct, name=
"FM_MATRIX_WORK")
377 CALL cp_fm_create(fm_matrix_ortho, fm_struct, name=
"FM_MATRIX_ORTHO")
386 matrix_ks(ispin)%matrix, matrix_filter(ispin)%matrix, &
389 matrix_filter(ispin)%matrix, matrix_tmp, &
390 0.0_dp, matrix_filtered_ks)
393 matrix_s(1)%matrix, matrix_filter(ispin)%matrix, &
396 matrix_filter(ispin)%matrix, matrix_tmp, &
397 0.0_dp, matrix_filtered_s)
406 CALL get_mo_set(mos_filtered(ispin), nmo=nmo, nao=nao)
409 ncol_global=nmo, para_env=para_env, &
414 fm_struct=fm_struct, &
419 CALL fb_env_eigensolver(fm_matrix_filtered_ks, &
420 fm_matrix_filtered_s, &
421 mos_filtered(ispin), &
426 scf_env%cholesky_method)
444 smear=scf_control%smear)
449 ALLOCATE (matrix_filtered_p)
457 CALL dbcsr_create(matrix=matrix_filtered_p, template=scf_env%p_mix_new(1, 1)%matrix, &
458 name=trim(
"FILTERED_MATRIX_P"), &
459 row_blk_size=filtered_roworcol_block_sizes, &
460 col_blk_size=filtered_roworcol_block_sizes)
462 CALL fb_dbcsr_copy_sparse_struct(matrix_filtered_p, &
463 scf_env%p_mix_new(1, 1)%matrix)
467 CALL dbcsr_set(matrix_filtered_p, 0.0_dp)
475 matrix_filter(ispin)%matrix, matrix_filtered_p, &
478 matrix_tmp, matrix_filter(ispin)%matrix, &
479 0.0_dp, scf_env%p_mix_new(ispin, 1)%matrix, &
480 retain_sparsity=.true.)
488 DEALLOCATE (matrix_filtered_p)
515 nrow_global=original_nfullrowsorcols_total, &
516 ncol_global=filtered_nfullrowsorcols_total)
519 name=
"FM_MATRIX_FILTER")
526 homo=homo_filtered, &
527 lfomo=lfomo_filtered, &
529 eigenvalues=eigenvalues_filtered, &
530 occupation_numbers=occ_filtered, &
531 mo_coeff=mo_coeff_filtered, &
536 homo=homo_filtered, &
537 lfomo=lfomo_filtered, &
543 occupation_numbers=occ, &
544 eigenvalues=eigenvalues, &
548 my_nmo = min(nmo, nmo_filtered)
549 eigenvalues(:) = 0.0_dp
550 eigenvalues(1:my_nmo) = eigenvalues_filtered(1:my_nmo)
552 occ(1:my_nmo) = occ_filtered(1:my_nmo)
557 original_nfullrowsorcols_total, &
559 filtered_nfullrowsorcols_total, &
560 1.0_dp, fm_matrix_filter, mo_coeff_filtered, &
575 DEALLOCATE (mos_filtered)
578 CALL timestop(handle)
602 SUBROUTINE fb_env_eigensolver(fm_KS, fm_S, mo_set, fm_ortho, &
603 fm_work, eps_eigval, ndep, method)
606 TYPE(
cp_fm_type),
INTENT(IN) :: fm_ortho, fm_work
607 REAL(kind=
dp),
INTENT(IN) :: eps_eigval
608 INTEGER,
INTENT(OUT) :: ndep
609 INTEGER,
INTENT(IN) :: method
611 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_eigensolver'
613 CHARACTER(len=8) :: ndep_string
614 INTEGER :: handle, info, my_method, nao, nmo
615 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
618 CALL timeset(routinen, handle)
623 eigenvalues=mo_eigenvalues, &
633 CALL cp_warn(__location__, &
634 "Unable to perform Cholesky decomposition on the overlap "// &
635 "matrix. The new filtered basis may not be linearly "// &
636 "independent set. Revert to using inverse square-root "// &
637 "of the overlap. To avoid this warning, you can try "// &
638 "to use a higher filter termperature.")
641 SELECT CASE (my_method)
643 CALL cp_abort(__location__, &
644 "filter matrix method with CHOLESKY_DBCSR is not yet implemented")
654 pos=
"LEFT", transa=
"T")
663 transpose_tr=.false., &
672 transpose_tr=.true., &
682 transpose_tr=.false., &
699 WRITE (ndep_string, fmt=
"(I8)") ndep
700 CALL cp_warn(__location__, &
701 "Number of linearly dependent filtered orbitals: "//ndep_string)
704 CALL cp_fm_symm(
"L",
"U", nao, nao, 1.0_dp, fm_ks, fm_ortho, &
706 CALL parallel_gemm(
"T",
"N", nao, nao, nao, 1.0_dp, fm_ortho, &
707 fm_work, 0.0_dp, fm_ks)
709 CALL parallel_gemm(
"N",
"N", nao, nmo, nao, 1.0_dp, fm_ortho, &
710 fm_work, 0.0_dp, mo_coeff)
713 CALL timestop(handle)
715 END SUBROUTINE fb_env_eigensolver
728 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_read_input'
732 REAL(kind=
dp) :: r_val
735 CALL timeset(routinen, handle)
739 "DIAGONALIZATION%FILTER_MATRIX")
744 filter_temperature=r_val)
749 auto_cutoff_scale=r_val)
754 collective_com=l_val)
761 CALL timestop(handle)
777 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_build_rcut_auto'
779 INTEGER :: handle, ikind, nkinds
780 REAL(kind=
dp) :: auto_cutoff_scale, kind_radius
781 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rcut
785 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
787 CALL timeset(routinen, handle)
789 NULLIFY (rcut, qs_kind_set, dft_control)
792 qs_kind_set=qs_kind_set, &
793 dft_control=dft_control)
795 auto_cutoff_scale=auto_cutoff_scale)
797 nkinds =
SIZE(qs_kind_set)
798 ALLOCATE (rcut(nkinds))
807 ALLOCATE (basis_set_list(nkinds))
808 IF (dft_control%do_admm)
THEN
815 basis_set => basis_set_list(ikind)%gto_basis_set
817 rcut(ikind) = kind_radius*auto_cutoff_scale
824 DEALLOCATE (basis_set_list)
826 CALL timestop(handle)
845 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_build_atomic_halos'
847 INTEGER :: handle, iatom, ihalo, max_natoms_local, natoms_global, natoms_local, nelectrons, &
848 nhalo_atoms, nkinds_global, owner_id_in_halo
849 INTEGER,
DIMENSION(:),
POINTER :: halo_atoms, local_atoms
850 REAL(kind=
dp) :: cost
851 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radii
852 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rcut
858 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
860 CALL timeset(routinen, handle)
864 NULLIFY (cell, halos, halo_atoms, rcut, particle_set, para_env, &
865 qs_kind_set, local_atoms)
871 local_atoms=local_atoms, &
872 nlocal_atoms=natoms_local)
879 natom=natoms_global, &
880 particle_set=particle_set, &
881 qs_kind_set=qs_kind_set, &
882 nkind=nkinds_global, &
887 max_natoms_local = natoms_local
888 CALL para_env%max(max_natoms_local)
891 ALLOCATE (halos(natoms_local))
892 DO ihalo = 1, natoms_local
897 nhalos=natoms_local, &
898 max_nhalos=max_natoms_local)
900 ALLOCATE (pair_radii(nkinds_global, nkinds_global))
903 DO iatom = 1, natoms_local
913 owner_atom=local_atoms(iatom), &
914 owner_id_in_halo=owner_id_in_halo, &
915 natoms=nhalo_atoms, &
916 halo_atoms=halo_atoms)
927 nelectrons=nelectrons, &
932 DEALLOCATE (pair_radii)
938 atomic_halos=atomic_halos)
945 CALL timestop(handle)
958 SUBROUTINE fb_env_build_trial_fns_auto(fb_env, qs_env, maxocc)
962 REAL(kind=
dp),
INTENT(IN) :: maxocc
964 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_build_trial_fns_auto'
966 INTEGER :: counter, handle, icgf, ico, ikind, iset, &
967 ishell, itrial, lshell, max_n_trial, &
968 nkinds, nset, old_lshell
969 INTEGER,
DIMENSION(:),
POINTER :: lmax, nfunctions, nshell
970 INTEGER,
DIMENSION(:, :),
POINTER :: functions
971 REAL(kind=
dp) :: zeff
976 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
978 CALL timeset(routinen, handle)
981 NULLIFY (nfunctions, functions, basis_set, basis_set_list, qs_kind_set, dft_control)
988 qs_kind_set=qs_kind_set, &
989 dft_control=dft_control)
991 nkinds =
SIZE(qs_kind_set)
1000 ALLOCATE (basis_set_list(nkinds))
1001 IF (dft_control%do_admm)
THEN
1007 ALLOCATE (nfunctions(nkinds))
1010 DO ikind = 1, nkinds
1012 basis_set => basis_set_list(ikind)%gto_basis_set
1020 bset1:
DO iset = 1, nset
1023 DO ishell = 1, nshell(iset)
1024 lshell = basis_set%l(ishell, iset)
1028 counter = counter + 1
1030 IF ((lshell > old_lshell) .AND. (counter <=
nco(lshell)))
THEN
1031 nfunctions(ikind) = nfunctions(ikind) + 1
1038 IF (((lshell > old_lshell) .OR. (lshell == lmax(iset))) .AND. &
1039 (maxocc*real(nfunctions(ikind),
dp) >= zeff))
THEN
1049 max_n_trial = maxval(nfunctions)
1050 ALLOCATE (functions(max_n_trial, nkinds))
1053 DO ikind = 1, nkinds
1055 basis_set => basis_set_list(ikind)%gto_basis_set
1064 bset2:
DO iset = 1, nset
1066 DO ishell = 1, nshell(iset)
1067 lshell = basis_set%l(ishell, iset)
1072 counter = counter + 1
1074 IF ((lshell > old_lshell) .AND. (counter <=
nco(lshell)))
THEN
1076 functions(itrial, ikind) = icgf
1084 IF (((lshell > old_lshell) .OR. (lshell == lmax(iset))) .AND. &
1085 (maxocc*real(itrial,
dp) >= zeff))
THEN
1095 nfunctions=nfunctions, &
1096 functions=functions)
1099 trial_fns=trial_fns)
1102 DEALLOCATE (basis_set_list)
1104 CALL timestop(handle)
1106 END SUBROUTINE fb_env_build_trial_fns_auto
1118 SUBROUTINE fb_dbcsr_copy_sparse_struct(matrix_out, matrix_in)
1120 TYPE(
dbcsr_type),
INTENT(INOUT) :: matrix_out
1123 INTEGER :: iatom, jatom, nblkcols_total, &
1124 nblkrows_total, nblks
1125 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: cols, rows
1129 nblkrows_total=nblkrows_total, &
1130 nblkcols_total=nblkcols_total)
1132 nblks = nblkrows_total*nblkcols_total
1133 ALLOCATE (rows(nblks))
1134 ALLOCATE (cols(nblks))
1153 END SUBROUTINE fb_dbcsr_copy_sparse_struct
1168 CHARACTER(len=*),
PARAMETER :: routinen =
'fb_env_write_info'
1170 CHARACTER(LEN=2) :: element_symbol
1171 INTEGER :: handle, ikind, nkinds, unit_nr
1172 LOGICAL :: collective_com
1173 REAL(kind=
dp) :: auto_cutoff_scale, filter_temperature
1174 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rcut
1178 CALL timeset(routinen, handle)
1180 NULLIFY (rcut, atomic_kind_set, logger)
1183 atomic_kind_set=atomic_kind_set)
1185 filter_temperature=filter_temperature, &
1186 auto_cutoff_scale=auto_cutoff_scale, &
1188 collective_com=collective_com)
1190 nkinds =
SIZE(atomic_kind_set)
1194 "PRINT%FILTER_MATRIX", &
1196 IF (unit_nr > 0)
THEN
1197 IF (collective_com)
THEN
1198 WRITE (unit=unit_nr, fmt=
"(/,A,T71,A)") &
1199 " FILTER_MAT_DIAG| MPI communication method:", &
1202 WRITE (unit=unit_nr, fmt=
"(/,A,T71,A)") &
1203 " FILTER_MAT_DIAG| MPI communication method:", &
1206 WRITE (unit=unit_nr, fmt=
"(A,T71,g10.4)") &
1207 " FILTER_MAT_DIAG| Filter temperature [K]:", &
1209 WRITE (unit=unit_nr, fmt=
"(A,T71,f10.4)") &
1210 " FILTER_MAT_DIAG| Filter temperature [a.u.]:", &
1212 WRITE (unit=unit_nr, fmt=
"(A,T71,f10.4)") &
1213 " FILTER_MAT_DIAG| Auto atomic cutoff radius scale:", &
1215 WRITE (unit=unit_nr, fmt=
"(A)") &
1216 " FILTER_MAT_DIAG| atomic cutoff radii [a.u.]"
1217 DO ikind = 1, nkinds
1219 element_symbol=element_symbol)
1220 WRITE (unit=unit_nr, fmt=
"(A,A,T71,f10.4)") &
1221 " FILTER_MAT_DIAG| ", element_symbol, rcut(ikind)
1225 "PRINT%FILTER_MATRIX")
1227 CALL timestop(handle)
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
Handles all functions related to the CELL.
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
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_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_reserve_blocks(matrix, rows, cols)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset, transposed)
...
subroutine, public dbcsr_finalize(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_iterator_readonly_start(iterator, matrix, shared, dynamic, dynamic_byrows)
Like dbcsr_iterator_start() but with matrix being INTENT(IN). When invoking this routine,...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_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)
computes matrix_c = beta * matrix_c + alpha * ( matrix_a ** transa ) * ( matrix_b ** transb )
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_triangular_invert(matrix_a, uplo_tr)
inverts a triangular 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_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
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_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
...
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
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public ncoset
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
collects routines that calculate density matrices
Apply the direct inversion in the iterative subspace (DIIS) of Pulay in the framework of an SCF itera...
subroutine, public qs_diis_b_step(diis_buffer, mo_array, kc, sc, delta, error_max, diis_step, eps_diis, nmixing, s_matrix, scf_section, roks)
Update the SCF DIIS buffer, and if appropriate does a diis step.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
real(kind=dp) function, public fb_atomic_halo_cost(atomic_halo, particle_set, qs_kind_set)
Estimates the computational cost with respect to the filter matrix calculation associated to an atomi...
subroutine, public fb_atomic_halo_build_halo_atoms(owner_atom, particle_set, cell, pair_radii, halo_atoms, nhalo_atoms, owner_id_in_halo)
Builds halo atoms for a given (owner) atom.
subroutine, public fb_atomic_halo_set(atomic_halo, owner_atom, owner_id_in_halo, natoms, nelectrons, halo_atoms, sorted, cost)
Sets attributes in a fb_atomic_halo object, one should only set the data content in a fb_atomic_halo ...
subroutine, public fb_atomic_halo_sort(atomic_halo)
Sort the list of atomic indices in the halo in ascending order. The atomic_halo must not be empty.
subroutine, public fb_atomic_halo_create(atomic_halo)
Creates and initialises an empty fb_atomic_halo object.
subroutine, public fb_atomic_halo_list_create(atomic_halos)
Creates and initialises an empty fb_atomic_halo_list object.
pure subroutine, public fb_build_pair_radii(rcut, nkinds, pair_radii)
Builds the required pair_radii array required for building the halo atoms from a given set of cut off...
subroutine, public fb_atomic_halo_list_set(atomic_halos, nhalos, max_nhalos, halos)
Sets attributes from an fb_atomic_halo_list object, one should only set the data content in a fb_atom...
subroutine, public fb_atomic_halo_nullify(atomic_halo)
Nullifies a fb_atomic_halo object, note that it does not release the original object....
integer function, public fb_atomic_halo_nelectrons_estimate_z(atomic_halo, particle_set)
Estimates the total number of electrons in a halo using atomic numbers.
subroutine, public fb_atomic_halo_list_write_info(atomic_halos, para_env, scf_section)
Writes out the atomic halo list summary, no detailed neighbour lists, just average,...
subroutine, public fb_atomic_halo_list_nullify(atomic_halos)
Nullifies a fb_atomic_halo_list object, note that it does not release the original object....
subroutine, public fb_env_do_diag(fb_env, qs_env, matrix_ks, matrix_s, scf_section, diis_step)
Do filtered matrix method diagonalisation.
subroutine, public fb_env_read_input(fb_env, scf_section)
Read input sections for filter matrix method.
subroutine, public fb_env_build_atomic_halos(fb_env, qs_env, scf_section)
Builds an fb_atomic_halo_list object using information from fb_env.
subroutine, public fb_env_write_info(fb_env, qs_env, scf_section)
Write out parameters used for the filter matrix method to output.
subroutine, public fb_env_build_rcut_auto(fb_env, qs_env)
Automatically generate the cutoff radii of atoms used for constructing the atomic halos,...
logical function, public fb_env_has_data(fb_env)
Checks if a fb_env object is associated with an actual data content or not.
subroutine, public fb_env_get(fb_env, rcut, filter_temperature, auto_cutoff_scale, eps_default, atomic_halos, trial_fns, collective_com, local_atoms, nlocal_atoms)
method to get attributes from a given fb_env object
subroutine, public fb_env_set(fb_env, rcut, filter_temperature, auto_cutoff_scale, eps_default, atomic_halos, trial_fns, collective_com, local_atoms, nlocal_atoms)
method to set attributes from a given fb_env object
subroutine, public fb_fltrmat_build_2(h_mat, s_mat, atomic_halos, trial_fns, para_env, particle_set, fermi_level, filter_temp, name, filter_mat, tolerance)
Build the filter matrix, with MPI communications grouped together. More effcient on communication,...
subroutine, public fb_fltrmat_build(h_mat, s_mat, atomic_halos, trial_fns, para_env, particle_set, fermi_level, filter_temp, name, filter_mat, tolerance)
Build the filter matrix, with MPI communications happening at each step. Less efficient on communicat...
subroutine, public fb_trial_fns_set(trial_fns, nfunctions, functions)
sets the attributes of a fb_trial_fns object
subroutine, public fb_trial_fns_nullify(trial_fns)
nullifies the content of given object
subroutine, public fb_trial_fns_create(trial_fns)
creates an fb_trial_fns object and initialises it
Some utility functions for the calculation of integrals.
subroutine, public basis_set_list_setup(basis_set_list, basis_type, qs_kind_set)
Set up an easy accessible list of the basis sets for all kinds.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Set occupation of molecular orbitals.
Definition and initialisation of the mo data type.
subroutine, public set_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, uniform_occupation, kts, mu, flexible_electron_count)
Set the components of a MO set data structure.
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name, counter, complex_coeff)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
subroutine, public allocate_mo_set(mo_set, nao, nmo, nelectron, n_el_f, maxocc, flexible_electron_count)
Allocates a mo set and partially initializes it (nao,nmo,nelectron, and flexible_electron_count are v...
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
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, cmo_coeff)
Get the components of a MO set data structure.
module that contains the definitions of the scf types
parameters that control an scf iteration
Utilities for string manipulations.
subroutine, public compress(string, full)
Eliminate multiple space characters in a string. If full is .TRUE., then all spaces are eliminated.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
defines a fb_atomic_halo_list object
defines a fb_atomic_halo object
the object container which allows for the creation of an array of pointers to fb_env
the object container which allows for the creation of an array of pointers to fb_trial_fns objects
Provides all information about a quickstep kind.