29#include "./base/base_uses.f90"
37 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_basis_rotation_methods'
55 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: basis_type
57 CHARACTER(LEN=12) :: my_basis
58 INTEGER :: ik, ikind, ir, ira, irot, jr, lval, &
60 REAL(kind=
dp),
DIMENSION(3, 3) :: rotmat
69 cpassert(
ASSOCIATED(qs_env))
70 cpassert(
ASSOCIATED(kpoints))
71 IF (
PRESENT(basis_type))
THEN
76 IF (
ASSOCIATED(kpoints%kind_rotmat))
THEN
78 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set)
80 nrot =
SIZE(kpoints%kind_rotmat, 1)
81 nkind =
SIZE(kpoints%kind_rotmat, 2)
85 IF (
ASSOCIATED(kpoints%kind_rotmat(irot, ikind)%rmat))
THEN
86 DEALLOCATE (kpoints%kind_rotmat(irot, ikind)%rmat)
92 CALL get_qs_env(qs_env, dft_control=dft_control)
93 DO ik = 1, kpoints%nkp
94 kpsym => kpoints%kp_sym(ik)%kpoint_sym
95 IF (
kpsym%apply_symmetry)
THEN
96 DO irot = 1,
SIZE(
kpsym%rotp)
97 ir = abs(
kpsym%rotp(irot))
99 DO jr = 1,
SIZE(kpoints%ibrot)
100 IF (ir == kpoints%ibrot(jr)) ira = jr
103 IF (.NOT.
ASSOCIATED(kpoints%kind_rotmat(ira, 1)%rmat))
THEN
104 rotmat(1:3, 1:3) = matmul(cell%h_inv, &
105 matmul(
kpsym%rot(:, :, irot), cell%hmat))
109 CALL get_qs_kind(qs_kind_set(ikind), dftb_parameter=dftb_parameter)
110 NULLIFY (kpoints%kind_rotmat(ira, ikind)%rmat)
111 CALL set_rotmat_dftb(kpoints%kind_rotmat(ira, ikind)%rmat, &
112 orbrot, dftb_parameter)
116 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis, basis_type=my_basis)
117 NULLIFY (kpoints%kind_rotmat(ira, ikind)%rmat)
118 CALL set_rotmat_basis(kpoints%kind_rotmat(ira, ikind)%rmat, orbrot, orb_basis)
137 SUBROUTINE set_rotmat_dftb(rmat, orbrot, dftb_parameter)
138 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rmat
142 INTEGER :: first, i, j, l, lmax, n, natorb
143 INTEGER,
DIMENSION(5) :: perm
149 ALLOCATE (rmat(natorb, natorb))
159 perm(1:3) = [3, 1, 2]
161 perm(1:5) = [1, 2, 4, 5, 3]
163 CALL cp_abort(__location__, &
164 "DFTB k-point symmetry is implemented for basis functions up to d orbitals")
168 rmat(first + i - 1, first + j - 1) = orbrot(l)%mat(perm(i), perm(j))
173 cpassert(first == natorb + 1)
175 END SUBROUTINE set_rotmat_dftb
183 SUBROUTINE set_rotmat_basis(rmat, orbrot, basis)
184 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rmat
188 INTEGER :: fs1, fs2, iset, ishell, l, nset, nsgf
189 INTEGER,
DIMENSION(:),
POINTER :: nshell
190 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf, lshell
193 ALLOCATE (rmat(nsgf, nsgf))
196 CALL get_gto_basis_set(gto_basis_set=basis, nset=nset, nshell=nshell, l=lshell, &
199 DO ishell = 1, nshell(iset)
200 l = lshell(ishell, iset)
201 fs1 = first_sgf(ishell, iset)
202 fs2 = fs1 +
nso(l) - 1
203 rmat(fs1:fs2, fs1:fs2) = orbrot(l)%mat(1:
nso(l), 1:
nso(l))
207 END SUBROUTINE set_rotmat_basis
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Defines the basic variable types.
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
K-points and crystal symmetry routines based on.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nso
subroutine, public qs_basis_rotation(qs_env, kpoints, basis_type)
Construct basis set rotation matrices.
Definition of the DFTB parameter types.
Working with the DFTB parameter types.
subroutine, public get_dftb_atom_param(dftb_parameter, name, typ, defined, z, zeff, natorb, lmax, skself, occupation, eta, energy, cutoff, xi, di, rcdisp, dudq)
...
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, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
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.
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, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
Type defining parameters related to the simulation cell.
Keeps symmetry information about a specific k-point.
Contains information about kpoints.
Provides all information about a quickstep kind.