204#include "./base/base_uses.f90"
210 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_scf_post_gpw'
241 CHARACTER(6),
OPTIONAL :: wf_type
242 LOGICAL,
OPTIONAL :: do_mp2
244 CHARACTER(len=*),
PARAMETER :: routinen =
'scf_post_calculation_gpw'
246 INTEGER :: handle, homo, ispin, min_lumos, n_rep, &
247 nchk_nmoloc, nhomo, nlumo, nlumo_stm, &
248 nlumos, nmo, nspins, output_unit, &
250 INTEGER,
DIMENSION(:, :, :),
POINTER :: marked_states
251 LOGICAL :: check_write, compute_lumos, do_homo, do_kpoints,
do_mixed, do_mo_cubes, do_stm, &
252 do_wannier_cubes, has_homo, has_lumo, loc_explicit, loc_print_explicit, my_do_mp2, &
253 my_localized_wfn, p_loc, p_loc_homo, p_loc_lumo, p_loc_mixed
255 REAL(kind=
dp) :: gap, homo_lumo(2, 2), total_zeff_corr
256 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues
259 TYPE(
cp_1d_r_p_type),
DIMENSION(:),
POINTER :: mixed_evals, occupied_evals, &
260 unoccupied_evals, unoccupied_evals_stm
261 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: mixed_orbs, occupied_orbs
262 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:), &
263 TARGET :: homo_localized, lumo_localized, &
265 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: lumo_ptr, mo_loc_history, &
266 unoccupied_orbs, unoccupied_orbs_stm
269 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: ks_rmpv, matrix_p_mp2, matrix_s, &
271 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: kinetic_m, rho_ao
283 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
291 localize_section, print_key, &
294 CALL timeset(routinen, handle)
301 IF (
PRESENT(do_mp2)) my_do_mp2 = do_mp2
302 IF (
PRESENT(wf_type))
THEN
303 IF (output_unit > 0)
THEN
304 WRITE (unit=output_unit, fmt=
'(/,(T1,A))') repeat(
"-", 40)
305 WRITE (unit=output_unit, fmt=
'(/,(T3,A,T19,A,T25,A))')
"Properties from ", wf_type,
" density"
306 WRITE (unit=output_unit, fmt=
'(/,(T1,A))') repeat(
"-", 40)
313 my_localized_wfn = .false.
314 NULLIFY (admm_env, dft_control, pw_env, auxbas_pw_pool, pw_pools, mos, rho, &
315 mo_coeff, ks_rmpv, matrix_s, qs_loc_env_homo, qs_loc_env_lumo, scf_control, &
316 unoccupied_orbs, mo_eigenvalues, unoccupied_evals, &
317 unoccupied_evals_stm, molecule_set, mo_derivs, &
318 subsys, particles, input, print_key, kinetic_m, marked_states, &
319 mixed_evals, qs_loc_env_mixed)
320 NULLIFY (lumo_ptr, rho_ao)
327 p_loc_mixed = .false.
329 cpassert(
ASSOCIATED(scf_env))
330 cpassert(
ASSOCIATED(qs_env))
333 dft_control=dft_control, &
334 molecule_set=molecule_set, &
335 scf_control=scf_control, &
336 do_kpoints=do_kpoints, &
341 particle_set=particle_set, &
342 atomic_kind_set=atomic_kind_set, &
343 qs_kind_set=qs_kind_set)
350 CALL get_qs_env(qs_env, matrix_p_mp2=matrix_p_mp2)
351 DO ispin = 1, dft_control%nspins
352 CALL dbcsr_add(rho_ao(ispin, 1)%matrix, matrix_p_mp2(ispin)%matrix, 1.0_dp, 1.0_dp)
357 CALL update_hartree_with_mp2(rho, qs_env)
360 CALL write_available_results(qs_env, scf_env)
364 "DFT%PRINT%KINETIC_ENERGY") /= 0)
THEN
366 cpassert(
ASSOCIATED(kinetic_m))
367 cpassert(
ASSOCIATED(kinetic_m(1, 1)%matrix))
371 IF (unit_nr > 0)
THEN
372 WRITE (unit_nr,
'(T3,A,T55,F25.14)')
"Electronic kinetic energy:", e_kin
375 "DFT%PRINT%KINETIC_ENERGY")
379 CALL qs_scf_post_charges(input, logger, qs_env)
392 IF (loc_print_explicit)
THEN
412 IF (loc_explicit)
THEN
422 p_loc_mixed = .false.
426 IF (n_rep == 0 .AND. p_loc_lumo)
THEN
427 CALL cp_abort(__location__,
"No LIST_UNOCCUPIED was specified, "// &
428 "therefore localization of unoccupied states will be skipped!")
441 IF (loc_print_explicit)
THEN
445 do_wannier_cubes = .false.
451 IF (((do_mo_cubes .OR. do_wannier_cubes) .AND. (nlumo /= 0 .OR. nhomo /= 0)) .OR. p_loc)
THEN
452 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
454 CALL auxbas_pw_pool%create_pw(wf_r)
455 CALL auxbas_pw_pool%create_pw(wf_g)
458 IF (dft_control%restricted)
THEN
462 nspins = dft_control%nspins
465 IF (dft_control%restricted .AND. (do_mo_cubes .OR. p_loc_homo))
THEN
466 CALL cp_abort(__location__,
"Unclear how we define MOs / localization in the restricted case ... ")
471 cpwarn_if(do_mo_cubes,
"Print MO cubes not implemented for k-point calculations")
476 IF ((do_mo_cubes .AND. nhomo /= 0) .OR. do_stm)
THEN
478 IF (dft_control%do_admm)
THEN
480 CALL make_mo_eig(mos, nspins, ks_rmpv, scf_control, mo_derivs, admm_env=admm_env)
482 IF (dft_control%hairy_probes)
THEN
483 scf_control%smear%do_smear = .false.
484 CALL make_mo_eig(mos, dft_control%nspins, ks_rmpv, scf_control, mo_derivs, &
486 probe=dft_control%probe)
488 CALL make_mo_eig(mos, dft_control%nspins, ks_rmpv, scf_control, mo_derivs)
491 DO ispin = 1, dft_control%nspins
492 CALL get_mo_set(mo_set=mos(ispin), eigenvalues=mo_eigenvalues, homo=homo)
493 homo_lumo(ispin, 1) = mo_eigenvalues(homo)
497 IF (do_mo_cubes .AND. nhomo /= 0)
THEN
500 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, &
501 eigenvalues=mo_eigenvalues, homo=homo, nmo=nmo)
502 CALL qs_scf_post_occ_cubes(input, dft_section, dft_control, logger, qs_env, &
503 mo_coeff, wf_g, wf_r, particles, homo, ispin)
514 cpwarn(
"Localization not implemented for k-point calculations!")
515 ELSEIF (dft_control%restricted &
518 cpabort(
"ROKS works only with LOCALIZE METHOD NONE or JACOBI")
520 ALLOCATE (occupied_orbs(dft_control%nspins))
521 ALLOCATE (occupied_evals(dft_control%nspins))
522 ALLOCATE (homo_localized(dft_control%nspins))
523 DO ispin = 1, dft_control%nspins
524 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, &
525 eigenvalues=mo_eigenvalues)
526 occupied_orbs(ispin) = mo_coeff
527 occupied_evals(ispin)%array => mo_eigenvalues
528 CALL cp_fm_create(homo_localized(ispin), occupied_orbs(ispin)%matrix_struct)
529 CALL cp_fm_to_fm(occupied_orbs(ispin), homo_localized(ispin))
532 CALL get_qs_env(qs_env, mo_loc_history=mo_loc_history)
535 ALLOCATE (qs_loc_env_homo)
538 CALL qs_loc_init(qs_env, qs_loc_env_homo, localize_section, homo_localized, do_homo, &
539 do_mo_cubes, mo_loc_history=mo_loc_history)
541 wf_r, wf_g, particles, occupied_orbs, occupied_evals, marked_states)
544 IF (qs_loc_env_homo%localized_wfn_control%use_history)
THEN
546 CALL set_qs_env(qs_env, mo_loc_history=mo_loc_history)
551 homo_localized, do_homo)
553 DEALLOCATE (occupied_orbs)
554 DEALLOCATE (occupied_evals)
556 IF (qs_loc_env_homo%do_localize)
THEN
557 CALL loc_dipole(input, dft_control, qs_loc_env_homo, logger, qs_env)
564 IF (do_mo_cubes .OR. p_loc_lumo)
THEN
566 cpwarn(
"Localization and MO related output not implemented for k-point calculations!")
569 compute_lumos = do_mo_cubes .AND. nlumo /= 0
570 compute_lumos = compute_lumos .OR. p_loc_lumo
572 DO ispin = 1, dft_control%nspins
573 CALL get_mo_set(mo_set=mos(ispin), homo=homo, nmo=nmo)
574 compute_lumos = compute_lumos .AND. homo == nmo
577 IF (do_mo_cubes .AND. .NOT. compute_lumos)
THEN
580 DO ispin = 1, dft_control%nspins
582 CALL get_mo_set(mo_set=mos(ispin), homo=homo, nmo=nmo, eigenvalues=mo_eigenvalues)
583 IF (nlumo > nmo - homo)
THEN
586 IF (nlumo == -1)
THEN
589 IF (output_unit > 0)
WRITE (output_unit, *)
" "
590 IF (output_unit > 0)
WRITE (output_unit, *)
" Lowest eigenvalues of the unoccupied subspace spin ", ispin
591 IF (output_unit > 0)
WRITE (output_unit, *)
"---------------------------------------------"
592 IF (output_unit > 0)
WRITE (output_unit,
'(4(1X,1F16.8))') mo_eigenvalues(homo + 1:homo + nlumo)
595 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
596 CALL qs_scf_post_unocc_cubes(input, dft_section, dft_control, logger, qs_env, &
597 mo_coeff, wf_g, wf_r, particles, nlumo, homo, ispin, lumo=homo + 1)
603 IF (compute_lumos)
THEN
606 IF (nlumo == 0) check_write = .false.
609 ALLOCATE (qs_loc_env_lumo)
612 min_lumos = max(maxval(qs_loc_env_lumo%localized_wfn_control%loc_states(:, :)), nlumo)
615 ALLOCATE (unoccupied_orbs(dft_control%nspins))
616 ALLOCATE (unoccupied_evals(dft_control%nspins))
617 CALL make_lumo_gpw(qs_env, scf_env, unoccupied_orbs, unoccupied_evals, min_lumos, nlumos)
618 lumo_ptr => unoccupied_orbs
619 DO ispin = 1, dft_control%nspins
621 homo_lumo(ispin, 2) = unoccupied_evals(ispin)%array(1)
623 IF (check_write)
THEN
624 IF (p_loc_lumo .AND. nlumo /= -1) nlumos = min(nlumo, nlumos)
626 CALL qs_scf_post_unocc_cubes(input, dft_section, dft_control, logger, qs_env, &
627 unoccupied_orbs(ispin), wf_g, wf_r, particles, nlumos, homo, ispin)
632 ALLOCATE (lumo_localized(dft_control%nspins))
633 DO ispin = 1, dft_control%nspins
634 CALL cp_fm_create(lumo_localized(ispin), unoccupied_orbs(ispin)%matrix_struct)
635 CALL cp_fm_to_fm(unoccupied_orbs(ispin), lumo_localized(ispin))
637 CALL qs_loc_init(qs_env, qs_loc_env_lumo, localize_section, lumo_localized, do_homo, do_mo_cubes, &
638 evals=unoccupied_evals)
639 CALL qs_loc_env_init(qs_loc_env_lumo, qs_loc_env_lumo%localized_wfn_control, qs_env, &
640 loc_coeff=unoccupied_orbs)
642 lumo_localized, wf_r, wf_g, particles, &
643 unoccupied_orbs, unoccupied_evals, marked_states)
644 CALL loc_write_restart(qs_loc_env_lumo, loc_print_section, mos, homo_localized, do_homo, &
645 evals=unoccupied_evals)
646 lumo_ptr => lumo_localized
650 IF (has_homo .AND. has_lumo)
THEN
651 IF (output_unit > 0)
WRITE (output_unit, *)
" "
652 DO ispin = 1, dft_control%nspins
653 IF (.NOT. scf_control%smear%do_smear)
THEN
654 gap = homo_lumo(ispin, 2) - homo_lumo(ispin, 1)
655 IF (output_unit > 0)
WRITE (output_unit,
'(T2,A,F12.6)') &
656 "HOMO - LUMO gap [eV] :", gap*
evolt
662 IF (p_loc_mixed)
THEN
664 cpwarn(
"Localization not implemented for k-point calculations!")
665 ELSEIF (dft_control%restricted)
THEN
666 IF (output_unit > 0)
WRITE (output_unit, *) &
667 " Unclear how we define MOs / localization in the restricted case... skipping"
670 ALLOCATE (mixed_orbs(dft_control%nspins))
671 ALLOCATE (mixed_evals(dft_control%nspins))
672 ALLOCATE (mixed_localized(dft_control%nspins))
673 DO ispin = 1, dft_control%nspins
674 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, &
675 eigenvalues=mo_eigenvalues)
676 mixed_orbs(ispin) = mo_coeff
677 mixed_evals(ispin)%array => mo_eigenvalues
678 CALL cp_fm_create(mixed_localized(ispin), mixed_orbs(ispin)%matrix_struct)
679 CALL cp_fm_to_fm(mixed_orbs(ispin), mixed_localized(ispin))
682 CALL get_qs_env(qs_env, mo_loc_history=mo_loc_history)
685 total_zeff_corr = scf_env%sum_zeff_corr
686 ALLOCATE (qs_loc_env_mixed)
689 CALL qs_loc_init(qs_env, qs_loc_env_mixed, localize_section, mixed_localized, do_homo, &
690 do_mo_cubes, mo_loc_history=mo_loc_history, tot_zeff_corr=total_zeff_corr, &
693 DO ispin = 1, dft_control%nspins
694 CALL cp_fm_get_info(mixed_localized(ispin), ncol_global=nchk_nmoloc)
698 wf_r, wf_g, particles, mixed_orbs, mixed_evals, marked_states)
701 IF (qs_loc_env_mixed%localized_wfn_control%use_history)
THEN
703 CALL set_qs_env(qs_env, mo_loc_history=mo_loc_history)
710 DEALLOCATE (mixed_orbs)
711 DEALLOCATE (mixed_evals)
721 IF (((do_mo_cubes .OR. do_wannier_cubes) .AND. (nlumo /= 0 .OR. nhomo /= 0)) .OR. p_loc)
THEN
722 CALL auxbas_pw_pool%give_back_pw(wf_r)
723 CALL auxbas_pw_pool%give_back_pw(wf_g)
727 IF (.NOT. do_kpoints)
THEN
730 DEALLOCATE (qs_loc_env_homo)
734 DEALLOCATE (qs_loc_env_lumo)
736 IF (p_loc_mixed)
THEN
738 DEALLOCATE (qs_loc_env_mixed)
746 CALL get_qs_env(qs_env, matrix_s=matrix_s, para_env=para_env)
747 CALL wfn_mix(mos, particle_set, dft_section, qs_kind_set, para_env, &
748 output_unit, unoccupied_orbs=lumo_ptr, scf_env=scf_env, &
749 matrix_s=matrix_s, marked_states=marked_states)
753 IF (
ASSOCIATED(marked_states))
THEN
754 DEALLOCATE (marked_states)
758 IF (.NOT. do_kpoints)
THEN
759 IF (compute_lumos)
THEN
760 DO ispin = 1, dft_control%nspins
761 DEALLOCATE (unoccupied_evals(ispin)%array)
764 DEALLOCATE (unoccupied_evals)
765 DEALLOCATE (unoccupied_orbs)
772 cpwarn(
"STM not implemented for k-point calculations!")
774 NULLIFY (unoccupied_orbs_stm, unoccupied_evals_stm)
775 IF (nlumo_stm > 0)
THEN
776 ALLOCATE (unoccupied_orbs_stm(dft_control%nspins))
777 ALLOCATE (unoccupied_evals_stm(dft_control%nspins))
778 CALL make_lumo_gpw(qs_env, scf_env, unoccupied_orbs_stm, unoccupied_evals_stm, &
782 CALL th_stm_image(qs_env, stm_section, particles, unoccupied_orbs_stm, &
783 unoccupied_evals_stm)
785 IF (nlumo_stm > 0)
THEN
786 DO ispin = 1, dft_control%nspins
787 DEALLOCATE (unoccupied_evals_stm(ispin)%array)
789 DEALLOCATE (unoccupied_evals_stm)
796 CALL qs_scf_post_xray(input, dft_section, logger, qs_env, output_unit)
799 CALL qs_scf_post_efg(input, logger, qs_env)
802 CALL qs_scf_post_et(input, qs_env, dft_control)
805 CALL qs_scf_post_epr(input, logger, qs_env)
808 CALL qs_scf_post_molopt(input, logger, qs_env)
811 CALL qs_scf_post_elf(input, logger, qs_env)
818 DO ispin = 1, dft_control%nspins
819 CALL dbcsr_add(rho_ao(ispin, 1)%matrix, matrix_p_mp2(ispin)%matrix, 1.0_dp, -1.0_dp)
825 CALL timestop(handle)
838 SUBROUTINE make_lumo_gpw(qs_env, scf_env, unoccupied_orbs, unoccupied_evals, nlumo, nlumos)
842 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(INOUT) :: unoccupied_orbs
844 INTEGER,
INTENT(IN) :: nlumo
845 INTEGER,
INTENT(OUT) :: nlumos
847 CHARACTER(len=*),
PARAMETER :: routinen =
'make_lumo_gpw'
849 INTEGER :: handle, homo, ispin, n, nao, nmo, &
856 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: ks_rmpv, matrix_s
863 CALL timeset(routinen, handle)
865 NULLIFY (mos, ks_rmpv, scf_control, dft_control, admm_env, para_env, blacs_env)
869 scf_control=scf_control, &
870 dft_control=dft_control, &
879 DO ispin = 1, dft_control%nspins
880 NULLIFY (unoccupied_evals(ispin)%array)
882 IF (output_unit > 0)
WRITE (output_unit, *)
" "
883 IF (output_unit > 0)
WRITE (output_unit, *)
" Lowest Eigenvalues of the unoccupied subspace spin ", ispin
884 IF (output_unit > 0)
WRITE (output_unit, fmt=
'(1X,A)')
"-----------------------------------------------------"
885 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, homo=homo, nao=nao, nmo=nmo)
887 nlumos = max(1, min(nlumo, nao - nmo))
888 IF (nlumo == -1) nlumos = nao - nmo
889 ALLOCATE (unoccupied_evals(ispin)%array(nlumos))
891 nrow_global=n, ncol_global=nlumos)
892 CALL cp_fm_create(unoccupied_orbs(ispin), fm_struct_tmp, name=
"lumos")
897 NULLIFY (local_preconditioner)
898 IF (
ASSOCIATED(scf_env%ot_preconditioner))
THEN
899 local_preconditioner => scf_env%ot_preconditioner(1)%preconditioner
902 NULLIFY (local_preconditioner)
907 IF (dft_control%do_admm)
THEN
911 CALL ot_eigensolver(matrix_h=ks_rmpv(ispin)%matrix, matrix_s=matrix_s(1)%matrix, &
912 matrix_c_fm=unoccupied_orbs(ispin), &
913 matrix_orthogonal_space_fm=mo_coeff, &
914 eps_gradient=scf_control%eps_lumos, &
916 iter_max=scf_control%max_iter_lumos, &
917 size_ortho_space=nmo)
920 unoccupied_evals(ispin)%array, scr=output_unit, &
921 ionode=output_unit > 0)
924 IF (dft_control%do_admm)
THEN
930 CALL timestop(handle)
939 SUBROUTINE qs_scf_post_charges(input, logger, qs_env)
944 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_charges'
946 INTEGER :: handle, print_level, unit_nr
947 LOGICAL :: do_kpoints, print_it
950 CALL timeset(routinen, handle)
952 CALL get_qs_env(qs_env=qs_env, do_kpoints=do_kpoints)
960 log_filename=.false.)
963 IF (print_it) print_level = 2
965 IF (print_it) print_level = 3
967 cpwarn(
"Lowdin charges not implemented for k-point calculations!")
980 unit_nr =
cp_print_key_unit_nr(logger, input,
"PROPERTIES%FIT_CHARGE", extension=
".Fitcharge", &
981 log_filename=.false.)
983 CALL get_ddapc(qs_env, .false., density_fit_section, iwc=unit_nr)
987 CALL timestop(handle)
989 END SUBROUTINE qs_scf_post_charges
1005 SUBROUTINE qs_scf_post_occ_cubes(input, dft_section, dft_control, logger, qs_env, &
1006 mo_coeff, wf_g, wf_r, particles, homo, ispin)
1015 INTEGER,
INTENT(IN) :: homo, ispin
1017 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_occ_cubes'
1019 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube, title
1020 INTEGER :: handle, i, ir, ivector, n_rep, nhomo, &
1022 INTEGER,
DIMENSION(:),
POINTER ::
list, list_index
1023 LOGICAL :: append_cube, mpi_io
1028 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1030 CALL timeset(routinen, handle)
1032 NULLIFY (list_index)
1038 my_pos_cube =
"REWIND"
1039 IF (append_cube)
THEN
1040 my_pos_cube =
"APPEND"
1049 IF (
ASSOCIATED(
list))
THEN
1051 DO i = 1,
SIZE(
list)
1052 list_index(i + nlist) =
list(i)
1054 nlist = nlist +
SIZE(
list)
1059 IF (nhomo == -1) nhomo = homo
1060 nlist = homo - max(1, homo - nhomo + 1) + 1
1061 ALLOCATE (list_index(nlist))
1063 list_index(i) = max(1, homo - nhomo + 1) + i - 1
1067 ivector = list_index(i)
1069 atomic_kind_set=atomic_kind_set, &
1070 qs_kind_set=qs_kind_set, &
1072 particle_set=particle_set, &
1075 cell, dft_control, particle_set, pw_env)
1076 WRITE (filename,
'(a4,I5.5,a1,I1.1)')
"WFN_", ivector,
"_", ispin
1079 middle_name=trim(filename), file_position=my_pos_cube, log_filename=.false., &
1081 WRITE (title, *)
"WAVEFUNCTION ", ivector,
" spin ", ispin,
" i.e. HOMO - ", ivector - homo
1082 CALL cp_pw_to_cube(wf_r, unit_nr, title, particles=particles, &
1084 max_file_size_mb=
section_get_rval(dft_section,
"PRINT%MO_CUBES%MAX_FILE_SIZE_MB"), &
1088 IF (
ASSOCIATED(list_index))
DEALLOCATE (list_index)
1091 CALL timestop(handle)
1093 END SUBROUTINE qs_scf_post_occ_cubes
1111 SUBROUTINE qs_scf_post_unocc_cubes(input, dft_section, dft_control, logger, qs_env, &
1112 unoccupied_orbs, wf_g, wf_r, particles, nlumos, homo, ispin, lumo)
1118 TYPE(
cp_fm_type),
INTENT(IN) :: unoccupied_orbs
1122 INTEGER,
INTENT(IN) :: nlumos, homo, ispin
1123 INTEGER,
INTENT(IN),
OPTIONAL :: lumo
1125 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_unocc_cubes'
1127 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube, title
1128 INTEGER :: handle, ifirst, index_mo, ivector, &
1130 LOGICAL :: append_cube, mpi_io
1135 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1137 CALL timeset(routinen, handle)
1141 NULLIFY (qs_kind_set, particle_set, pw_env, cell)
1143 my_pos_cube =
"REWIND"
1144 IF (append_cube)
THEN
1145 my_pos_cube =
"APPEND"
1148 IF (
PRESENT(lumo)) ifirst = lumo
1149 DO ivector = ifirst, ifirst + nlumos - 1
1151 atomic_kind_set=atomic_kind_set, &
1152 qs_kind_set=qs_kind_set, &
1154 particle_set=particle_set, &
1157 qs_kind_set, cell, dft_control, particle_set, pw_env)
1159 IF (ifirst == 1)
THEN
1160 index_mo = homo + ivector
1164 WRITE (filename,
'(a4,I5.5,a1,I1.1)')
"WFN_", index_mo,
"_", ispin
1168 middle_name=trim(filename), file_position=my_pos_cube, log_filename=.false., &
1170 WRITE (title, *)
"WAVEFUNCTION ", index_mo,
" spin ", ispin,
" i.e. LUMO + ", ifirst + ivector - 2
1171 CALL cp_pw_to_cube(wf_r, unit_nr, title, particles=particles, &
1173 max_file_size_mb=
section_get_rval(dft_section,
"PRINT%MO_CUBES%MAX_FILE_SIZE_MB"), &
1179 CALL timestop(handle)
1181 END SUBROUTINE qs_scf_post_unocc_cubes
1194 INTEGER,
INTENT(IN) :: output_unit
1196 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_moments'
1198 CHARACTER(LEN=default_path_length) :: filename
1199 INTEGER :: handle, maxmom, reference, unit_nr
1200 LOGICAL :: com_nl, do_kpoints, magnetic, periodic, &
1201 second_ref_point, vel_reprs
1202 REAL(kind=
dp),
DIMENSION(:),
POINTER :: ref_point
1205 CALL timeset(routinen, handle)
1208 subsection_name=
"DFT%PRINT%MOMENTS")
1213 keyword_name=
"DFT%PRINT%MOMENTS%MAX_MOMENT")
1215 keyword_name=
"DFT%PRINT%MOMENTS%PERIODIC")
1217 keyword_name=
"DFT%PRINT%MOMENTS%REFERENCE")
1219 keyword_name=
"DFT%PRINT%MOMENTS%MAGNETIC")
1221 keyword_name=
"DFT%PRINT%MOMENTS%VEL_REPRS")
1223 keyword_name=
"DFT%PRINT%MOMENTS%COM_NL")
1225 keyword_name=
"DFT%PRINT%MOMENTS%SECOND_REFERENCE_POINT")
1230 print_key_path=
"DFT%PRINT%MOMENTS", extension=
".dat", &
1231 middle_name=
"moments", log_filename=.false.)
1233 IF (output_unit > 0)
THEN
1234 IF (unit_nr /= output_unit)
THEN
1235 INQUIRE (unit=unit_nr, name=filename)
1236 WRITE (unit=output_unit, fmt=
"(/,T2,A,2(/,T3,A),/)") &
1237 "MOMENTS",
"The electric/magnetic moments are written to file:", &
1240 WRITE (unit=output_unit, fmt=
"(/,T2,A)")
"ELECTRIC/MAGNETIC MOMENTS"
1244 CALL get_qs_env(qs_env, do_kpoints=do_kpoints)
1246 IF (do_kpoints)
THEN
1252 CALL qs_moment_locop(qs_env, magnetic, maxmom, reference, ref_point, unit_nr, vel_reprs, com_nl)
1257 basis_section=input, print_key_path=
"DFT%PRINT%MOMENTS")
1259 IF (second_ref_point)
THEN
1261 keyword_name=
"DFT%PRINT%MOMENTS%REFERENCE_2")
1266 print_key_path=
"DFT%PRINT%MOMENTS", extension=
".dat", &
1267 middle_name=
"moments_refpoint_2", log_filename=.false.)
1269 IF (output_unit > 0)
THEN
1270 IF (unit_nr /= output_unit)
THEN
1271 INQUIRE (unit=unit_nr, name=filename)
1272 WRITE (unit=output_unit, fmt=
"(/,T2,A,2(/,T3,A),/)") &
1273 "MOMENTS",
"The electric/magnetic moments for the second reference point are written to file:", &
1276 WRITE (unit=output_unit, fmt=
"(/,T2,A)")
"ELECTRIC/MAGNETIC MOMENTS"
1279 IF (do_kpoints)
THEN
1285 CALL qs_moment_locop(qs_env, magnetic, maxmom, reference, ref_point, unit_nr, vel_reprs, com_nl)
1289 basis_section=input, print_key_path=
"DFT%PRINT%MOMENTS")
1294 CALL timestop(handle)
1306 SUBROUTINE qs_scf_post_xray(input, dft_section, logger, qs_env, output_unit)
1311 INTEGER,
INTENT(IN) :: output_unit
1313 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_scf_post_xray'
1315 CHARACTER(LEN=default_path_length) :: filename
1316 INTEGER :: handle, unit_nr
1317 REAL(kind=
dp) :: q_max
1320 CALL timeset(routinen, handle)
1323 subsection_name=
"DFT%PRINT%XRAY_DIFFRACTION_SPECTRUM")
1327 keyword_name=
"PRINT%XRAY_DIFFRACTION_SPECTRUM%Q_MAX")
1329 basis_section=input, &
1330 print_key_path=
"DFT%PRINT%XRAY_DIFFRACTION_SPECTRUM", &
1332 middle_name=
"xrd", &
1333 log_filename=.false.)
1334 IF (output_unit > 0)
THEN
1335 INQUIRE (unit=unit_nr, name=filename)
1336 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)") &
1337 "X-RAY DIFFRACTION SPECTRUM"
1338 IF (unit_nr /= output_unit)
THEN
1339 WRITE (unit=output_unit, fmt=
"(/,T3,A,/,/,T3,A,/)") &
1340 "The coherent X-ray diffraction spectrum is written to the file:", &
1345 unit_number=unit_nr, &
1349 basis_section=input, &
1350 print_key_path=
"DFT%PRINT%XRAY_DIFFRACTION_SPECTRUM")
1353 CALL timestop(handle)
1355 END SUBROUTINE qs_scf_post_xray
1363 SUBROUTINE qs_scf_post_efg(input, logger, qs_env)
1368 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_efg'
1373 CALL timeset(routinen, handle)
1376 subsection_name=
"DFT%PRINT%ELECTRIC_FIELD_GRADIENT")
1382 CALL timestop(handle)
1384 END SUBROUTINE qs_scf_post_efg
1392 SUBROUTINE qs_scf_post_et(input, qs_env, dft_control)
1397 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_et'
1399 INTEGER :: handle, ispin
1401 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: my_mos
1404 CALL timeset(routinen, handle)
1410 IF (qs_env%et_coupling%first_run)
THEN
1412 ALLOCATE (my_mos(dft_control%nspins))
1413 ALLOCATE (qs_env%et_coupling%et_mo_coeff(dft_control%nspins))
1414 DO ispin = 1, dft_control%nspins
1416 matrix_struct=qs_env%mos(ispin)%mo_coeff%matrix_struct, &
1417 name=
"FIRST_RUN_COEFF"//trim(adjustl(
cp_to_string(ispin)))//
"MATRIX")
1426 CALL timestop(handle)
1428 END SUBROUTINE qs_scf_post_et
1439 SUBROUTINE qs_scf_post_elf(input, logger, qs_env)
1444 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_elf'
1446 CHARACTER(LEN=default_path_length) :: filename, mpi_filename, my_pos_cube, &
1448 INTEGER :: handle, ispin, output_unit, unit_nr
1449 LOGICAL :: append_cube, gapw, mpi_io
1450 REAL(
dp) :: rho_cutoff
1460 CALL timeset(routinen, handle)
1467 NULLIFY (dft_control, pw_env, auxbas_pw_pool, pw_pools, particles, subsys)
1468 CALL get_qs_env(qs_env, dft_control=dft_control, pw_env=pw_env, subsys=subsys)
1471 gapw = dft_control%qs_control%gapw
1472 IF (.NOT. gapw)
THEN
1474 ALLOCATE (elf_r(dft_control%nspins))
1475 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
1477 DO ispin = 1, dft_control%nspins
1478 CALL auxbas_pw_pool%create_pw(elf_r(ispin))
1482 IF (output_unit > 0)
THEN
1483 WRITE (unit=output_unit, fmt=
"(/,T15,A,/)") &
1484 " ----- ELF is computed on the real space grid -----"
1491 my_pos_cube =
"REWIND"
1492 IF (append_cube)
THEN
1493 my_pos_cube =
"APPEND"
1496 DO ispin = 1, dft_control%nspins
1497 WRITE (filename,
'(a5,I1.1)')
"ELF_S", ispin
1498 WRITE (title, *)
"ELF spin ", ispin
1501 middle_name=trim(filename), file_position=my_pos_cube, log_filename=.false., &
1502 mpi_io=mpi_io, fout=mpi_filename)
1503 IF (output_unit > 0)
THEN
1504 IF (.NOT. mpi_io)
THEN
1505 INQUIRE (unit=unit_nr, name=filename)
1507 filename = mpi_filename
1509 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
1510 "ELF is written in cube file format to the file:", &
1514 CALL cp_pw_to_cube(elf_r(ispin), unit_nr, title, particles=particles, &
1518 CALL auxbas_pw_pool%give_back_pw(elf_r(ispin))
1526 cpwarn(
"ELF not implemented for GAPW calculations!")
1531 CALL timestop(handle)
1533 END SUBROUTINE qs_scf_post_elf
1545 SUBROUTINE qs_scf_post_molopt(input, logger, qs_env)
1550 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_molopt'
1552 INTEGER :: handle, nao, unit_nr
1553 REAL(kind=
dp) :: s_cond_number
1554 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues
1563 CALL timeset(routinen, handle)
1566 subsection_name=
"DFT%PRINT%BASIS_MOLOPT_QUANTITIES")
1570 CALL get_qs_env(qs_env, energy=energy, matrix_s=matrix_s, mos=mos)
1573 CALL get_mo_set(mo_set=mos(1), mo_coeff=mo_coeff, nao=nao)
1575 nrow_global=nao, ncol_global=nao, &
1576 template_fmstruct=mo_coeff%matrix_struct)
1577 CALL cp_fm_create(fm_s, matrix_struct=ao_ao_fmstruct, &
1579 CALL cp_fm_create(fm_work, matrix_struct=ao_ao_fmstruct, &
1582 ALLOCATE (eigenvalues(nao))
1590 s_cond_number = maxval(abs(eigenvalues))/max(minval(abs(eigenvalues)), epsilon(0.0_dp))
1593 extension=
".molopt")
1595 IF (unit_nr > 0)
THEN
1598 WRITE (unit_nr,
'(T2,A28,2A25)')
"",
"Tot. Ener.",
"S Cond. Numb."
1599 WRITE (unit_nr,
'(T2,A28,2E25.17)')
"BASIS_MOLOPT_QUANTITIES", energy%total, s_cond_number
1603 "DFT%PRINT%BASIS_MOLOPT_QUANTITIES")
1607 CALL timestop(handle)
1609 END SUBROUTINE qs_scf_post_molopt
1617 SUBROUTINE qs_scf_post_epr(input, logger, qs_env)
1622 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_epr'
1627 CALL timeset(routinen, handle)
1630 subsection_name=
"DFT%PRINT%HYPERFINE_COUPLING_TENSOR")
1636 CALL timestop(handle)
1638 END SUBROUTINE qs_scf_post_epr
1647 SUBROUTINE write_available_results(qs_env, scf_env)
1651 CHARACTER(len=*),
PARAMETER :: routinen =
'write_available_results'
1655 CALL timeset(routinen, handle)
1663 CALL timestop(handle)
1665 END SUBROUTINE write_available_results
1678 CHARACTER(len=*),
PARAMETER :: routinen =
'write_mo_dependent_results'
1680 INTEGER :: handle, homo, ispin, nmo, output_unit
1681 LOGICAL :: all_equal, do_kpoints, explicit
1682 REAL(kind=
dp) :: maxocc, s_square, s_square_ideal, &
1683 total_abs_spin_dens, total_spin_dens
1684 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues, occupation_numbers
1690 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: ks_rmpv, matrix_s
1703 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1712 CALL timeset(routinen, handle)
1714 NULLIFY (cell, dft_control, pw_env, auxbas_pw_pool, pw_pools, mo_coeff, &
1715 mo_coeff_deriv, mo_eigenvalues, mos, atomic_kind_set, qs_kind_set, &
1716 particle_set, rho, ks_rmpv, matrix_s, scf_control, dft_section, &
1717 molecule_set, input, particles, subsys, rho_r)
1722 cpassert(
ASSOCIATED(qs_env))
1724 dft_control=dft_control, &
1725 molecule_set=molecule_set, &
1726 atomic_kind_set=atomic_kind_set, &
1727 particle_set=particle_set, &
1728 qs_kind_set=qs_kind_set, &
1729 admm_env=admm_env, &
1730 scf_control=scf_control, &
1739 CALL get_qs_env(qs_env, do_kpoints=do_kpoints)
1743 IF (.NOT. qs_env%run_rtp)
THEN
1750 IF (.NOT. do_kpoints)
THEN
1751 CALL get_qs_env(qs_env, mos=mos, matrix_ks=ks_rmpv)
1757 dft_section,
"PRINT%CHARGEMOL"), &
1766 IF (do_kpoints)
THEN
1777 IF (do_kpoints)
THEN
1778 cpwarn(
"Projected density of states (pDOS) is not implemented for k points")
1783 DO ispin = 1, dft_control%nspins
1785 IF (dft_control%do_admm)
THEN
1788 IF (
PRESENT(scf_env))
THEN
1790 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, &
1791 eigenvalues=mo_eigenvalues)
1792 IF (
ASSOCIATED(qs_env%mo_derivs))
THEN
1793 mo_coeff_deriv => qs_env%mo_derivs(ispin)%matrix
1795 mo_coeff_deriv => null()
1798 do_rotation=.true., &
1799 co_rotate_dbcsr=mo_coeff_deriv)
1803 IF (dft_control%nspins == 2)
THEN
1805 qs_kind_set, particle_set, qs_env, dft_section, ispin=ispin)
1808 qs_kind_set, particle_set, qs_env, dft_section)
1811 IF (dft_control%do_admm)
THEN
1820 IF (dft_control%nspins == 2)
THEN
1822 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
1823 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
1825 CALL auxbas_pw_pool%create_pw(wf_r)
1827 CALL pw_axpy(rho_r(2), wf_r, alpha=-1._dp)
1829 IF (output_unit > 0)
WRITE (unit=output_unit, fmt=
'(/,(T3,A,T61,F20.10))') &
1830 "Integrated spin density: ", total_spin_dens
1832 IF (output_unit > 0)
WRITE (unit=output_unit, fmt=
'((T3,A,T61,F20.10))') &
1833 "Integrated absolute spin density: ", total_abs_spin_dens
1834 CALL auxbas_pw_pool%give_back_pw(wf_r)
1840 IF (do_kpoints)
THEN
1841 cpwarn(
"Spin contamination estimate not implemented for k-points.")
1844 DO ispin = 1, dft_control%nspins
1846 occupation_numbers=occupation_numbers, &
1851 all_equal = all_equal .AND. &
1852 (all(occupation_numbers(1:homo) == maxocc) .AND. &
1853 all(occupation_numbers(homo + 1:nmo) == 0.0_dp))
1856 IF (.NOT. all_equal)
THEN
1857 IF (output_unit > 0)
WRITE (unit=output_unit, fmt=
"(T3,A)") &
1858 "WARNING: S**2 computation does not yet treat fractional occupied orbitals"
1861 matrix_s=matrix_s, &
1864 s_square_ideal=s_square_ideal)
1865 IF (output_unit > 0)
WRITE (unit=output_unit, fmt=
'(T3,A,T51,2F15.6)') &
1866 "Ideal and single determinant S**2 : ", s_square_ideal, s_square
1867 energy%s_square = s_square
1872 CALL timestop(handle)
1884 CHARACTER(len=*),
PARAMETER :: routinen =
'write_mo_free_results'
1885 CHARACTER(len=1),
DIMENSION(3),
PARAMETER :: cdir = [
"x",
"y",
"z"]
1887 CHARACTER(LEN=2) :: element_symbol
1888 CHARACTER(LEN=default_path_length) :: filename, mpi_filename, my_pos_cube, &
1890 CHARACTER(LEN=default_string_length) :: name, print_density
1891 INTEGER :: after, handle, i, iat, iatom, id, ikind, img, iso, ispin, iw, l, n_rep_hf, nat, &
1892 natom, nd(3), ngto, niso, nkind, np, nr, output_unit, print_level, should_print_bqb, &
1893 should_print_voro, unit_nr, unit_nr_voro
1894 LOGICAL :: append_cube, append_voro, do_hfx, do_kpoints, mpi_io, omit_headers, print_it, &
1895 rho_r_valid, voro_print_txt, write_ks, write_xc, xrd_interface
1897 rho_total, rho_total_rspace, udvol, &
1899 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: zcharge
1900 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: bfun
1901 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: aedens, ccdens, ppdens
1902 REAL(kind=
dp),
DIMENSION(3) :: dr
1903 REAL(kind=
dp),
DIMENSION(:),
POINTER :: my_q0
1909 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: ks_rmpv, matrix_vxc, rho_ao
1917 TYPE(
pw_c1d_gs_type),
POINTER :: rho0_s_gs, rho_core, rhoz_cneo_s_gs
1924 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1932 print_key, print_key_bqb, &
1933 print_key_voro, xc_section
1935 CALL timeset(routinen, handle)
1936 NULLIFY (cell, dft_control, pw_env, auxbas_pw_pool, pw_pools, hfx_section, &
1937 atomic_kind_set, qs_kind_set, particle_set, rho, ks_rmpv, rho_ao, rho_r, &
1938 dft_section, xc_section, input, particles, subsys, matrix_vxc, v_hartree_rspace, &
1944 cpassert(
ASSOCIATED(qs_env))
1946 atomic_kind_set=atomic_kind_set, &
1947 qs_kind_set=qs_kind_set, &
1948 particle_set=particle_set, &
1950 para_env=para_env, &
1951 dft_control=dft_control, &
1953 do_kpoints=do_kpoints, &
1961 CALL get_qs_env(qs_env, nkind=nkind, natom=natom)
1962 ALLOCATE (zcharge(natom))
1967 iat = atomic_kind_set(ikind)%atom_list(iatom)
1974 "DFT%PRINT%TOT_DENSITY_CUBE"),
cp_p_file))
THEN
1975 NULLIFY (rho_core, rho0_s_gs, rhoz_cneo_s_gs)
1977 my_pos_cube =
"REWIND"
1978 IF (append_cube)
THEN
1979 my_pos_cube =
"APPEND"
1982 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, rho_core=rho_core, &
1983 rho0_s_gs=rho0_s_gs, rhoz_cneo_s_gs=rhoz_cneo_s_gs)
1984 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
1986 CALL auxbas_pw_pool%create_pw(wf_r)
1987 IF (dft_control%qs_control%gapw)
THEN
1988 IF (dft_control%qs_control%gapw_control%nopaw_as_gpw)
THEN
1989 CALL pw_axpy(rho_core, rho0_s_gs)
1990 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
1991 CALL pw_axpy(rhoz_cneo_s_gs, rho0_s_gs)
1994 CALL pw_axpy(rho_core, rho0_s_gs, -1.0_dp)
1995 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
1996 CALL pw_axpy(rhoz_cneo_s_gs, rho0_s_gs, -1.0_dp)
1999 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
2000 CALL pw_axpy(rhoz_cneo_s_gs, rho0_s_gs)
2003 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
2004 CALL pw_axpy(rhoz_cneo_s_gs, rho0_s_gs, -1.0_dp)
2010 DO ispin = 1, dft_control%nspins
2011 CALL pw_axpy(rho_r(ispin), wf_r)
2013 filename =
"TOTAL_DENSITY"
2016 extension=
".cube", middle_name=trim(filename), file_position=my_pos_cube, &
2017 log_filename=.false., mpi_io=mpi_io)
2019 particles=particles, zeff=zcharge, &
2020 stride=
section_get_ivals(dft_section,
"PRINT%TOT_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2022 "DFT%PRINT%TOT_DENSITY_CUBE", mpi_io=mpi_io)
2023 CALL auxbas_pw_pool%give_back_pw(wf_r)
2028 "DFT%PRINT%E_DENSITY_CUBE"),
cp_p_file))
THEN
2030 keyword_name=
"PRINT%E_DENSITY_CUBE%DENSITY_INCLUDE", &
2031 c_val=print_density)
2032 print_density = trim(print_density)
2034 my_pos_cube =
"REWIND"
2035 IF (append_cube)
THEN
2036 my_pos_cube =
"APPEND"
2040 xrd_interface =
section_get_lval(input,
"DFT%PRINT%E_DENSITY_CUBE%XRD_INTERFACE")
2041 IF (xrd_interface)
THEN
2043 IF (dft_control%qs_control%gapw) print_density =
"SOFT_DENSITY"
2045 filename =
"ELECTRON_DENSITY"
2047 extension=
".xrd", middle_name=trim(filename), &
2048 file_position=my_pos_cube, log_filename=.false.)
2050 IF (output_unit > 0)
THEN
2051 INQUIRE (unit=unit_nr, name=filename)
2052 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2053 "The electron density (atomic part) is written to the file:", &
2058 nkind =
SIZE(atomic_kind_set)
2059 IF (unit_nr > 0)
THEN
2060 WRITE (unit_nr, *)
"Atomic (core) densities"
2061 WRITE (unit_nr, *)
"Unit cell"
2062 WRITE (unit_nr, fmt=
"(3F20.12)") cell%hmat(1, 1), cell%hmat(1, 2), cell%hmat(1, 3)
2063 WRITE (unit_nr, fmt=
"(3F20.12)") cell%hmat(2, 1), cell%hmat(2, 2), cell%hmat(2, 3)
2064 WRITE (unit_nr, fmt=
"(3F20.12)") cell%hmat(3, 1), cell%hmat(3, 2), cell%hmat(3, 3)
2065 WRITE (unit_nr, *)
"Atomic types"
2066 WRITE (unit_nr, *) nkind
2069 ALLOCATE (ppdens(ngto, 2, nkind), aedens(ngto, 2, nkind), ccdens(ngto, 2, nkind))
2071 atomic_kind => atomic_kind_set(ikind)
2072 qs_kind => qs_kind_set(ikind)
2073 CALL get_atomic_kind(atomic_kind, name=name, element_symbol=element_symbol)
2075 iunit=output_unit, confine=.true.)
2077 iunit=output_unit, allelectron=.true., confine=.true.)
2078 ccdens(:, 1, ikind) = aedens(:, 1, ikind)
2079 ccdens(:, 2, ikind) = 0._dp
2080 CALL project_function_a(ccdens(1:ngto, 2, ikind), ccdens(1:ngto, 1, ikind), &
2081 ppdens(1:ngto, 2, ikind), ppdens(1:ngto, 1, ikind), 0)
2082 ccdens(:, 2, ikind) = aedens(:, 2, ikind) - ccdens(:, 2, ikind)
2083 IF (unit_nr > 0)
THEN
2084 WRITE (unit_nr, fmt=
"(I6,A10,A20)") ikind, trim(element_symbol), trim(name)
2085 WRITE (unit_nr, fmt=
"(I6)") ngto
2086 WRITE (unit_nr, *)
" Total density"
2087 WRITE (unit_nr, fmt=
"(2G24.12)") (aedens(i, 1, ikind), aedens(i, 2, ikind), i=1, ngto)
2088 WRITE (unit_nr, *)
" Core density"
2089 WRITE (unit_nr, fmt=
"(2G24.12)") (ccdens(i, 1, ikind), ccdens(i, 2, ikind), i=1, ngto)
2091 NULLIFY (atomic_kind)
2094 IF (dft_control%qs_control%gapw)
THEN
2095 CALL get_qs_env(qs_env=qs_env, rho_atom_set=rho_atom_set)
2097 IF (unit_nr > 0)
THEN
2098 WRITE (unit_nr, *)
"Coordinates and GAPW density"
2100 np = particles%n_els
2102 CALL get_atomic_kind(particles%els(iat)%atomic_kind, kind_number=ikind)
2103 CALL get_qs_kind(qs_kind_set(ikind), grid_atom=grid_atom)
2104 rho_atom => rho_atom_set(iat)
2105 IF (
ASSOCIATED(rho_atom%rho_rad_h(1)%r_coef))
THEN
2106 nr =
SIZE(rho_atom%rho_rad_h(1)%r_coef, 1)
2107 niso =
SIZE(rho_atom%rho_rad_h(1)%r_coef, 2)
2112 CALL para_env%sum(nr)
2113 CALL para_env%sum(niso)
2115 ALLOCATE (bfun(nr, niso))
2117 DO ispin = 1, dft_control%nspins
2118 IF (
ASSOCIATED(rho_atom%rho_rad_h(1)%r_coef))
THEN
2119 bfun(:, :) = bfun + rho_atom%rho_rad_h(ispin)%r_coef - rho_atom%rho_rad_s(ispin)%r_coef
2122 CALL para_env%sum(bfun)
2123 ccdens(:, 1, ikind) = ppdens(:, 1, ikind)
2124 ccdens(:, 2, ikind) = 0._dp
2125 IF (unit_nr > 0)
THEN
2126 WRITE (unit_nr,
'(I10,I5,3f12.6)') iat, ikind, particles%els(iat)%r
2130 CALL project_function_b(ccdens(:, 2, ikind), ccdens(:, 1, ikind), bfun(:, iso), grid_atom, l)
2131 IF (unit_nr > 0)
THEN
2132 WRITE (unit_nr, fmt=
"(3I6)") iso, l, ngto
2133 WRITE (unit_nr, fmt=
"(2G24.12)") (ccdens(i, 1, ikind), ccdens(i, 2, ikind), i=1, ngto)
2139 IF (unit_nr > 0)
THEN
2140 WRITE (unit_nr, *)
"Coordinates"
2141 np = particles%n_els
2143 CALL get_atomic_kind(particles%els(iat)%atomic_kind, kind_number=ikind)
2144 WRITE (unit_nr,
'(I10,I5,3f12.6)') iat, ikind, particles%els(iat)%r
2149 DEALLOCATE (ppdens, aedens, ccdens)
2152 "DFT%PRINT%E_DENSITY_CUBE")
2155 IF (dft_control%qs_control%gapw .AND. print_density ==
"TOTAL_DENSITY")
THEN
2157 cpassert(.NOT. do_kpoints)
2162 auxbas_pw_pool=auxbas_pw_pool, &
2164 CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace)
2166 CALL auxbas_pw_pool%create_pw(pw=rho_elec_gspace)
2171 q_max = sqrt(sum((
pi/dr(:))**2))
2173 auxbas_pw_pool=auxbas_pw_pool, &
2174 rhotot_elec_gspace=rho_elec_gspace, &
2176 rho_hard=rho_hard, &
2178 rho_total = rho_hard + rho_soft
2183 CALL pw_scale(rho_elec_gspace, 1.0_dp/volume)
2185 CALL pw_transfer(rho_elec_gspace, rho_elec_rspace)
2187 filename =
"TOTAL_ELECTRON_DENSITY"
2190 extension=
".cube", middle_name=trim(filename), &
2191 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2193 IF (output_unit > 0)
THEN
2194 IF (.NOT. mpi_io)
THEN
2195 INQUIRE (unit=unit_nr, name=filename)
2197 filename = mpi_filename
2199 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2200 "The total electron density is written in cube file format to the file:", &
2202 WRITE (unit=output_unit, fmt=
"(/,(T2,A,F20.10))") &
2203 "q(max) [1/Angstrom] :", q_max/
angstrom, &
2204 "Soft electronic charge (G-space) :", rho_soft, &
2205 "Hard electronic charge (G-space) :", rho_hard, &
2206 "Total electronic charge (G-space):", rho_total, &
2207 "Total electronic charge (R-space):", rho_total_rspace
2209 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"TOTAL ELECTRON DENSITY", &
2210 particles=particles, zeff=zcharge, &
2211 stride=
section_get_ivals(dft_section,
"PRINT%E_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2213 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2215 IF (dft_control%nspins > 1)
THEN
2219 auxbas_pw_pool=auxbas_pw_pool, &
2220 rhotot_elec_gspace=rho_elec_gspace, &
2222 rho_hard=rho_hard, &
2223 rho_soft=rho_soft, &
2225 rho_total = rho_hard + rho_soft
2229 CALL pw_scale(rho_elec_gspace, 1.0_dp/volume)
2231 CALL pw_transfer(rho_elec_gspace, rho_elec_rspace)
2233 filename =
"TOTAL_SPIN_DENSITY"
2236 extension=
".cube", middle_name=trim(filename), &
2237 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2239 IF (output_unit > 0)
THEN
2240 IF (.NOT. mpi_io)
THEN
2241 INQUIRE (unit=unit_nr, name=filename)
2243 filename = mpi_filename
2245 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2246 "The total spin density is written in cube file format to the file:", &
2248 WRITE (unit=output_unit, fmt=
"(/,(T2,A,F20.10))") &
2249 "q(max) [1/Angstrom] :", q_max/
angstrom, &
2250 "Soft part of the spin density (G-space):", rho_soft, &
2251 "Hard part of the spin density (G-space):", rho_hard, &
2252 "Total spin density (G-space) :", rho_total, &
2253 "Total spin density (R-space) :", rho_total_rspace
2255 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"TOTAL SPIN DENSITY", &
2256 particles=particles, zeff=zcharge, &
2257 stride=
section_get_ivals(dft_section,
"PRINT%E_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2259 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2261 CALL auxbas_pw_pool%give_back_pw(rho_elec_gspace)
2262 CALL auxbas_pw_pool%give_back_pw(rho_elec_rspace)
2264 ELSE IF (print_density ==
"SOFT_DENSITY" .OR. .NOT. dft_control%qs_control%gapw)
THEN
2265 IF (dft_control%nspins > 1)
THEN
2269 auxbas_pw_pool=auxbas_pw_pool, &
2271 CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace)
2272 CALL pw_copy(rho_r(1), rho_elec_rspace)
2273 CALL pw_axpy(rho_r(2), rho_elec_rspace)
2274 filename =
"ELECTRON_DENSITY"
2277 extension=
".cube", middle_name=trim(filename), &
2278 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2280 IF (output_unit > 0)
THEN
2281 IF (.NOT. mpi_io)
THEN
2282 INQUIRE (unit=unit_nr, name=filename)
2284 filename = mpi_filename
2286 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2287 "The sum of alpha and beta density is written in cube file format to the file:", &
2290 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"SUM OF ALPHA AND BETA DENSITY", &
2291 particles=particles, zeff=zcharge, &
2295 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2296 CALL pw_copy(rho_r(1), rho_elec_rspace)
2297 CALL pw_axpy(rho_r(2), rho_elec_rspace, alpha=-1.0_dp)
2298 filename =
"SPIN_DENSITY"
2301 extension=
".cube", middle_name=trim(filename), &
2302 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2304 IF (output_unit > 0)
THEN
2305 IF (.NOT. mpi_io)
THEN
2306 INQUIRE (unit=unit_nr, name=filename)
2308 filename = mpi_filename
2310 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2311 "The spin density is written in cube file format to the file:", &
2314 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"SPIN DENSITY", &
2315 particles=particles, zeff=zcharge, &
2316 stride=
section_get_ivals(dft_section,
"PRINT%E_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2318 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2319 CALL auxbas_pw_pool%give_back_pw(rho_elec_rspace)
2321 filename =
"ELECTRON_DENSITY"
2324 extension=
".cube", middle_name=trim(filename), &
2325 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2327 IF (output_unit > 0)
THEN
2328 IF (.NOT. mpi_io)
THEN
2329 INQUIRE (unit=unit_nr, name=filename)
2331 filename = mpi_filename
2333 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2334 "The electron density is written in cube file format to the file:", &
2338 particles=particles, zeff=zcharge, &
2339 stride=
section_get_ivals(dft_section,
"PRINT%E_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2341 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2344 ELSE IF (dft_control%qs_control%gapw .AND. print_density ==
"TOTAL_HARD_APPROX")
THEN
2345 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, rho0_mpole=rho0_mpole, natom=natom)
2346 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools)
2347 CALL auxbas_pw_pool%create_pw(rho_elec_rspace)
2350 ALLOCATE (my_q0(natom))
2358 my_q0(iat) = sum(rho0_mpole%mp_rho(iat)%Q0(1:dft_control%nspins))*
norm_factor
2362 CALL calculate_rho_resp_all(rho_elec_rspace, coeff=my_q0, natom=natom, eta=rho0_mpole%zet0_h, qs_env=qs_env)
2366 DO ispin = 1, dft_control%nspins
2367 CALL pw_axpy(rho_r(ispin), rho_elec_rspace)
2371 rho_total_rspace = rho_soft + rho_hard
2373 filename =
"ELECTRON_DENSITY"
2376 extension=
".cube", middle_name=trim(filename), &
2377 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2379 IF (output_unit > 0)
THEN
2380 IF (.NOT. mpi_io)
THEN
2381 INQUIRE (unit=unit_nr, name=filename)
2383 filename = mpi_filename
2385 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2386 "The electron density is written in cube file format to the file:", &
2388 WRITE (unit=output_unit, fmt=
"(/,(T2,A,F20.10))") &
2389 "Soft electronic charge (R-space) :", rho_soft, &
2390 "Hard electronic charge (R-space) :", rho_hard, &
2391 "Total electronic charge (R-space):", rho_total_rspace
2393 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"ELECTRON DENSITY", &
2394 particles=particles, zeff=zcharge, &
2398 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2401 IF (dft_control%nspins > 1)
THEN
2403 my_q0(iat) = (rho0_mpole%mp_rho(iat)%Q0(1) - rho0_mpole%mp_rho(iat)%Q0(2))*
norm_factor
2406 CALL calculate_rho_resp_all(rho_elec_rspace, coeff=my_q0, natom=natom, eta=rho0_mpole%zet0_h, qs_env=qs_env)
2409 CALL pw_axpy(rho_r(1), rho_elec_rspace)
2410 CALL pw_axpy(rho_r(2), rho_elec_rspace, alpha=-1.0_dp)
2414 rho_total_rspace = rho_soft + rho_hard
2416 filename =
"SPIN_DENSITY"
2419 extension=
".cube", middle_name=trim(filename), &
2420 file_position=my_pos_cube, log_filename=.false., mpi_io=mpi_io, &
2422 IF (output_unit > 0)
THEN
2423 IF (.NOT. mpi_io)
THEN
2424 INQUIRE (unit=unit_nr, name=filename)
2426 filename = mpi_filename
2428 WRITE (unit=output_unit, fmt=
"(/,T2,A,/,/,T2,A)") &
2429 "The spin density is written in cube file format to the file:", &
2431 WRITE (unit=output_unit, fmt=
"(/,(T2,A,F20.10))") &
2432 "Soft part of the spin density :", rho_soft, &
2433 "Hard part of the spin density :", rho_hard, &
2434 "Total spin density (R-space) :", rho_total_rspace
2436 CALL cp_pw_to_cube(rho_elec_rspace, unit_nr,
"SPIN DENSITY", &
2437 particles=particles, zeff=zcharge, &
2438 stride=
section_get_ivals(dft_section,
"PRINT%E_DENSITY_CUBE%STRIDE"), mpi_io=mpi_io)
2440 "DFT%PRINT%E_DENSITY_CUBE", mpi_io=mpi_io)
2442 CALL auxbas_pw_pool%give_back_pw(rho_elec_rspace)
2448 dft_section,
"PRINT%ENERGY_WINDOWS"),
cp_p_file) .AND. .NOT. do_kpoints)
THEN
2454 "DFT%PRINT%V_HARTREE_CUBE"),
cp_p_file))
THEN
2458 v_hartree_rspace=v_hartree_rspace)
2459 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
2460 CALL auxbas_pw_pool%create_pw(aux_r)
2463 my_pos_cube =
"REWIND"
2464 IF (append_cube)
THEN
2465 my_pos_cube =
"APPEND"
2468 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
2471 extension=
".cube", middle_name=
"v_hartree", file_position=my_pos_cube, mpi_io=mpi_io)
2472 udvol = 1.0_dp/v_hartree_rspace%pw_grid%dvol
2474 CALL pw_copy(v_hartree_rspace, aux_r)
2477 CALL cp_pw_to_cube(aux_r, unit_nr,
"HARTREE POTENTIAL", particles=particles, zeff=zcharge, &
2479 "PRINT%V_HARTREE_CUBE%STRIDE"), mpi_io=mpi_io)
2481 "DFT%PRINT%V_HARTREE_CUBE", mpi_io=mpi_io)
2483 CALL auxbas_pw_pool%give_back_pw(aux_r)
2488 "DFT%PRINT%EXTERNAL_POTENTIAL_CUBE"),
cp_p_file))
THEN
2489 IF (dft_control%apply_external_potential)
THEN
2490 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, vee=vee)
2491 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
2492 CALL auxbas_pw_pool%create_pw(aux_r)
2494 append_cube =
section_get_lval(input,
"DFT%PRINT%EXTERNAL_POTENTIAL_CUBE%APPEND")
2495 my_pos_cube =
"REWIND"
2496 IF (append_cube)
THEN
2497 my_pos_cube =
"APPEND"
2502 extension=
".cube", middle_name=
"ext_pot", file_position=my_pos_cube, mpi_io=mpi_io)
2506 CALL cp_pw_to_cube(aux_r, unit_nr,
"EXTERNAL POTENTIAL", particles=particles, zeff=zcharge, &
2508 "PRINT%EXTERNAL_POTENTIAL_CUBE%STRIDE"), mpi_io=mpi_io)
2510 "DFT%PRINT%EXTERNAL_POTENTIAL_CUBE", mpi_io=mpi_io)
2512 CALL auxbas_pw_pool%give_back_pw(aux_r)
2518 "DFT%PRINT%EFIELD_CUBE"),
cp_p_file))
THEN
2520 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
2521 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
2522 CALL auxbas_pw_pool%create_pw(aux_r)
2523 CALL auxbas_pw_pool%create_pw(aux_g)
2526 my_pos_cube =
"REWIND"
2527 IF (append_cube)
THEN
2528 my_pos_cube =
"APPEND"
2530 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, &
2531 v_hartree_rspace=v_hartree_rspace)
2533 udvol = 1.0_dp/v_hartree_rspace%pw_grid%dvol
2537 extension=
".cube", middle_name=
"efield_"//cdir(id), file_position=my_pos_cube, &
2548 unit_nr,
"ELECTRIC FIELD", particles=particles, zeff=zcharge, &
2550 "PRINT%EFIELD_CUBE%STRIDE"), mpi_io=mpi_io)
2552 "DFT%PRINT%EFIELD_CUBE", mpi_io=mpi_io)
2555 CALL auxbas_pw_pool%give_back_pw(aux_r)
2556 CALL auxbas_pw_pool%give_back_pw(aux_g)
2560 CALL qs_scf_post_local_energy(input, logger, qs_env)
2563 CALL qs_scf_post_local_stress(input, logger, qs_env)
2566 CALL qs_scf_post_ps_implicit(input, logger, qs_env)
2574 "DFT%PRINT%AO_MATRICES/DENSITY"),
cp_p_file))
THEN
2579 after = min(max(after, 1), 16)
2580 DO ispin = 1, dft_control%nspins
2581 DO img = 1, dft_control%nimages
2583 para_env, output_unit=iw, omit_headers=omit_headers)
2587 "DFT%PRINT%AO_MATRICES/DENSITY")
2592 "DFT%PRINT%AO_MATRICES/KOHN_SHAM_MATRIX"),
cp_p_file)
2594 "DFT%PRINT%AO_MATRICES/MATRIX_VXC"),
cp_p_file)
2596 IF (write_ks .OR. write_xc)
THEN
2597 IF (write_xc) qs_env%requires_matrix_vxc = .true.
2600 just_energy=.false.)
2601 IF (write_xc) qs_env%requires_matrix_vxc = .false.
2608 CALL get_qs_env(qs_env=qs_env, matrix_ks_kp=ks_rmpv)
2610 after = min(max(after, 1), 16)
2611 DO ispin = 1, dft_control%nspins
2612 DO img = 1, dft_control%nimages
2614 para_env, output_unit=iw, omit_headers=omit_headers)
2618 "DFT%PRINT%AO_MATRICES/KOHN_SHAM_MATRIX")
2623 IF (.NOT. dft_control%qs_control%pao)
THEN
2631 CALL write_adjacency_matrix(qs_env, input)
2635 CALL get_qs_env(qs_env=qs_env, matrix_vxc_kp=matrix_vxc)
2636 cpassert(
ASSOCIATED(matrix_vxc))
2640 after = min(max(after, 1), 16)
2641 DO ispin = 1, dft_control%nspins
2642 DO img = 1, dft_control%nimages
2644 para_env, output_unit=iw, omit_headers=omit_headers)
2648 "DFT%PRINT%AO_MATRICES/MATRIX_VXC")
2653 "DFT%PRINT%AO_MATRICES/COMMUTATOR_HR"),
cp_p_file))
THEN
2659 after = min(max(after, 1), 16)
2662 para_env, output_unit=iw, omit_headers=omit_headers)
2666 "DFT%PRINT%AO_MATRICES/COMMUTATOR_HR")
2672 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%MULLIKEN", extension=
".mulliken", log_filename=.false.)
2675 IF (print_it) print_level = 2
2677 IF (print_it) print_level = 3
2688 CALL qs_rho_get(rho, rho_r_valid=rho_r_valid)
2689 IF (rho_r_valid)
THEN
2690 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%HIRSHFELD", extension=
".hirshfeld", log_filename=.false.)
2691 CALL hirshfeld_charges(qs_env, print_key, unit_nr)
2699 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%EEQ_CHARGES", extension=
".eeq", log_filename=.false.)
2701 CALL eeq_print(qs_env, unit_nr, print_level, ext=.false.)
2709 should_print_voro = 1
2711 should_print_voro = 0
2714 should_print_bqb = 1
2716 should_print_bqb = 0
2718 IF ((should_print_voro /= 0) .OR. (should_print_bqb /= 0))
THEN
2723 CALL qs_rho_get(rho, rho_r_valid=rho_r_valid)
2724 IF (rho_r_valid)
THEN
2726 IF (dft_control%nspins > 1)
THEN
2730 auxbas_pw_pool=auxbas_pw_pool, &
2734 CALL auxbas_pw_pool%create_pw(pw=mb_rho)
2735 CALL pw_copy(rho_r(1), mb_rho)
2736 CALL pw_axpy(rho_r(2), mb_rho)
2743 IF (should_print_voro /= 0)
THEN
2745 IF (voro_print_txt)
THEN
2747 my_pos_voro =
"REWIND"
2748 IF (append_voro)
THEN
2749 my_pos_voro =
"APPEND"
2751 unit_nr_voro =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%VORONOI", extension=
".voronoi", &
2752 file_position=my_pos_voro, log_filename=.false.)
2760 CALL entry_voronoi_or_bqb(should_print_voro, should_print_bqb, print_key_voro, print_key_bqb, &
2761 unit_nr_voro, qs_env, mb_rho)
2763 IF (dft_control%nspins > 1)
THEN
2764 CALL auxbas_pw_pool%give_back_pw(mb_rho)
2768 IF (unit_nr_voro > 0)
THEN
2778 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%MAO_ANALYSIS", extension=
".mao", log_filename=.false.)
2786 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%MINBAS_ANALYSIS", extension=
".mao", log_filename=.false.)
2794 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%IAO_ANALYSIS", extension=
".iao", log_filename=.false.)
2796 IF (iao_env%do_iao)
THEN
2806 extension=
".mao", log_filename=.false.)
2817 IF (qs_env%x_data(i, 1)%do_hfx_ri)
CALL print_ri_hfx(qs_env%x_data(i, 1)%ri_data, qs_env)
2821 DEALLOCATE (zcharge)
2823 CALL timestop(handle)
2833 SUBROUTINE hirshfeld_charges(qs_env, input_section, unit_nr)
2836 INTEGER,
INTENT(IN) :: unit_nr
2838 INTEGER :: i, iat, ikind, natom, nkind, nspin, &
2839 radius_type, refc, shapef
2840 INTEGER,
DIMENSION(:),
POINTER :: atom_list
2841 LOGICAL :: do_radius, do_sc, paw_atom
2842 REAL(kind=
dp) :: zeff
2843 REAL(kind=
dp),
DIMENSION(:),
POINTER :: radii
2844 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: charges
2847 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_p, matrix_s
2853 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
2857 NULLIFY (hirshfeld_env)
2861 CALL get_qs_env(qs_env, nkind=nkind, natom=natom)
2862 ALLOCATE (hirshfeld_env%charges(natom))
2871 IF (.NOT.
SIZE(radii) == nkind) &
2872 CALL cp_abort(__location__, &
2873 "Length of keyword HIRSHFELD\ATOMIC_RADII does not "// &
2874 "match number of atomic kinds in the input coordinate file.")
2879 iterative=do_sc, ref_charge=refc, &
2880 radius_type=radius_type)
2882 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, atomic_kind_set=atomic_kind_set)
2888 nspin =
SIZE(matrix_p, 1)
2889 ALLOCATE (charges(natom, nspin))
2894 atomic_kind => atomic_kind_set(ikind)
2896 DO iat = 1,
SIZE(atom_list)
2898 hirshfeld_env%charges(i) = zeff
2902 CALL get_qs_env(qs_env, matrix_s_kp=matrix_s, para_env=para_env)
2905 hirshfeld_env%charges(iat) = sum(charges(iat, :))
2908 cpabort(
"Unknown type of reference charge for Hirshfeld partitioning.")
2912 IF (hirshfeld_env%iterative)
THEN
2919 CALL get_qs_env(qs_env, particle_set=particle_set, dft_control=dft_control)
2920 IF (dft_control%qs_control%gapw)
THEN
2922 CALL get_qs_env(qs_env, rho0_mpole=rho0_mpole)
2925 atomic_kind => particle_set(iat)%atomic_kind
2927 CALL get_qs_kind(qs_kind_set(ikind), paw_atom=paw_atom)
2929 charges(iat, 1:nspin) = charges(iat, 1:nspin) + mp_rho(iat)%q0(1:nspin)
2934 IF (unit_nr > 0)
THEN
2936 qs_kind_set, unit_nr)
2942 DEALLOCATE (charges)
2944 END SUBROUTINE hirshfeld_charges
2954 SUBROUTINE project_function_a(ca, a, cb, b, l)
2956 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: ca
2957 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: a, cb, b
2958 INTEGER,
INTENT(IN) :: l
2961 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: ipiv
2962 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: smat, tmat, v
2965 ALLOCATE (smat(n, n), tmat(n, n), v(n, 1), ipiv(n))
2969 v(:, 1) = matmul(tmat, cb)
2970 CALL dgesv(n, 1, smat, n, ipiv, v, n, info)
2974 DEALLOCATE (smat, tmat, v, ipiv)
2976 END SUBROUTINE project_function_a
2986 SUBROUTINE project_function_b(ca, a, bfun, grid_atom, l)
2988 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: ca
2989 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: a, bfun
2991 INTEGER,
INTENT(IN) :: l
2993 INTEGER :: i, info, n, nr
2994 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: ipiv
2995 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: afun
2996 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: smat, v
3000 ALLOCATE (smat(n, n), v(n, 1), ipiv(n), afun(nr))
3004 afun(:) = grid_atom%rad(:)**l*exp(-a(i)*grid_atom%rad2(:))
3005 v(i, 1) = sum(afun(:)*bfun(:)*grid_atom%wr(:))
3007 CALL dgesv(n, 1, smat, n, ipiv, v, n, info)
3011 DEALLOCATE (smat, v, ipiv, afun)
3013 END SUBROUTINE project_function_b
3024 SUBROUTINE qs_scf_post_local_energy(input, logger, qs_env)
3029 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_local_energy'
3031 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube
3032 INTEGER :: handle, io_unit, natom, unit_nr
3033 LOGICAL :: append_cube, gapw, gapw_xc, mpi_io
3042 CALL timeset(routinen, handle)
3045 "DFT%PRINT%LOCAL_ENERGY_CUBE"),
cp_p_file))
THEN
3047 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, natom=natom)
3048 gapw = dft_control%qs_control%gapw
3049 gapw_xc = dft_control%qs_control%gapw_xc
3050 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, subsys=subsys)
3052 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
3053 CALL auxbas_pw_pool%create_pw(eden)
3057 append_cube =
section_get_lval(input,
"DFT%PRINT%LOCAL_ENERGY_CUBE%APPEND")
3058 IF (append_cube)
THEN
3059 my_pos_cube =
"APPEND"
3061 my_pos_cube =
"REWIND"
3065 extension=
".cube", middle_name=
"local_energy", &
3066 file_position=my_pos_cube, mpi_io=mpi_io)
3068 unit_nr,
"LOCAL ENERGY", particles=particles, &
3070 "PRINT%LOCAL_ENERGY_CUBE%STRIDE"), mpi_io=mpi_io)
3071 IF (io_unit > 0)
THEN
3072 INQUIRE (unit=unit_nr, name=filename)
3073 IF (gapw .OR. gapw_xc)
THEN
3074 WRITE (unit=io_unit, fmt=
"(/,T3,A,A)") &
3075 "The soft part of the local energy is written to the file: ", trim(adjustl(filename))
3077 WRITE (unit=io_unit, fmt=
"(/,T3,A,A)") &
3078 "The local energy is written to the file: ", trim(adjustl(filename))
3082 "DFT%PRINT%LOCAL_ENERGY_CUBE", mpi_io=mpi_io)
3084 CALL auxbas_pw_pool%give_back_pw(eden)
3086 CALL timestop(handle)
3088 END SUBROUTINE qs_scf_post_local_energy
3099 SUBROUTINE qs_scf_post_local_stress(input, logger, qs_env)
3104 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_local_stress'
3106 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube
3107 INTEGER :: handle, io_unit, natom, unit_nr
3108 LOGICAL :: append_cube, gapw, gapw_xc, mpi_io
3109 REAL(kind=
dp) :: beta
3118 CALL timeset(routinen, handle)
3121 "DFT%PRINT%LOCAL_STRESS_CUBE"),
cp_p_file))
THEN
3123 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, natom=natom)
3124 gapw = dft_control%qs_control%gapw
3125 gapw_xc = dft_control%qs_control%gapw_xc
3126 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, subsys=subsys)
3128 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
3129 CALL auxbas_pw_pool%create_pw(stress)
3135 append_cube =
section_get_lval(input,
"DFT%PRINT%LOCAL_STRESS_CUBE%APPEND")
3136 IF (append_cube)
THEN
3137 my_pos_cube =
"APPEND"
3139 my_pos_cube =
"REWIND"
3143 extension=
".cube", middle_name=
"local_stress", &
3144 file_position=my_pos_cube, mpi_io=mpi_io)
3146 unit_nr,
"LOCAL STRESS", particles=particles, &
3148 "PRINT%LOCAL_STRESS_CUBE%STRIDE"), mpi_io=mpi_io)
3149 IF (io_unit > 0)
THEN
3150 INQUIRE (unit=unit_nr, name=filename)
3151 WRITE (unit=io_unit, fmt=
"(/,T3,A)")
"Write 1/3*Tr(sigma) to cube file"
3152 IF (gapw .OR. gapw_xc)
THEN
3153 WRITE (unit=io_unit, fmt=
"(T3,A,A)") &
3154 "The soft part of the local stress is written to the file: ", trim(adjustl(filename))
3156 WRITE (unit=io_unit, fmt=
"(T3,A,A)") &
3157 "The local stress is written to the file: ", trim(adjustl(filename))
3161 "DFT%PRINT%LOCAL_STRESS_CUBE", mpi_io=mpi_io)
3163 CALL auxbas_pw_pool%give_back_pw(stress)
3166 CALL timestop(handle)
3168 END SUBROUTINE qs_scf_post_local_stress
3179 SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env)
3184 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_post_ps_implicit'
3186 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube
3187 INTEGER :: boundary_condition, handle, i, j, &
3188 n_cstr, n_tiles, unit_nr
3189 LOGICAL :: append_cube, do_cstr_charge_cube, do_dielectric_cube, do_dirichlet_bc_cube, &
3190 has_dirichlet_bc, has_implicit_ps, mpi_io, tile_cubes
3200 CALL timeset(routinen, handle)
3202 NULLIFY (pw_env, auxbas_pw_pool, dft_section, particles)
3205 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, subsys=subsys)
3207 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
3209 has_implicit_ps = .false.
3210 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
3215 "DFT%PRINT%IMPLICIT_PSOLVER%DIELECTRIC_CUBE"),
cp_p_file)
3216 IF (has_implicit_ps .AND. do_dielectric_cube)
THEN
3217 append_cube =
section_get_lval(input,
"DFT%PRINT%IMPLICIT_PSOLVER%DIELECTRIC_CUBE%APPEND")
3218 my_pos_cube =
"REWIND"
3219 IF (append_cube)
THEN
3220 my_pos_cube =
"APPEND"
3224 extension=
".cube", middle_name=
"DIELECTRIC_CONSTANT", file_position=my_pos_cube, &
3226 CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool)
3227 CALL auxbas_pw_pool%create_pw(aux_r)
3229 boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition
3230 SELECT CASE (boundary_condition)
3232 CALL pw_copy(poisson_env%implicit_env%dielectric%eps, aux_r)
3234 CALL pw_shrink(pw_env%poisson_env%parameters%ps_implicit_params%neumann_directions, &
3235 pw_env%poisson_env%implicit_env%dct_env%dests_shrink, &
3236 pw_env%poisson_env%implicit_env%dct_env%srcs_shrink, &
3237 pw_env%poisson_env%implicit_env%dct_env%bounds_local_shftd, &
3238 poisson_env%implicit_env%dielectric%eps, aux_r)
3241 CALL cp_pw_to_cube(aux_r, unit_nr,
"DIELECTRIC CONSTANT", particles=particles, &
3242 stride=
section_get_ivals(dft_section,
"PRINT%IMPLICIT_PSOLVER%DIELECTRIC_CUBE%STRIDE"), &
3245 "DFT%PRINT%IMPLICIT_PSOLVER%DIELECTRIC_CUBE", mpi_io=mpi_io)
3247 CALL auxbas_pw_pool%give_back_pw(aux_r)
3252 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_CSTR_CHARGE_CUBE"),
cp_p_file)
3254 has_dirichlet_bc = .false.
3255 IF (has_implicit_ps)
THEN
3256 boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition
3258 has_dirichlet_bc = .true.
3262 IF (has_implicit_ps .AND. do_cstr_charge_cube .AND. has_dirichlet_bc)
THEN
3264 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_CSTR_CHARGE_CUBE%APPEND")
3265 my_pos_cube =
"REWIND"
3266 IF (append_cube)
THEN
3267 my_pos_cube =
"APPEND"
3271 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_CSTR_CHARGE_CUBE", &
3272 extension=
".cube", middle_name=
"dirichlet_cstr_charge", file_position=my_pos_cube, &
3274 CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool)
3275 CALL auxbas_pw_pool%create_pw(aux_r)
3277 boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition
3278 SELECT CASE (boundary_condition)
3280 CALL pw_copy(poisson_env%implicit_env%cstr_charge, aux_r)
3282 CALL pw_shrink(pw_env%poisson_env%parameters%ps_implicit_params%neumann_directions, &
3283 pw_env%poisson_env%implicit_env%dct_env%dests_shrink, &
3284 pw_env%poisson_env%implicit_env%dct_env%srcs_shrink, &
3285 pw_env%poisson_env%implicit_env%dct_env%bounds_local_shftd, &
3286 poisson_env%implicit_env%cstr_charge, aux_r)
3289 CALL cp_pw_to_cube(aux_r, unit_nr,
"DIRICHLET CONSTRAINT CHARGE", particles=particles, &
3290 stride=
section_get_ivals(dft_section,
"PRINT%IMPLICIT_PSOLVER%DIRICHLET_CSTR_CHARGE_CUBE%STRIDE"), &
3293 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_CSTR_CHARGE_CUBE", mpi_io=mpi_io)
3295 CALL auxbas_pw_pool%give_back_pw(aux_r)
3300 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE"),
cp_p_file)
3301 has_dirichlet_bc = .false.
3302 IF (has_implicit_ps)
THEN
3303 boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition
3305 has_dirichlet_bc = .true.
3309 IF (has_implicit_ps .AND. has_dirichlet_bc .AND. do_dirichlet_bc_cube)
THEN
3310 append_cube =
section_get_lval(input,
"DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE%APPEND")
3311 my_pos_cube =
"REWIND"
3312 IF (append_cube)
THEN
3313 my_pos_cube =
"APPEND"
3315 tile_cubes =
section_get_lval(input,
"DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE%TILE_CUBES")
3317 CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool)
3318 CALL auxbas_pw_pool%create_pw(aux_r)
3321 IF (tile_cubes)
THEN
3323 n_cstr =
SIZE(poisson_env%implicit_env%contacts)
3325 n_tiles = poisson_env%implicit_env%contacts(j)%dirichlet_bc%n_tiles
3327 filename =
"dirichlet_cstr_"//trim(adjustl(
cp_to_string(j)))// &
3330 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE", &
3331 extension=
".cube", middle_name=filename, file_position=my_pos_cube, &
3334 CALL pw_copy(poisson_env%implicit_env%contacts(j)%dirichlet_bc%tiles(i)%tile%tile_pw, aux_r)
3336 CALL cp_pw_to_cube(aux_r, unit_nr,
"DIRICHLET TYPE CONSTRAINT", particles=particles, &
3337 stride=
section_get_ivals(dft_section,
"PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE%STRIDE"), &
3340 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE", mpi_io=mpi_io)
3345 NULLIFY (dirichlet_tile)
3346 ALLOCATE (dirichlet_tile)
3347 CALL auxbas_pw_pool%create_pw(dirichlet_tile)
3350 unit_nr =
cp_print_key_unit_nr(logger, input,
"DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE", &
3351 extension=
".cube", middle_name=
"DIRICHLET_CSTR", file_position=my_pos_cube, &
3354 n_cstr =
SIZE(poisson_env%implicit_env%contacts)
3356 n_tiles = poisson_env%implicit_env%contacts(j)%dirichlet_bc%n_tiles
3358 CALL pw_copy(poisson_env%implicit_env%contacts(j)%dirichlet_bc%tiles(i)%tile%tile_pw, dirichlet_tile)
3359 CALL pw_axpy(dirichlet_tile, aux_r)
3363 CALL cp_pw_to_cube(aux_r, unit_nr,
"DIRICHLET TYPE CONSTRAINT", particles=particles, &
3364 stride=
section_get_ivals(dft_section,
"PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE%STRIDE"), &
3367 "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE", mpi_io=mpi_io)
3368 CALL auxbas_pw_pool%give_back_pw(dirichlet_tile)
3369 DEALLOCATE (dirichlet_tile)
3372 CALL auxbas_pw_pool%give_back_pw(aux_r)
3375 CALL timestop(handle)
3377 END SUBROUTINE qs_scf_post_ps_implicit
3385 SUBROUTINE write_adjacency_matrix(qs_env, input)
3389 CHARACTER(len=*),
PARAMETER :: routinen =
'write_adjacency_matrix'
3391 INTEGER :: adjm_size, colind, handle, iatom, ikind, &
3392 ind, jatom, jkind, k, natom, nkind, &
3393 output_unit, rowind, unit_nr
3394 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: interact_adjm
3395 LOGICAL :: do_adjm_write, do_symmetric
3401 DIMENSION(:),
POINTER :: nl_iterator
3404 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3407 CALL timeset(routinen, handle)
3409 NULLIFY (dft_section)
3418 IF (do_adjm_write)
THEN
3419 NULLIFY (qs_kind_set, nl_iterator)
3420 NULLIFY (basis_set_list_a, basis_set_list_b, basis_set_a, basis_set_b)
3422 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, sab_orb=nl, natom=natom, para_env=para_env)
3424 nkind =
SIZE(qs_kind_set)
3425 cpassert(
SIZE(nl) > 0)
3427 cpassert(do_symmetric)
3428 ALLOCATE (basis_set_list_a(nkind), basis_set_list_b(nkind))
3432 adjm_size = ((natom + 1)*natom)/2
3433 ALLOCATE (interact_adjm(4*adjm_size))
3436 NULLIFY (nl_iterator)
3440 ikind=ikind, jkind=jkind, &
3441 iatom=iatom, jatom=jatom)
3443 basis_set_a => basis_set_list_a(ikind)%gto_basis_set
3444 IF (.NOT.
ASSOCIATED(basis_set_a)) cycle
3445 basis_set_b => basis_set_list_b(jkind)%gto_basis_set
3446 IF (.NOT.
ASSOCIATED(basis_set_b)) cycle
3449 IF (iatom <= jatom)
THEN
3456 ikind = ikind + jkind
3457 jkind = ikind - jkind
3458 ikind = ikind - jkind
3462 ind = adjm_size - (natom - rowind + 1)*((natom - rowind + 1) + 1)/2 + colind - rowind + 1
3465 interact_adjm((ind - 1)*4 + 1) = rowind
3466 interact_adjm((ind - 1)*4 + 2) = colind
3467 interact_adjm((ind - 1)*4 + 3) = ikind
3468 interact_adjm((ind - 1)*4 + 4) = jkind
3471 CALL para_env%sum(interact_adjm)
3474 extension=
".adjmat", file_form=
"FORMATTED", &
3475 file_status=
"REPLACE")
3476 IF (unit_nr > 0)
THEN
3477 WRITE (unit_nr,
"(1A,2X,1A,5X,1A,4X,A5,3X,A5)")
"#",
"iatom",
"jatom",
"ikind",
"jkind"
3478 DO k = 1, 4*adjm_size, 4
3480 IF (interact_adjm(k) > 0 .AND. interact_adjm(k + 1) > 0)
THEN
3481 WRITE (unit_nr,
"(I8,2X,I8,3X,I6,2X,I6)") interact_adjm(k:k + 3)
3489 DEALLOCATE (basis_set_list_a, basis_set_list_b)
3492 CALL timestop(handle)
3494 END SUBROUTINE write_adjacency_matrix
3502 SUBROUTINE update_hartree_with_mp2(rho, qs_env)
3506 LOGICAL :: use_virial
3516 NULLIFY (auxbas_pw_pool, pw_env, poisson_env, energy, rho_core, v_hartree_rspace, virial)
3517 CALL get_qs_env(qs_env, pw_env=pw_env, energy=energy, &
3518 rho_core=rho_core, virial=virial, &
3519 v_hartree_rspace=v_hartree_rspace)
3521 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
3523 IF (.NOT. use_virial)
THEN
3525 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
3526 poisson_env=poisson_env)
3527 CALL auxbas_pw_pool%create_pw(v_hartree_gspace)
3528 CALL auxbas_pw_pool%create_pw(rho_tot_gspace)
3532 v_hartree_gspace, rho_core=rho_core)
3534 CALL pw_transfer(v_hartree_gspace, v_hartree_rspace)
3535 CALL pw_scale(v_hartree_rspace, v_hartree_rspace%pw_grid%dvol)
3537 CALL auxbas_pw_pool%give_back_pw(v_hartree_gspace)
3538 CALL auxbas_pw_pool%give_back_pw(rho_tot_gspace)
3541 END SUBROUTINE update_hartree_with_mp2
static double norm_factor(double alpha, int L)
Types and set/get functions for auxiliary density matrix methods.
Contains methods used in the context of density fitting.
subroutine, public admm_uncorrect_for_eigenvalues(ispin, admm_env, ks_matrix)
...
subroutine, public admm_correct_for_eigenvalues(ispin, admm_env, ks_matrix)
...
subroutine, public sg_overlap(smat, l, pa, pb)
...
calculate the orbitals for a given atomic kind type
subroutine, public calculate_atomic_density(density, atomic_kind, qs_kind, ngto, iunit, optbasis, allelectron, confine)
...
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.
Handles all functions related to the CELL.
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public cp_dbcsr_write_sparse_matrix(sparse_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, scale, output_unit, omit_headers)
...
Density Derived atomic point charges from a QM calculation (see Bloechl, J. Chem. Phys....
recursive subroutine, public get_ddapc(qs_env, calc_force, density_fit_section, density_type, qout1, qout2, out_radii, dq_out, ext_rho_tot_g, itype_of_density, iwc)
Computes the Density Derived Atomic Point Charges.
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
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_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
subroutine, public cp_fm_init_random(matrix, ncol, start_col)
fills a matrix with random numbers
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
the type I Discrete Cosine Transform (DCT-I)
subroutine, public pw_shrink(neumann_directions, dests_shrink, srcs_shrink, bounds_local_shftd, pw_in, pw_shrinked)
shrinks an evenly symmetric pw_r3d_rs_type data to a pw_r3d_rs_type data that is 8 times smaller (the...
Calculate Energy Decomposition analysis.
subroutine, public edmf_analysis(qs_env, input_section, unit_nr)
...
Calculation of charge equilibration method.
subroutine, public eeq_print(qs_env, iounit, print_level, ext)
...
Definition and initialisation of the et_coupling data type.
subroutine, public set_et_coupling_type(et_coupling, et_mo_coeff, rest_mat)
...
subroutine, public print_ri_hfx(ri_data, qs_env)
Print RI-HFX quantities, as required by the PRINT subsection.
Calculate Hirshfeld charges and related functions.
subroutine, public comp_hirshfeld_charges(qs_env, hirshfeld_env, charges)
...
subroutine, public create_shape_function(hirshfeld_env, qs_kind_set, atomic_kind_set, radius, radii_list)
creates kind specific shape functions for Hirshfeld charges
subroutine, public write_hirshfeld_charges(charges, hirshfeld_env, particle_set, qs_kind_set, unit_nr)
...
subroutine, public comp_hirshfeld_i_charges(qs_env, hirshfeld_env, charges, ounit)
...
subroutine, public save_hirshfeld_charges(charges, particle_set, qs_kind_set, qs_env)
saves the Hirshfeld charges to the results structure
The types needed for the calculation of Hirshfeld charges and related functions.
subroutine, public create_hirshfeld_type(hirshfeld_env)
...
subroutine, public set_hirshfeld_info(hirshfeld_env, shape_function_type, iterative, ref_charge, fnorm, radius_type, use_bohr)
Set values of a Hirshfeld env.
subroutine, public release_hirshfeld_type(hirshfeld_env)
...
Calculate intrinsic atomic orbitals and analyze wavefunctions.
subroutine, public iao_wfn_analysis(qs_env, iao_env, unit_nr, c_iao_coef, mos, bond_centers)
...
Calculate ntrinsic atomic orbitals and analyze wavefunctions.
subroutine, public iao_read_input(iao_env, iao_section, cell)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Types and basic routines needed for a kpoint calculation.
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Calculate MAO's and analyze wavefunctions.
subroutine, public mao_analysis(qs_env, input_section, unit_nr)
...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Utility routines for the memory handling.
Interface to the message passing library MPI.
Calculate localized minimal basis and analyze wavefunctions.
subroutine, public minbas_analysis(qs_env, input_section, unit_nr)
...
Functions handling the MOLDEN format. Split from mode_selective.
subroutine, public write_mos_molden(mos, qs_kind_set, particle_set, print_section)
Write out the MOs in molden format for visualisation.
Define the data structure for the molecule information.
compute mulliken charges we (currently) define them as c_i = 1/2 [ (PS)_{ii} + (SP)_{ii} ]
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:, :), allocatable, public indso
represent a simple array based list of the given type
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public angstrom
Provide various population analyses and print the requested output information.
subroutine, public lowdin_population_analysis(qs_env, output_unit, print_level)
Perform a Lowdin population analysis based on a symmetric orthogonalisation of the density matrix usi...
subroutine, public mulliken_population_analysis(qs_env, output_unit, print_level)
Perform a Mulliken population analysis.
computes preconditioners, and implements methods to apply them currently used in qs_ot
Types containing essential information for running implicit (iterative) Poisson solver.
integer, parameter, public neumann_bc
integer, parameter, public mixed_bc
integer, parameter, public mixed_periodic_bc
integer, parameter, public periodic_bc
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
This module defines the grid data type and some basic operations on it.
subroutine, public get_pw_grid_info(pw_grid, id_nr, mode, vol, dvol, npts, ngpts, ngpts_cut, dr, cutoff, orthorhombic, gvectors, gsquare)
Access to information stored in the pw_grid_type.
subroutine, public pw_derive(pw, n)
Calculate the derivative of a plane wave vector.
functions related to the poisson solver on regular grids
integer, parameter, public pw_poisson_implicit
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Write wfx file, works as interface to chargemol and multiwfn.
subroutine, public write_wfx(qs_env, dft_section)
...
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, atomic_kind_set, qs_kind_set, cell, dft_control, particle_set, pw_env, basis_type)
maps a given wavefunction on the grid
Calculation of commutator [H,r] matrices.
subroutine, public build_com_hr_matrix(qs_env, matrix_hr)
Calculation of the [H,r] commutators matrices over Cartesian Gaussian functions.
Calculation of the energies concerning the core charge distribution.
Calculation and writing of density of states.
subroutine, public calculate_dos(mos, dft_section)
Compute and write density of states.
subroutine, public calculate_dos_kp(qs_env, dft_section)
Compute and write density of states (kpoints)
Calculates electric field gradients H.M. Petrili, P.E. Blochl, P. Blaha, K. Schwarz,...
subroutine, public qs_efg_calc(qs_env)
...
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public qs_elf_calc(qs_env, elf_r, rho_cutoff)
...
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public energy_windows(qs_env)
...
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, 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, 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.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, mimic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, rhoz_cneo_set, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, harris_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Set the QUICKSTEP environment.
Calculates hyperfine values.
subroutine, public qs_epr_hyp_calc(qs_env)
...
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, 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, 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.
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public qs_ks_update_qs_env(qs_env, calculate_forces, just_energy, print_active)
updates the Kohn Sham matrix of the given qs_env (facility method)
subroutine, public calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho, skip_nuclear_density)
...
subroutine, public qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
subroutine, public loc_dipole(input, dft_control, qs_loc_env, logger, qs_env)
Computes and prints the Dipole (using localized charges)
subroutine, public get_localization_info(qs_env, qs_loc_env, loc_section, mo_local, wf_r, wf_g, particles, coeff, evals, marked_states)
Performs localization of the orbitals.
New version of the module for the localization of the molecular orbitals This should be able to use d...
subroutine, public qs_loc_env_release(qs_loc_env)
...
subroutine, public qs_loc_env_create(qs_loc_env)
...
Some utilities for the construction of the localization environment.
subroutine, public loc_write_restart(qs_loc_env, section, mo_array, coeff_localized, do_homo, evals, do_mixed)
...
subroutine, public qs_loc_env_init(qs_loc_env, localized_wfn_control, qs_env, myspin, do_localize, loc_coeff, mo_loc_history)
allocates the data, and initializes the operators
subroutine, public qs_loc_control_init(qs_loc_env, loc_section, do_homo, do_mixed, do_xas, nloc_xas, spin_xas)
initializes everything needed for localization of the HOMOs
subroutine, public retain_history(mo_loc_history, mo_loc)
copy old mos to new ones, allocating as necessary
subroutine, public qs_loc_init(qs_env, qs_loc_env, localize_section, mos_localized, do_homo, do_mo_cubes, mo_loc_history, evals, tot_zeff_corr, do_mixed)
initializes everything needed for localization of the molecular orbitals
Routines for calculating local energy and stress tensor.
subroutine, public qs_local_stress(qs_env, stress_tensor, beta)
Routine to calculate the local stress.
subroutine, public qs_local_energy(qs_env, energy_density)
Routine to calculate the local energy.
Definition and initialisation of the mo data type.
subroutine, public write_dm_binary_restart(mo_array, dft_section, tmpl_matrix)
calculates density matrix from mo set and writes the density matrix into a binary restart file
collects routines that perform operations directly related to MOs
subroutine, public make_mo_eig(mos, nspins, ks_rmpv, scf_control, mo_derivs, admm_env, hairy_probes, probe)
Calculate KS eigenvalues starting from OF MOS.
Set occupation of molecular orbitals.
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.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public qs_moment_locop(qs_env, magnetic, nmoments, reference, ref_point, unit_number, vel_reprs, com_nl)
...
subroutine, public qs_moment_kpoints(qs_env, nmoments, reference, ref_point, unit_number)
Calculate and print dipole moment elements d_nm(k) for k-point calculations.
subroutine, public qs_moment_berry_phase(qs_env, magnetic, nmoments, reference, ref_point, unit_number)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public neighbor_list_iterator_release(iterator_set)
...
subroutine, public get_neighbor_list_set_p(neighbor_list_sets, nlist, symmetric)
Return the components of the first neighbor list set.
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
an eigen-space solver for the generalised symmetric eigenvalue problem for sparse matrices,...
subroutine, public ot_eigensolver(matrix_h, matrix_s, matrix_orthogonal_space_fm, matrix_c_fm, preconditioner, eps_gradient, iter_max, size_ortho_space, silent, ot_settings)
...
Calculation and writing of projected density of states The DOS is computed per angular momentum and p...
subroutine, public calculate_projected_dos(mo_set, atomic_kind_set, qs_kind_set, particle_set, qs_env, dft_section, ispin, xas_mittle, external_matrix_shalf)
Compute and write projected density of states.
provides a resp fit for gas phase systems
subroutine, public resp_fit(qs_env)
performs resp fit and generates RESP charges
subroutine, public get_rho0_mpole(rho0_mpole, g0_h, vg0_h, iat, ikind, lmax_0, l0_ikind, mp_gau_ikind, mp_rho, norm_g0l_h, qlm_gg, qlm_car, qlm_tot, zet0_h, igrid_zet0_s, rpgf0_h, rpgf0_s, max_rpgf0_s, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs)
...
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Functions to print the KS and S matrix in the CSR format to file.
subroutine, public write_s_matrix_csr(qs_env, input)
writing the overlap matrix in csr format into a file
subroutine, public write_ks_matrix_csr(qs_env, input)
writing the KS matrix in csr format into a file
subroutine, public write_p_matrix_csr(qs_env, input)
writing the density matrix in csr format into a file
subroutine, public write_hcore_matrix_csr(qs_env, input)
writing the core Hamiltonian matrix in csr format into a file
subroutine, public qs_scf_write_mos(qs_env, scf_env, final_mos)
Write the MO eigenvector, eigenvalues, and occupation numbers to the output unit.
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public make_lumo_gpw(qs_env, scf_env, unoccupied_orbs, unoccupied_evals, nlumo, nlumos)
Gets the lumos, and eigenvalues for the lumos.
subroutine, public write_mo_free_results(qs_env)
Write QS results always available (if switched on through the print_keys) Can be called from ls_scf.
subroutine, public qs_scf_post_moments(input, logger, qs_env, output_unit)
Computes and prints electric moments.
subroutine, public write_mo_dependent_results(qs_env, scf_env)
Write QS results available if MO's are present (if switched on through the print_keys) Writes only MO...
subroutine, public scf_post_calculation_gpw(qs_env, wf_type, do_mp2)
collects possible post - scf calculations and prints info / computes properties.
module that contains the definitions of the scf types
integer, parameter, public ot_method_nr
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public wfn_mix(mos, particle_set, dft_section, qs_kind_set, para_env, output_unit, unoccupied_orbs, scf_env, matrix_s, marked_states, for_rtp)
writes a new 'mixed' set of mos to restart file, without touching the current MOs
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
Interface to Wannier90 code.
subroutine, public wannier90_interface(input, logger, qs_env)
...
Methods related to (\cal S)^2 (i.e. spin)
subroutine, public compute_s_square(mos, matrix_s, s_square, s_square_ideal, mo_derivs, strength)
Compute the expectation value <(\cal S)^2> of the single determinant defined by the spin up (alpha) a...
parameters that control an scf iteration
Calculation of STM image as post processing of an electronic structure calculation,...
subroutine, public th_stm_image(qs_env, stm_section, particles, unoccupied_orbs, unoccupied_evals)
Driver for the calculation of STM image, as post processing of a ground-state electronic structure ca...
routines for DFT+NEGF calculations (coupling with the quantum transport code OMEN)
subroutine, public qs_scf_post_transport(qs_env)
post scf calculations for transport
The module to read/write TREX IO files for interfacing CP2K with other programs.
subroutine, public write_trexio(qs_env, trexio_section, energy_derivative)
Write a trexio file.
Interface for Voronoi Integration and output of BQB files.
subroutine, public entry_voronoi_or_bqb(do_voro, do_bqb, input_voro, input_bqb, unit_voro, qs_env, rspace_pw)
Does a Voronoi integration of density or stores the density to compressed BQB format.
subroutine, public xray_diffraction_spectrum(qs_env, unit_number, q_max)
Calculate the coherent X-ray diffraction spectrum using the total electronic density in reciprocal sp...
subroutine, public calculate_rhotot_elec_gspace(qs_env, auxbas_pw_pool, rhotot_elec_gspace, q_max, rho_hard, rho_soft, fsign)
The total electronic density in reciprocal space (g-space) is calculated.
stores some data used in wavefunction fitting
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a pointer to a 1d array
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...
quantities needed for a Hirshfeld based partitioning of real space
Contains information about kpoints.
stores all the informations relevant to an mpi environment
represent a list of objects
contained for different pw related things
environment for the poisson solver
to create arrays of pools
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Provides all information about a quickstep kind.
contains all the info needed by quickstep to calculate the spread of a selected set of orbitals and i...
keeps the density in various representations, keeping track of which ones are valid.