4
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 04:14:26 +01:00

FC for MP3

This commit is contained in:
Pierre-Francois Loos 2020-10-19 13:57:56 +02:00
parent bf7cc8dada
commit a5cf80f709
8 changed files with 70 additions and 58 deletions

BIN
GoDuck

Binary file not shown.

View File

@ -1,12 +1,17 @@
* define $QUACK_ROOT
* ninja
* opam
opam install ocamlc dune lacaml getopt zarith gmp alcotest
* cmake
* wget
* autoconf
* automake
* blas
* lapack
* ninja
* gfortran
* python3
* libtool
* opam
* cmake
* wget
* automake
- problems with libxc install
- make clean in $QUACK_ROOT does not work

View File

@ -1,7 +1,7 @@
# RHF UHF KS MOM
F F T F
T F F F
# MP2* MP3 MP2-F12
F F F
F T F
# CCD CCSD CCSD(T)
F F F
# drCCD rCCD lCCD pCCD

View File

@ -1,18 +1,18 @@
# HF: maxSCF thresh DIIS n_diis guess_type ortho_type
128 0.0000001 T 5 1 1
128 0.0000001 T 10 1 1
# MP:
# CC: maxSCF thresh DIIS n_diis
64 0.0000001 T 5
# spin: TDA singlet triplet spin_conserved spin_flip
T T T T T
F T F T T
# GF: maxSCF thresh DIIS n_diis lin eta renorm
256 0.00001 T 5 T 0.0 3
# GW/GT: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0
256 0.00001 T 5 T 0.0 F F F F F
# ACFDT: AC Kx XBS
T F T
F F T
# BSE: BSE dBSE dTDA evDyn
T T T F
F T T F
# MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift
1000000 100000 10 0.3 10000 1234 T

View File

@ -1,4 +1,4 @@
2
H 0.0 0.0 0.0
H 0.0 0.0 1.4
H 0.0 0.0 5.0

View File

@ -66,7 +66,7 @@ subroutine print_UHF(nBas,nO,Ov,e,c,ENuc,ET,EV,EJ,Ex,EUHF,dipole)
write(*,'(A40,1X,F16.10,A3)') ' Potential a energy: ',EV(1),' au'
write(*,'(A40,1X,F16.10,A3)') ' Potential b energy: ',EV(2),' au'
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A40,1X,F16.10,A3)') ' Two-electron a energy: ',sum(EJ(:)) + sum(Ex(:)),' au'
write(*,'(A40,1X,F16.10,A3)') ' Two-electron energy: ',sum(EJ(:)) + sum(Ex(:)),' au'
write(*,'(A40,1X,F16.10,A3)') ' Two-electron aa energy: ',EJ(1) + Ex(1),' au'
write(*,'(A40,1X,F16.10,A3)') ' Two-electron ab energy: ',EJ(2),' au'
write(*,'(A40,1X,F16.10,A3)') ' Two-electron bb energy: ',EJ(3) + Ex(2),' au'

View File

