(git:0de0cc2)
qs_scf_post_scf.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief Utility routines for qs_scf
10 ! **************************************************************************************************
13  USE cp_control_types, ONLY: dft_control_type
16  section_vals_type
20  USE qs_environment_types, ONLY: get_qs_env,&
21  qs_environment_type
25  USE qs_scf_types, ONLY: qs_scf_env_type
26 #include "./base/base_uses.f90"
27 
28  IMPLICIT NONE
29 
30  PRIVATE
31 
32  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_scf_post_scf'
33 
35 
36 CONTAINS
37 
38 ! **************************************************************************************************
39 !> \brief computes properties for a given hamilonian using the current wfn
40 !> \param qs_env ...
41 !> \param wf_type ...
42 !> \param do_mp2 ...
43 ! **************************************************************************************************
44  SUBROUTINE qs_scf_compute_properties(qs_env, wf_type, do_mp2)
45  TYPE(qs_environment_type), POINTER :: qs_env
46  CHARACTER(6), OPTIONAL :: wf_type
47  LOGICAL, OPTIONAL :: do_mp2
48 
49  LOGICAL :: explicit
50  TYPE(dft_control_type), POINTER :: dft_control
51  TYPE(qs_scf_env_type), POINTER :: scf_env
52  TYPE(section_vals_type), POINTER :: dft_section, print_section
53 
54  CALL get_qs_env(qs_env, scf_env=scf_env, dft_control=dft_control)
55 
56  IF (dft_control%qs_control%semi_empirical) THEN
57  CALL scf_post_calculation_se(qs_env)
58  ELSEIF (dft_control%qs_control%dftb) THEN
59  CALL wfn_localization_tb(qs_env, "DFTB")
60  CALL scf_post_calculation_tb(qs_env, "DFTB", .false.)
61  ELSEIF (dft_control%qs_control%xtb) THEN
62  CALL wfn_localization_tb(qs_env, "xTB")
63  CALL scf_post_calculation_tb(qs_env, "xTB", .false.)
64  ELSEIF (dft_control%qs_control%do_kg) THEN
65  cpwarn("No properties from PRINT section available for KG methods")
66  ELSEIF (dft_control%qs_control%ofgpw) THEN
67  cpwarn("No properties from PRINT section available for OFGPW methods")
68  ELSEIF (dft_control%qs_control%lri_optbas .AND. dft_control%qs_control%gpw) THEN
69  CALL optimize_lri_basis(qs_env)
70  ELSE
71  IF (PRESENT(wf_type)) THEN
72  IF (PRESENT(do_mp2)) THEN
73  CALL scf_post_calculation_gpw(qs_env, wf_type=wf_type, do_mp2=do_mp2)
74  ELSE
75  CALL scf_post_calculation_gpw(qs_env, wf_type=wf_type)
76  END IF
77  ELSE
78  CALL scf_post_calculation_gpw(qs_env)
79  END IF
80  END IF
81 
82  CALL calculate_band_structure(qs_env)
83 
84  dft_section => section_vals_get_subs_vals(qs_env%input, "DFT")
85  print_section => section_vals_get_subs_vals(dft_section, "PRINT%BASIS_SET_FILE")
86  CALL section_vals_get(print_section, explicit=explicit)
87  IF (explicit) THEN
88  CALL print_basis_set_file(qs_env, print_section)
89  END IF
90 
91  END SUBROUTINE qs_scf_compute_properties
92 
93 END MODULE qs_scf_post_scf
Print basis sets in CP2K format.
subroutine, public print_basis_set_file(qs_env, base_section)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
Localization/Wannier functions for TB.
subroutine, public wfn_localization_tb(qs_env, tb_type)
wfn localization
Optimizes exponents and contraction coefficients of the lri auxiliary basis sets using the UOBYQA min...
subroutine, public optimize_lri_basis(qs_env)
optimizes the lri basis set
Calculation of band structures.
subroutine, public calculate_band_structure(qs_env)
Main routine for band structure calculation.
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, 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_nonbond, sab_almo, sab_kp, sab_kp_nosym, 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, ecoul_1c, rho0_s_rs, rho0_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, 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, rhs)
Get the QUICKSTEP environment.
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public scf_post_calculation_gpw(qs_env, wf_type, do_mp2)
collects possible post - scf calculations and prints info / computes properties.
Utility routines for qs_scf.
subroutine, public qs_scf_compute_properties(qs_env, wf_type, do_mp2)
computes properties for a given hamilonian using the current wfn
Does all kind of post scf calculations for semi-empirical.
subroutine, public scf_post_calculation_se(qs_env)
collects possible post - scf calculations and prints info / computes properties. specific for Semi-em...
Does all kind of post scf calculations for DFTB.
subroutine, public scf_post_calculation_tb(qs_env, tb_type, no_mos)
collects possible post - scf calculations and prints info / computes properties.
module that contains the definitions of the scf types
Definition: qs_scf_types.F:14