10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-13 09:34:02 +01:00

add primitive basis and correct NEEDED_MODULES

This commit is contained in:
Manu 2015-01-09 16:58:24 +01:00
parent c759078572
commit 28a733ef8d
6 changed files with 200 additions and 1 deletions

View File

@ -1,2 +1,2 @@
AOs BiInts Bitmask CASSD DDCI Dets Electrons Ezfio_files Generators_CAS Hartree_Fock Loc_MOs MOGuess Molden MonoInts MOs Nuclei Output Perturbation Primitive_basis Selectors_full Utils
AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess Molden MonoInts MOs Nuclei Output Perturbation Primitive_basis Selectors_full Utils

View File

View File

@ -0,0 +1 @@
AOs Electrons Ezfio_files MOs Nuclei Output Utils

View File

@ -0,0 +1,18 @@
double precision function mo_r(i,r)
implicit none
integer :: i
double precision :: r(3)
integer :: j
double precision :: x_center,y_center,z_center,r_center
mo_r = 0.d0
do j = 1, prim_num
if(dabs(prim_mo_coef(j,i)).lt.1.d-10)cycle
x_center = r(1) - nucl_coord(prim_nucl(j),1)
y_center = r(2) - nucl_coord(prim_nucl(j),2)
z_center = r(3) - nucl_coord(prim_nucl(j),3)
r_center = x_center*x_center + y_center*y_center + z_center*z_center
mo_r = mo_r + prim_mo_coef(j,i) * (x_center ** (prim_power(j,1)) * y_center ** (prim_power(j,2)) * z_center ** (prim_power(j,3)) &
* dexp(-prim_expo(j) * r_center))
enddo
end

View File

@ -0,0 +1,175 @@
BEGIN_PROVIDER [integer, prim_num]
implicit none
BEGIN_DOC
! Number of uniq primitive basis function
END_DOC
PROVIDE ezfio_filename
call ezfio_get_primitive_basis_prim_num(prim_num)
END_PROVIDER
BEGIN_PROVIDER [integer, prim_nucl, (prim_num)]
implicit none
BEGIN_DOC
! Array of the nuclei on which are attached the primitives
END_DOC
PROVIDE ezfio_filename
integer, allocatable :: tmp(:)
allocate(tmp(prim_num))
call ezfio_get_primitive_basis_prim_nucl(tmp)
prim_nucl = tmp
END_PROVIDER
BEGIN_PROVIDER [integer, prim_power, (prim_num,3)]
&BEGIN_PROVIDER [integer, prim_l, (prim_num)]
implicit none
BEGIN_DOC
! Array of the power of the primitives
! Array of the L of the primitive
END_DOC
PROVIDE ezfio_filename
integer :: i,j
integer, allocatable :: tmp(:,:)
allocate(tmp(3,prim_num))
call ezfio_get_primitive_basis_prim_power(tmp)
do i = 1, prim_num
do j = 1,3
prim_power(i,j) = tmp(j,i)
enddo
enddo
do i = 1, prim_num
prim_l(i) = prim_power(i,1) + prim_power(i,2) + prim_power(i,3)
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, prim_expo, (prim_num)]
implicit none
BEGIN_DOC
! Array of the exponents of the primitives
END_DOC
PROVIDE ezfio_filename
double precision, allocatable :: tmp(:)
allocate(tmp(prim_num))
call ezfio_get_primitive_basis_prim_expo(tmp)
prim_expo = tmp
END_PROVIDER
BEGIN_PROVIDER [double precision, prim_overlap, (prim_num,prim_num)]
implicit none
BEGIN_DOC
! Array of the overlap between the primitives
END_DOC
integer :: i,j
prim_overlap = 0.d0
double precision :: overlap, overlap_x, overlap_y, overlap_z
double precision :: alpha, beta, c
double precision :: A_center(3), B_center(3)
integer :: power_A(3), power_B(3),dim1
dim1=100
do j = 1, prim_num
A_center(1) = nucl_coord( prim_nucl(j), 1 )
A_center(2) = nucl_coord( prim_nucl(j), 2 )
A_center(3) = nucl_coord( prim_nucl(j), 3 )
power_A(1) = prim_power( j, 1 )
power_A(2) = prim_power( j, 2 )
power_A(3) = prim_power( j, 3 )
alpha = prim_expo(j)
do i = 1, prim_num
B_center(1) = nucl_coord( prim_nucl(i), 1 )
B_center(2) = nucl_coord( prim_nucl(i), 2 )
B_center(3) = nucl_coord( prim_nucl(i), 3 )
power_B(1) = prim_power( i, 1 )
power_B(2) = prim_power( i, 2 )
power_B(3) = prim_power( i, 3 )
beta = prim_expo(i)
call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1)
prim_overlap(i,j) = overlap
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, prim_ao_coef, (prim_num,ao_num)]
BEGIN_DOC
! Developement of the primitive on the AO basis
! prim_ao_coef(i,j) = <prim_i|AO_j>
END_DOC
implicit none
integer :: i,j,k,l
prim_ao_coef = 0.d0
do i = 1, prim_num
do j = 1, ao_num
if(ao_nucl(j).ne.prim_nucl(i))cycle
if(ao_l(j) == prim_l(i))then
if(ao_power(j,1) == prim_power(i,1) .and. &
ao_power(j,2) == prim_power(i,2) .and. &
ao_power(j,3) == prim_power(i,3) )then
! primitive of the same L than the AO
do k = 1, ao_prim_num(j)
if(ao_expo(j,k) == prim_expo(i))then
prim_ao_coef(i,j) += ao_coef(j,k)
endif
enddo
endif
endif
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, prim_ao_overlap, (ao_num,ao_num)]
implicit none
BEGIN_dOC
! Array of the overlap of the AO basis, explicitely calculated on the primitive basis
END_DOC
integer :: i,j,k,l
do i= 1, ao_num
do j = 1,ao_num
prim_ao_overlap(i,j) = 0.d0
do k = 1, prim_num
do l = 1, prim_num
prim_ao_overlap(i,j) += prim_ao_coef(k,i) * prim_overlap(k,l) * prim_ao_coef(l,j)
enddo
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, prim_mo_coef, (prim_num,mo_tot_num)]
BEGIN_DOC
! Developement of the primitive on the MO basis
! prim_ao_coef(i,j) = <prim(i)|ao(j)>
END_DOC
integer :: i,j,k,l
double precision :: coef
prim_mo_coef = 0.d0
do i = 1, mo_tot_num
do k = 1, ao_num
coef = mo_coef(k,i)
do l = 1, prim_num
prim_mo_coef(l,i) += coef * prim_ao_coef(l,k)
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, prim_mo_overlap, (mo_tot_num,mo_tot_num)]
implicit none
BEGIN_dOC
! Array of the overlap of the AO basis, explicitely calculated on the primitive basis
END_DOC
integer :: i,j,k,l
do i= 1, mo_tot_num
do j = 1,mo_tot_num
prim_mo_overlap(i,j) = 0.d0
do k = 1, prim_num
do l = 1, prim_num
prim_mo_overlap(i,j) += prim_mo_coef(k,i) * prim_overlap(k,l) * prim_mo_coef(l,j)
enddo
enddo
enddo
enddo
END_PROVIDER

View File

@ -0,0 +1,5 @@
primitive_basis
prim_num integer
prim_power integer (3,primitive_basis_prim_num)
prim_expo double precision (primitive_basis_prim_num)
prim_nucl integer (primitive_basis_prim_num)