43#include "./base/base_uses.f90"
49 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_loc_states'
70 wf_r, wf_g, particles, coeff, evals, marked_states)
75 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: mo_local
79 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: coeff
81 INTEGER,
DIMENSION(:, :, :),
POINTER :: marked_states
83 CHARACTER(len=*),
PARAMETER :: routinen =
'get_localization_info'
85 INTEGER :: handle, ispin, mystate, ns, nspins, &
87 INTEGER,
DIMENSION(:),
POINTER :: lstates, marked_states_spin
88 LOGICAL :: do_homo, do_mixed
89 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: scenter
91 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: ks_rmpv, matrix_s
98 CALL timeset(routinen, handle)
99 NULLIFY (mos, ks_rmpv, dft_control, loc_print_section, marked_states_spin, &
100 matrix_s, scenter, wc)
101 CALL get_qs_env(qs_env, mos=mos, matrix_ks=ks_rmpv, molecule_set=molecule_set, &
102 dft_control=dft_control, matrix_s=matrix_s)
106 do_homo = qs_loc_env%localized_wfn_control%do_homo
107 do_mixed = qs_loc_env%localized_wfn_control%do_mixed
110 CALL get_qs_env(qs_env=qs_env, wanniercentres=wc)
111 IF (.NOT.
ASSOCIATED(wc))
THEN
112 ALLOCATE (wc(dft_control%nspins))
116 IF (dft_control%restricted)
THEN
120 nspins = dft_control%nspins
126 qs_loc_env%tag_mo =
"HOMO"
128 qs_loc_env%tag_mo =
"LUMO"
131 IF (qs_loc_env%do_localize)
THEN
133 IF (output_unit > 0 .AND. do_homo)
WRITE (output_unit,
"(/,T2,A,I3)") &
134 "LOCALIZATION| Computing localization properties "// &
135 "for OCCUPIED ORBITALS. Spin:", ispin
136 IF (output_unit > 0 .AND. do_mixed)
WRITE (output_unit,
"(/,T2,A,/,T16,A,I3)") &
137 "LOCALIZATION| Computing localization properties for OCCUPIED, ", &
138 "PARTIALLY OCCUPIED and UNOCCUPIED ORBITALS. Spin:", ispin
139 IF (output_unit > 0 .AND. (.NOT. do_homo) .AND. (.NOT. do_mixed)) &
140 WRITE (output_unit,
"(/,T2,A,I3)") &
141 "LOCALIZATION| Computing localization properties "// &
142 "for UNOCCUPIED ORBITALS. Spin:", ispin
144 scenter => qs_loc_env%localized_wfn_control%centers_set(ispin)%array
147 myspin=ispin, ext_mo_coeff=mo_local(ispin))
156 CALL wfc_to_molecule(qs_loc_env, scenter, molecule_set, ispin, dft_control%nspins)
162 ns =
SIZE(qs_loc_env%localized_wfn_control%loc_states, 1)
163 IF (.NOT.
ASSOCIATED(wc(ispin)%centres))
THEN
164 ALLOCATE (wc(ispin)%WannierHamDiag(ns))
165 ALLOCATE (wc(ispin)%centres(3, ns))
168 wc(ispin)%centres(:, :) = scenter(1 + (ispin - 1)*3:ispin*3, :)
169 lstates => qs_loc_env%localized_wfn_control%loc_states(:, ispin)
171 ks_rmpv(ispin)%matrix, qs_env, loc_print_section=loc_print_section, &
172 wanniercentres=wc(ispin), ns=ns, states=lstates)
178 molecule_set, mo_local(ispin), coeff(ispin), &
179 evals(ispin)%array, ks_rmpv(ispin)%matrix, matrix_s(1)%matrix, qs_env, wf_r, wf_g, &
180 loc_print_section=loc_print_section, particles=particles, tag=trim(qs_loc_env%tag_mo), &
181 marked_states=marked_states_spin, ispin=ispin)
182 IF (
ASSOCIATED(marked_states_spin))
THEN
183 IF (.NOT.
ASSOCIATED(marked_states))
THEN
184 ALLOCATE (marked_states(
SIZE(marked_states_spin), dft_control%nspins, 2))
187 IF (qs_loc_env%tag_mo ==
"LUMO") mystate = 2
188 marked_states(:, ispin, mystate) = marked_states_spin(:)
189 DEALLOCATE (marked_states_spin)
195 IF (
section_get_lval(loc_print_section,
"WANNIER_SPREADS%SECOND_MOMENTS"))
THEN
197 IF (dft_control%qs_control%gapw_control%lmax_sphere .LT. 6)
THEN
198 cpabort(
"Periodic second moments require LMAXN1>=6 In QS section")
221 CALL set_qs_env(qs_env=qs_env, wanniercentres=wc)
224 CALL timestop(handle)
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
represent a full matrix distributed on many processors
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, 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...
Defines the basic variable types.
integer, parameter, public dp
Set of routines handling the localization for molecular properties.
subroutine, public calculate_molecular_dipole(qs_env, qs_loc_env, loc_print_key, molecule_set)
maps wfc's to molecules and also prints molecular dipoles
Set of routines handling the localization for molecular properties.
subroutine, public calculate_molecular_moments(qs_env, qs_loc_env, mo_local, loc_print_key, molecule_set)
Calculates electrical molecular moments using local operators r-r_ref r_ref: center of mass of the mo...
Routines for the calculation of molecular states.
subroutine, public construct_molecular_states(molecule_set, mo_localized, mo_coeff, mo_eigenvalues, hks, matrix_s, qs_env, wf_r, wf_g, loc_print_section, particles, tag, marked_states, ispin)
constructs molecular states. mo_localized gets overwritten!
Define the data structure for the molecule information.
represent a simple array based list of the given type
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_pp, 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, 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)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, 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, 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)
Set the QUICKSTEP environment.
Driver for the localization that should be general for all the methods available and all the definiti...
subroutine, public qs_loc_driver(qs_env, qs_loc_env, print_loc_section, myspin, ext_mo_coeff)
set up the calculation of localized orbitals
Driver for the localization that should be general for all the methods available and all the definiti...
subroutine, public centers_second_moments_berry(qs_env, qs_loc_env, print_loc_section, ispin)
Compute the second moments of the centers using a periodic quadrupole operator.
subroutine, public centers_second_moments_loc(qs_env, qs_loc_env, print_loc_section, ispin)
Compute the second moments of the centers using the local (non-periodic) pos operators.
Set of routines handling the localization for molecular properties.
subroutine, public wfc_to_molecule(qs_loc_env, center, molecule_set, ispin, nspins)
maps wfc's to molecules and also prints molecular dipoles
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...
Definition and initialisation of the mo data type.
defines the type needed for computing wannier states expectations
Routines for the calculation of wannier states.
subroutine, public construct_wannier_states(mo_localized, hks, qs_env, loc_print_section, wanniercentres, ns, states)
constructs wannier states. mo_localized should not be overwritten!
represent a pointer to a 1d array
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represent a list of objects
contains all the info needed by quickstep to calculate the spread of a selected set of orbitals and i...