(git:0761fd1)
Loading...
Searching...
No Matches
ai_angmom.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 the angular momentum integrals over
10!> Cartesian Gaussian-type functions.
11!> \par Literature
12!> S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986)
13!> \par History
14!> none
15!> \author JGH (20.02.2005)
16! **************************************************************************************************
18
20 USE ai_os_rr, ONLY: os_rr_ovlp
21 USE kinds, ONLY: dp
22 USE mathconstants, ONLY: pi
23 USE orbital_pointers, ONLY: indco,&
24 ncoset
25#include "../base/base_uses.f90"
26
27 IMPLICIT NONE
28
29 PRIVATE
30
31! *** Public subroutines ***
32
33 PUBLIC :: angmom
34
35CONTAINS
36
37! **************************************************************************************************
38!> \brief Real angular-momentum kernel (r-C) cross grad, equal to i times L.
39!> \param la_max ...
40!> \param npgfa ...
41!> \param zeta ...
42!> \param rpgfa ...
43!> \param la_min lowest occupied shell; the output retains the full cumulative Cartesian layout
44!> \param lb_max ...
45!> \param npgfb ...
46!> \param zetb ...
47!> \param rpgfb ...
48!> \param rac ...
49!> \param rbc ...
50!> \param angab ...
51! **************************************************************************************************
52 SUBROUTINE angmom(la_max, npgfa, zeta, rpgfa, la_min, &
53 lb_max, npgfb, zetb, rpgfb, rac, rbc, angab)
54 INTEGER, INTENT(IN) :: la_max, npgfa
55 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: zeta, rpgfa
56 INTEGER, INTENT(IN) :: la_min, lb_max, npgfb
57 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: zetb, rpgfb
58 REAL(kind=dp), DIMENSION(3), INTENT(IN) :: rac, rbc
59 REAL(kind=dp), DIMENSION(:, :, :), INTENT(OUT) :: angab
60
61 INTEGER :: avec(3), bvec(3), coa, cob, ia, ib, &
62 idir, ipgf, jdir, jpgf, kdir, ldrr, &
63 ma, mb
64 REAL(kind=dp) :: a, b, dab, f0, rab(3), rab2, rap(3), &
65 rbp(3), zet
66 REAL(kind=dp), ALLOCATABLE :: drr(:, :, :), position(:, :, :), &
67 rr(:, :, :)
68
69 mark_used(la_min)
70 rab = rbc - rac
71 dab = norm2(rab)
72 rab2 = dab**2
73 ldrr = max(la_max, lb_max) + 2
74 ALLOCATE (rr(0:ldrr - 1, 0:ldrr - 1, 3), position(0:ldrr - 1, 0:ldrr - 1, 3), &
75 drr(0:ldrr - 1, 0:ldrr - 1, 3))
76 angab = 0.0_dp
77 DO ipgf = 1, npgfa
78 ma = (ipgf - 1)*ncoset(la_max)
79 DO jpgf = 1, npgfb
80 IF (rpgfa(ipgf) + rpgfb(jpgf) < dab) cycle
81 mb = (jpgf - 1)*ncoset(lb_max)
82 a = zeta(ipgf)
83 b = zetb(jpgf)
84 zet = a + b
85 rap = b*rab/zet
86 rbp = -a*rab/zet
87 f0 = (pi/zet)**1.5_dp*exp(-a*b*rab2/zet)
88 CALL os_rr_ovlp(rap, la_max + 1, rbp, lb_max + 1, zet, ldrr, rr)
89 CALL apply_cartesian_1d(rr, position, la_max, lb_max, .false., .false., 0.0_dp, rac)
90 CALL apply_cartesian_1d(rr, drr, la_max, lb_max, .true., .true., b, [0.0_dp, 0.0_dp, 0.0_dp])
91
92 ! The ket electronic derivative is the negative of its center derivative.
93 ! Form only the three cross-product components before contraction.
94 DO cob = 1, ncoset(lb_max)
95 bvec = indco(:, cob)
96 ib = mb + cob
97 DO coa = 1, ncoset(la_max)
98 avec = indco(:, coa)
99 ia = ma + coa
100 DO idir = 1, 3
101 jdir = mod(idir, 3) + 1
102 kdir = mod(idir + 1, 3) + 1
103 angab(ia, ib, idir) = f0*rr(avec(idir), bvec(idir), idir)* &
104 (position(avec(kdir), bvec(kdir), kdir)*drr(avec(jdir), bvec(jdir), jdir) - &
105 position(avec(jdir), bvec(jdir), jdir)*drr(avec(kdir), bvec(kdir), kdir))
106 END DO
107 END DO
108 END DO
109 END DO
110 END DO
111 END SUBROUTINE angmom
112
113END MODULE ai_angmom
Calculation of the angular momentum integrals over Cartesian Gaussian-type functions.
Definition ai_angmom.F:17
subroutine, public angmom(la_max, npgfa, zeta, rpgfa, la_min, lb_max, npgfb, zetb, rpgfb, rac, rbc, angab)
Real angular-momentum kernel (r-C) cross grad, equal to i times L.
Definition ai_angmom.F:54
Coordinate and basis-center derivative ladders for Cartesian Gaussian integrals. Derivatives act on a...
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
integer, dimension(:, :), allocatable, public indco