34#include "./base/base_uses.f90"
40 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xtb_hcore'
56 SUBROUTINE gfn0_huckel(qs_env, cnumbers, charges, huckel, dhuckel, dqhuckel, calculate_forces)
58 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: cnumbers, charges
59 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: huckel, dhuckel, dqhuckel
60 LOGICAL,
INTENT(IN) :: calculate_forces
62 INTEGER :: i, iatom, ikind, l, natom, nshell
63 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of
64 INTEGER,
DIMENSION(25) :: lval
65 REAL(kind=
dp) :: kqat2
66 REAL(kind=
dp),
DIMENSION(5) :: hena, kcn, kq
74 atomic_kind_set=atomic_kind_set, &
75 qs_kind_set=qs_kind_set, &
76 dft_control=dft_control)
77 xtb_control => dft_control%qs_control%xtb_control
81 ALLOCATE (huckel(5, natom))
82 IF (calculate_forces)
THEN
83 ALLOCATE (dhuckel(5, natom), dqhuckel(5, natom))
87 ikind = kind_of(iatom)
88 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_atom_a)
90 kcn=kcn, kq=kq, kqat2=kqat2, hen=hena)
94 huckel(:, iatom) = 0.0_dp
97 huckel(i, iatom) = hena(i) - kcn(l)*cnumbers(iatom) &
98 - kq(l)*charges(iatom) - kqat2*charges(iatom)**2
100 IF (calculate_forces)
THEN
101 dhuckel(:, iatom) = 0.0_dp
102 dqhuckel(:, iatom) = 0.0_dp
105 dhuckel(i, iatom) = -kcn(l)
106 dqhuckel(i, iatom) = -kq(l) - 2.0_dp*kqat2*charges(iatom)
121 SUBROUTINE gfn1_huckel(qs_env, cnumbers, huckel, dhuckel, calculate_forces)
123 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: cnumbers
124 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: huckel, dhuckel
125 LOGICAL,
INTENT(IN) :: calculate_forces
127 INTEGER :: i, iatom, ikind, natom, nkind, nshell, za
128 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of
129 INTEGER,
DIMENSION(25) :: lval
130 REAL(kind=
dp) :: kcnd, kcnp, kcns
131 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: kcnlk
132 REAL(kind=
dp),
DIMENSION(5) :: hena
135 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
140 atomic_kind_set=atomic_kind_set, &
141 qs_kind_set=qs_kind_set, &
142 dft_control=dft_control)
143 xtb_control => dft_control%qs_control%xtb_control
145 CALL get_qs_env(qs_env=qs_env, nkind=nkind, natom=natom)
147 kcns = xtb_control%kcns
148 kcnp = xtb_control%kcnp
149 kcnd = xtb_control%kcnd
154 ALLOCATE (kcnlk(0:3, nkind))
158 kcnlk(0:3, ikind) = 0.0_dp
160 kcnlk(0, ikind) = kcns
161 kcnlk(1, ikind) = kcnp
162 kcnlk(2, ikind) = 0.005_dp
163 kcnlk(3, ikind) = 0.0_dp
165 kcnlk(0, ikind) = kcns
166 kcnlk(1, ikind) = kcnp
167 kcnlk(2, ikind) = kcnd
168 kcnlk(3, ikind) = 0.0_dp
172 ALLOCATE (huckel(5, natom))
173 IF (calculate_forces)
THEN
174 ALLOCATE (dhuckel(5, natom))
178 ikind = kind_of(iatom)
179 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_atom_a)
181 huckel(:, iatom) = 0.0_dp
183 huckel(i, iatom) = hena(i)*(1._dp + kcnlk(lval(i), ikind)*cnumbers(iatom))
185 IF (calculate_forces)
THEN
186 dhuckel(:, iatom) = 0.0_dp
188 dhuckel(i, iatom) = hena(i)*kcnlk(lval(i), ikind)
204 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :, :) :: kijab
206 INTEGER :: i, ikind, j, jkind, la, lb, maxs, na, &
207 natorb_a, natorb_b, nb, nkind, za, zb
208 INTEGER,
DIMENSION(25) :: laoa, laob, naoa, naob
210 REAL(kind=
dp) :: ben, den, etaa, etab, kab, kd, kden, &
211 kdiff, ken, kia, kjb, km, kp, kpen, &
212 ks, ksen, ksp, xijab, yijab
213 REAL(kind=
dp),
DIMENSION(0:3) :: ke, kl
214 REAL(kind=
dp),
DIMENSION(5) :: zetaa, zetab
216 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
221 qs_kind_set=qs_kind_set, &
222 dft_control=dft_control)
223 xtb_control => dft_control%qs_control%xtb_control
226 CALL get_qs_kind_set(qs_kind_set=qs_kind_set, maxsgf=maxs, basis_type=
"ORB")
231 ksp = xtb_control%ksp
232 ksen = xtb_control%ksen
233 kpen = xtb_control%kpen
234 kden = xtb_control%kden
235 ben = xtb_control%ben
236 kdiff = xtb_control%k2sh
249 ALLOCATE (kijab(maxs, maxs, nkind, nkind))
253 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_atom_a)
255 IF (.NOT. defined .OR. natorb_a < 1) cycle
259 CALL get_qs_kind(qs_kind_set(jkind), xtb_parameter=xtb_atom_b)
261 IF (.NOT. defined .OR. natorb_b < 1) cycle
274 km = 0.5_dp*(kia + kjb)*kab
275 IF (za == 1 .AND. na == 2)
THEN
276 IF (zb == 1 .AND. nb == 2)
THEN
281 ELSEIF (zb == 1 .AND. nb == 2)
THEN
284 kijab(i, j, ikind, jkind) = km
294 yijab = 2.0_dp*sqrt(kia*kjb)/(kia + kjb)
295 kijab(i, j, ikind, jkind) = kijab(i, j, ikind, jkind)*yijab
306 ken = 0.5_dp*(kia + kjb)
307 xijab = 1.0_dp + ken*den**2 + ken*ben*den**4
308 kijab(i, j, ikind, jkind) = kijab(i, j, ikind, jkind)*xijab
323 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :, :) :: kijab
325 INTEGER :: i, ikind, j, jkind, la, lb, maxs, na, &
326 natorb_a, natorb_b, nb, nkind, za, zb
327 INTEGER,
DIMENSION(25) :: laoa, laob, naoa, naob
329 REAL(kind=
dp) :: ena, enb, fen, k2sh, kab, kd, ken, kia, &
331 REAL(kind=
dp),
DIMENSION(0:3) :: kl
333 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
338 qs_kind_set=qs_kind_set, &
339 dft_control=dft_control)
340 xtb_control => dft_control%qs_control%xtb_control
343 CALL get_qs_kind_set(qs_kind_set=qs_kind_set, maxsgf=maxs, basis_type=
"ORB")
348 ksp = xtb_control%ksp
349 k2sh = xtb_control%k2sh
350 ken = xtb_control%ken
359 ALLOCATE (kijab(maxs, maxs, nkind, nkind))
362 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_atom_a)
364 IF (.NOT. defined .OR. natorb_a < 1) cycle
367 CALL get_qs_kind(qs_kind_set(jkind), xtb_parameter=xtb_atom_b)
369 IF (.NOT. defined .OR. natorb_b < 1) cycle
372 fen = 1.0_dp + ken*(ena - enb)**2
383 IF (zb == 1 .AND. nb == 2) kjb = k2sh
384 IF (za == 1 .AND. na == 2) kia = k2sh
385 IF ((zb == 1 .AND. nb == 2) .OR. (za == 1 .AND. na == 2))
THEN
386 kijab(i, j, ikind, jkind) = 0.5_dp*(kia + kjb)
388 IF ((la == 0 .AND. lb == 1) .OR. (la == 1 .AND. lb == 0))
THEN
389 kijab(i, j, ikind, jkind) = ksp*kab*fen
391 kijab(i, j, ikind, jkind) = 0.5_dp*(kia + kjb)*kab*fen
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
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.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Defines the basic variable types.
integer, parameter, public dp
Definition of physical constants:
real(kind=dp), parameter, public evolt
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.
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, 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, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, basis_type, total_zeff_corr, npgf_seg)
Get attributes of an atomic kind set.
Calculation of EHT matrix elements in xTB Reference: Stefan Grimme, Christoph Bannwarth,...
subroutine, public gfn0_kpair(qs_env, kijab)
...
subroutine, public gfn0_huckel(qs_env, cnumbers, charges, huckel, dhuckel, dqhuckel, calculate_forces)
...
subroutine, public gfn1_kpair(qs_env, kijab)
...
subroutine, public gfn1_huckel(qs_env, cnumbers, huckel, dhuckel, calculate_forces)
...
logical function, public metal(z)
...
logical function, public early3d(z)
...
real(kind=dp) function, public pp_gfn0(za, zb)
...
real(kind=dp) function, public xtb_set_kab(za, zb, xtb_control)
...
Definition of the xTB parameter types.
subroutine, public get_xtb_atom_param(xtb_parameter, symbol, aname, typ, defined, z, zeff, natorb, lmax, nao, lao, rcut, rcov, kx, eta, xgamma, alpha, zneff, nshell, nval, lval, kpoly, kappa, hen, zeta, xi, kappa0, alpg, occupation, electronegativity, chmax, en, kqat2, kcn, kq)
...
Provides all information about an atomic kind.
Provides all information about a quickstep kind.