@ -1,4 +1,4 @@
subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
subroutine MP3(nBasin,nCin,nOin,nVin,nRin,ERI,e,ENuc,EHF)
! Perform third-order Moller-Plesset calculation
@ -6,10 +6,14 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
! Input variables
integer,intent(in) :: nBas,nEl
integer,intent(in) :: nBasin
integer,intent(in) :: nCin
integer,intent(in) :: nOin
integer,intent(in) :: nVin
integer,intent(in) :: nRin
double precision,intent(in) :: ENuc,EHF
double precision,intent(in) :: e(nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: e(nBasin)
double precision,intent(in) :: ERI(nBasin,nBasin,nBasin,nBasin)
! Local variables
@ -17,7 +21,11 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
double precision :: eps1,eps2,E3a,E3b,E3c
double precision :: EcMP3
integer :: nBas2,nO,nV
integer :: nBas
integer :: nC
integer :: nO
integer :: nV
integer :: nR
integer :: i,j,k,l,a,b,c,d
double precision,allocatable :: se(:)
@ -44,32 +52,31 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
! Spatial to spin orbitals
nBas2 = 2*nBas
nBas = 2*nBasin
nC = 2*nCin
nO = 2*nOin
nV = 2*nVin
nR = 2*nRin
allocate(se(nBas2),sERI(nBas2,nBas2,nBas2,nBas2))
allocate(se(nBas),sERI(nBas,nBas,nBas,nBas))
call spatial_to_spin_MO_energy(nBas,e,nBas2,se)
call spatial_to_spin_ERI(nBas,ERI,nBas2,sERI)
call spatial_to_spin_MO_energy(nBasin,e,nBas,se)
call spatial_to_spin_ERI(nBasin,ERI,nBas,sERI)
! Antysymmetrize ERIs
allocate(dbERI(nBas2,nBas2,nBas2,nBas2))
allocate(dbERI(nBas,nBas,nBas,nBas))
call antisymmetrize_ERI(2,nBas2,sERI,dbERI)
call antisymmetrize_ERI(2,nBas,sERI,dbERI)
deallocate(sERI)
! Define occupied and virtual spaces
nO = nEl
nV = nBas2 - nO
! Form energy denominator
allocate(eO(nO),eV(nV))
eO(:) = se(1:nO)
eV(:) = se(nO+1:nBas2)
eV(:) = se(nO+1:nBas)
deallocate(se)
@ -77,11 +84,11 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
allocate(OOOO(nO,nO,nO,nO),OOVV(nO,nO,nV,nV),OVVO(nO,nV,nV,nO),VVOO(nV,nV,nO,nO),VVVV(nV,nV,nV,nV))
OOOO(:,:,:,:) = dbERI( 1:nO , 1:nO , 1:nO , 1:nO )
OOVV(:,:,:,:) = dbERI( 1:nO , 1:nO ,nO+1:nBas2,nO+1:nBas2)
OVVO(:,:,:,:) = dbERI( 1:nO ,nO+1:nBas2,nO+1:nBas2, 1:nO )
VVOO(:,:,:,:) = dbERI(nO+1:nBas2,nO+1:nBas2, 1:nO , 1:nO )
VVVV(:,:,:,:) = dbERI(nO+1:nBas2,nO+1:nBas2,nO+1:nBas2,nO+1:nBas2)
OOOO(:,:,:,:) = dbERI( 1:nO , 1:nO , 1:nO , 1:nO )
OOVV(:,:,:,:) = dbERI( 1:nO , 1:nO ,nO+1:nBas,nO+1:nBas)
OVVO(:,:,:,:) = dbERI( 1:nO ,nO+1:nBas,nO+1:nBas, 1:nO )
VVOO(:,:,:,:) = dbERI(nO+1:nBas,nO+1:nBas, 1:nO , 1:nO )
VVVV(:,:,:,:) = dbERI(nO+1:nBas,nO+1:nBas,nO+1:nBas,nO+1:nBas)
deallocate(dbERI)
@ -89,10 +96,10 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
E2 = 0d0
do i=1,nO
do j=1,nO
do a=1,nV
do b=1,nV
do i=nC+1,nO
do j=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
eps = eO(i) + eO(j) - eV(a) - eV(b)
@ -109,12 +116,12 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
E3a = 0d0
do i=1,nO
do j=1,nO
do k=1,nO
do l=1,nO
do a=1,nV
do b=1,nV
do i=nC+1,nO
do j=nC+1,nO
do k=nC+1,nO
do l=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
eps1 = eO(i) + eO(j) - eV(a) - eV(b)
eps2 = eO(k) + eO(l) - eV(a) - eV(b)
@ -130,12 +137,12 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
E3b = 0d0
do i=1,nO
do j=1,nO
do a=1,nV
do b=1,nV
do c=1,nV
do d=1,nV
do i=nC+1,nO
do j=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
do c=1,nV-nR
do d=1,nV-nR
eps1 = eO(i) + eO(j) - eV(a) - eV(b)
eps2 = eO(i) + eO(j) - eV(c) - eV(d)
@ -151,12 +158,12 @@ subroutine MP3(nBas,nEl,ERI,e,ENuc,EHF)
E3c = 0d0
do i=1,nO
do j=1,nO
do k=1,nO
do a=1,nV
do b=1,nV
do c=1,nV
do i=nC+1,nO
do j=nC+1,nO
do k=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
do c=1,nV-nR
eps1 = eO(i) + eO(j) - eV(a) - eV(b)
eps2 = eO(i) + eO(k) - eV(a) - eV(c)

View File

@ -473,7 +473,7 @@ program QuAcK
else
call MP3(nBas,nEl,ERI_MO,eHF,ENuc,ERHF)
call MP3(nBas,nC,nO,nV,nR,ERI_MO,eHF,ENuc,ERHF)
end if