(git:08825b9)
Loading...
Searching...
No Matches
qs_finite_ao.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Shared finite-system AO position and SOC operators for post-SCF analyses.
10!> \author Thomas D. Kuehne, tkuehne@cp2k.org
11! **************************************************************************************************
13 USE cell_types, ONLY: cell_type
15 USE cp_dbcsr_api, ONLY: dbcsr_create,&
21 USE kinds, ONLY: dp
28#include "./base/base_uses.f90"
29
30 IMPLICIT NONE
31 PRIVATE
32 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_finite_ao'
34CONTAINS
35
36! **************************************************************************************************
37!> \brief Analytic covariant first moments in the coordinate frame of SUBSYS/COORD.
38!> \param qs_env Finite Quickstep environment
39!> \param positions Allocated X, Y, Z matrices, released by caller
40! **************************************************************************************************
41 SUBROUTINE finite_ao_positions(qs_env, positions)
42 TYPE(qs_environment_type), POINTER :: qs_env
43 TYPE(dbcsr_p_type), POINTER :: positions(:)
44
45 INTEGER :: axis
46 LOGICAL :: do_kpoints
47 TYPE(cell_type), POINTER :: cell
48 TYPE(dbcsr_p_type), POINTER :: matrix_s(:)
49 TYPE(dft_control_type), POINTER :: dft_control
50 TYPE(neighbor_list_set_p_type), POINTER :: sab_orb(:)
51
52 CALL get_qs_env(qs_env, cell=cell, dft_control=dft_control, do_kpoints=do_kpoints, &
53 matrix_s=matrix_s, sab_orb=sab_orb)
54 IF (any(cell%perd /= 0) .OR. do_kpoints) THEN
55 cpabort('Finite AO positions require PERIODIC NONE without KPOINTS.')
56 END IF
57 SELECT CASE (dft_control%qs_control%method_id)
59 CASE DEFAULT
60 cpabort('Finite AO positions currently support GPW/GAPW only.')
61 END SELECT
62 ALLOCATE (positions(3))
63 DO axis = 1, 3
64 ALLOCATE (positions(axis)%matrix)
65 CALL dbcsr_create(positions(axis)%matrix, template=matrix_s(1)%matrix, name='AO POSITION')
66 CALL cp_dbcsr_alloc_block_from_nbl(positions(axis)%matrix, sab_orb)
67 CALL dbcsr_set(positions(axis)%matrix, 0.0_dp)
68 END DO
69 CALL build_local_moment_matrix(qs_env, positions, 1, ref_point=[0.0_dp, 0.0_dp, 0.0_dp])
70 END SUBROUTINE finite_ao_positions
71! **************************************************************************************************
72!> \brief Validate and construct post-SCF GTH SOC components shared by finite AO analyses.
73!> \param qs_env Restricted SCF environment with GTH SOC potentials
74!> \param soc_matrices Newly allocated SOC matrices, released by caller
75! **************************************************************************************************
76 SUBROUTINE finite_ao_soc(qs_env, soc_matrices)
77 TYPE(qs_environment_type), POINTER :: qs_env
78 TYPE(dbcsr_p_type), POINTER :: soc_matrices(:, :)
79
80 INTEGER :: ik
81 TYPE(dbcsr_p_type), POINTER :: matrix_ks(:, :)
82 TYPE(neighbor_list_set_p_type), POINTER :: sap_ppnl(:)
83 TYPE(qs_kind_type), POINTER :: qs_kind_set(:)
84
85 CALL get_qs_env(qs_env, matrix_ks_kp=matrix_ks, qs_kind_set=qs_kind_set, sap_ppnl=sap_ppnl)
86 IF (SIZE(matrix_ks, 1) /= 1) cpabort('AO SOC requires a restricted SCF calculation.')
87 IF (.NOT. ASSOCIATED(sap_ppnl)) cpabort('Finite AO SOC requires nonlocal GTH SOC projectors.')
88 DO ik = 1, SIZE(qs_kind_set)
89 IF (.NOT. ASSOCIATED(qs_kind_set(ik)%gth_potential)) THEN
90 cpabort('Finite AO SOC requires GTH potentials.')
91 END IF
92 IF (.NOT. qs_kind_set(ik)%gth_potential%soc) cpabort('GTH potential lacks SOC parameters.')
93 END DO
94 CALL v_soc_xyz_from_pseudopotential(qs_env, soc_matrices)
95 END SUBROUTINE finite_ao_soc
96END MODULE qs_finite_ao
Handles all functions related to the CELL.
Definition cell_types.F:15
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_set(matrix, alpha)
...
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_method_gpw
integer, parameter, public do_method_gapw
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
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, matrix_vhxc, 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.
Shared finite-system AO position and SOC operators for post-SCF analyses.
subroutine, public finite_ao_soc(qs_env, soc_matrices)
Validate and construct post-SCF GTH SOC components shared by finite AO analyses.
subroutine, public finite_ao_positions(qs_env, positions)
Analytic covariant first moments in the coordinate frame of SUBSYS/COORD.
Define the quickstep kind type and their sub types.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>.
Definition qs_moments.F:14
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type, all_images, minimum_image, neighbor_image, first_component)
...
Definition qs_moments.F:167
Define the neighbor list data types and the corresponding functionality.
subroutine, public v_soc_xyz_from_pseudopotential(qs_env, mat_v_soc_xyz)
V^SOC_µν^(α),R = ħ/2 < ϕ_µ cell O | sum_ℓ ΔV_ℓ^SO(r,r') L^(α) | ϕ_ν cell R>, α = x,...
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
Provides all information about a quickstep kind.