(git:27c966b)
Loading...
Searching...
No Matches
ai_spin_orbit.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 Calculation of spin orbit integrals over Cartesian Gaussian-type functions
10!> \par Literature
11!> S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986)
12!> \par History
13!> none
14!> \par Parameters
15!> - ax,ay,az : Angular momentum index numbers of orbital a.
16!> - bx,by,bz : Angular momentum index numbers of orbital b.
17!> - coset : Cartesian orbital set pointer.
18!> - dab : Distance between the atomic centers a and b.
19!> - dac : Distance between the atomic centers a and c.
20!> - dbc : Distance between the atomic centers b and c.
21!> - l{a,b,c} : Angular momentum quantum number of shell a, b or c.
22!> - l{a,b,c}_max: Maximum angular momentum quantum number of shell a, b or c.
23!> - l{a,b,c}_min: Minimum angular momentum quantum number of shell a, b or c.
24!> - ncoset : Number of orbitals in a Cartesian orbital set.
25!> - npgf{a,b} : Degree of contraction of shell a or b.
26!> - rab : Distance vector between the atomic centers a and b.
27!> - rab2 : Square of the distance between the atomic centers a and b.
28!> - rac : Distance vector between the atomic centers a and c.
29!> - rac2 : Square of the distance between the atomic centers a and c.
30!> - rbc : Distance vector between the atomic centers b and c.
31!> - rbc2 : Square of the distance between the atomic centers b and c.
32!> - rpgf{a,b,c} : Radius of the primitive Gaussian-type function a, b or c.
33!> - zet{a,b,c} : Exponents of the Gaussian-type functions a, b or c.
34!> - zetp : Reciprocal of the sum of the exponents of orbital a and b.
35!> \author VW
36! **************************************************************************************************
40 USE ai_os_rr, ONLY: os_rr_coul
41 USE kinds, ONLY: dp
42 USE mathconstants, ONLY: pi
43 USE orbital_pointers, ONLY: ncoset
44#include "../base/base_uses.f90"
45
46 IMPLICIT NONE
47 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ai_spin_orbit'
48 PRIVATE
49
50 ! *** Public subroutines ***
51
52 PUBLIC :: pso
53
54CONTAINS
55
56! **************************************************************************************************
57!> \brief Calculation of the primitive paramagnetic spin orbit integrals over
58!> Cartesian Gaussian-type functions.
59!> \param la_max ...
60!> \param la_min ...
61!> \param npgfa ...
62!> \param rpgfa ...
63!> \param zeta ...
64!> \param lb_max ...
65!> \param lb_min ...
66!> \param npgfb ...
67!> \param rpgfb ...
68!> \param zetb ...
69!> \param rac ...
70!> \param rbc ...
71!> \param rab ...
72!> \param vab ...
73!> \param ldrr1 ...
74!> \param ldrr2 ...
75!> \param rr ...
76!> \date 02.03.2009
77!> \author VW
78!> \version 1.0
79! **************************************************************************************************
80 SUBROUTINE pso(la_max, la_min, npgfa, rpgfa, zeta, lb_max, lb_min, npgfb, rpgfb, zetb, &
81 rac, rbc, rab, vab, ldrr1, ldrr2, rr)
82 INTEGER, INTENT(IN) :: la_max, la_min, npgfa
83 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfa, zeta
84 INTEGER, INTENT(IN) :: lb_max, lb_min, npgfb
85 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: rpgfb, zetb
86 REAL(kind=dp), DIMENSION(3), INTENT(IN) :: rac, rbc, rab
87 REAL(kind=dp), DIMENSION(:, :, :), INTENT(INOUT) :: vab
88 INTEGER, INTENT(IN) :: ldrr1, ldrr2
89 REAL(dp), DIMENSION(0:ldrr1-1, ldrr2, *), &
90 INTENT(INOUT) :: rr
91
92 INTEGER, DIMENSION(2, 6), PARAMETER :: &
93 components = reshape([2, 3, 3, 2, 3, 1, 1, 3, 1, 2, 2, 1], [2, 6])
94
95 INTEGER :: axis, first_a, first_b, i, ipgf, j, &
96 jpgf, na, nb, ncol, nrow
97 INTEGER, ALLOCATABLE, DIMENSION(:, :, :) :: map_a, map_b
98 REAL(dp) :: dab, f0, rab2, xhi, zet, zetab
99 REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: work
100 REAL(dp), ALLOCATABLE, DIMENSION(:, :, :) :: derivatives
101 REAL(dp), DIMENSION(3) :: rap, rbp, rcp
102
103 first_a = ncoset(la_min - 1) + 1
104 first_b = ncoset(lb_min - 1) + 1
105 nrow = ncoset(la_max) - first_a + 1
106 ncol = ncoset(lb_max) - first_b + 1
107 ALLOCATE (map_a(4, nrow, 3), map_b(4, ncol, 3))
108 ALLOCATE (work(nrow, ncoset(lb_max + 1)), derivatives(nrow, ncol, 6))
109 DO axis = 1, 3
110 CALL cartesian_ladder_map(la_max, la_min, axis, map_a(:, :, axis), source_lmin=0)
111 CALL cartesian_ladder_map(lb_max, lb_min, axis, map_b(:, :, axis), source_lmin=0)
112 END DO
113
114! *** Calculate the distance of the centers a and c ***
115
116 rab2 = rab(1)**2 + rab(2)**2 + rab(3)**2
117 dab = sqrt(rab2)
118
119 ! *** Loop over all pairs of primitive Gaussian-type functions ***
120
121 na = 0
122
123 DO ipgf = 1, npgfa
124
125 nb = 0
126
127 DO jpgf = 1, npgfb
128
129 ! *** Screening ***
130
131 IF (rpgfa(ipgf) + rpgfb(jpgf) < dab) THEN
132 DO j = nb + 1, nb + ncoset(lb_max)
133 DO i = na + 1, na + ncoset(la_max)
134 vab(i, j, 1) = 0.0_dp
135 vab(i, j, 2) = 0.0_dp
136 vab(i, j, 3) = 0.0_dp
137 END DO
138 END DO
139 nb = nb + ncoset(lb_max)
140 cycle
141 END IF
142
143 ! *** Calculate some prefactors ***
144
145 zetab = zeta(ipgf)*zetb(jpgf)
146 zet = zeta(ipgf) + zetb(jpgf)
147 xhi = zetab/zet
148 rap = zetb(jpgf)*rab/zet
149 rbp = -zeta(ipgf)*rab/zet
150 rcp = -(zeta(ipgf)*rac + zetb(jpgf)*rbc)/zet
151
152 f0 = 2.0_dp*sqrt(zet/pi)*(pi/zet)**(1.5_dp)*exp(-xhi*rab2)
153
154 ! *** Calculate the recurrence relation ***
155
156 CALL os_rr_coul(rap, la_max + 1, rbp, lb_max + 1, rcp, zet, ldrr1, ldrr2, rr)
157
158 ! pso = (T_yz-T_zy, T_zx-T_xz, T_xy-T_yx), T_ij = D_Ai D_Bj V.
159 CALL apply_cartesian_operator_pair(rr(0, 1:ncoset(la_max + 1), 1:ncoset(lb_max + 1)), &
160 derivatives, map_a, map_b, components, &
161 [.true., .true.], [zeta(ipgf), zetb(jpgf)], [.false., .true.], work)
162 DO axis = 1, 3
163 vab(na + first_a:na + ncoset(la_max), nb + first_b:nb + ncoset(lb_max), axis) = &
164 f0*(derivatives(:, :, 2*axis - 1) - derivatives(:, :, 2*axis))
165 END DO
166
167 nb = nb + ncoset(lb_max)
168
169 END DO
170
171 na = na + ncoset(la_max)
172
173 END DO
174
175 END SUBROUTINE pso
176
177END MODULE ai_spin_orbit
Coordinate and basis-center derivative ladders for Cartesian Gaussian integrals. Derivatives act on a...
subroutine, public cartesian_ladder_map(lmax, lmin, axis, map, source_lmin)
Construct base, raised, lowered and degree indices for a Cartesian ladder.
subroutine, public os_rr_coul(rap, la_max, rbp, lb_max, rcp, zet, ldrr1, ldrr2, rr)
Calculation of the Obara-Saika recurrence relation for 1/r_C.
Definition ai_os_rr.F:519
Calculation of spin orbit integrals over Cartesian Gaussian-type functions.
subroutine, public pso(la_max, la_min, npgfa, rpgfa, zeta, lb_max, lb_min, npgfb, rpgfb, zetb, rac, rbc, rab, vab, ldrr1, ldrr2, rr)
Calculation of the primitive paramagnetic spin orbit integrals over Cartesian Gaussian-type functions...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public ncoset