From 002e653cbb1c815a9efbafd48387112e5e0f6e4a Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Mon, 23 Mar 2020 08:53:19 +0100 Subject: [PATCH] fix bug in eDFT --- input/basis | 38 ++++++++------------------ input/methods | 2 +- input/molecule | 4 +-- input/molecule.xyz | 2 +- input/weight | 38 ++++++++------------------ src/eDFT/GOK_RKS.f90 | 1 - src/eDFT/eDFT.f90 | 4 +++ src/eDFT/restricted_density_matrix.f90 | 6 ++-- src/eDFT/test_explicit.f90 | 2 +- 9 files changed, 37 insertions(+), 60 deletions(-) diff --git a/input/basis b/input/basis index 1ea2746..c08616f 100644 --- a/input/basis +++ b/input/basis @@ -1,30 +1,16 @@ 1 6 -S 8 - 1 2940.0000000 0.0006800 - 2 441.2000000 0.0052360 - 3 100.5000000 0.0266060 - 4 28.4300000 0.0999930 - 5 9.1690000 0.2697020 - 6 3.1960000 0.4514690 - 7 1.1590000 0.2950740 - 8 0.1811000 0.0125870 -S 8 - 1 2940.0000000 -0.0001230 - 2 441.2000000 -0.0009660 - 3 100.5000000 -0.0048310 - 4 28.4300000 -0.0193140 - 5 9.1690000 -0.0532800 - 6 3.1960000 -0.1207230 - 7 1.1590000 -0.1334350 - 8 0.1811000 0.5307670 +S 4 + 1 234.0000000 0.0025870 + 2 35.1600000 0.0195330 + 3 7.9890000 0.0909980 + 4 2.2120000 0.2720500 S 1 - 1 0.0589000 1.0000000 -P 3 - 1 3.6190000 0.0291110 - 2 0.7110000 0.1693650 - 3 0.1951000 0.5134580 + 1 0.6669000 1.0000000 +S 1 + 1 0.2089000 1.0000000 P 1 - 1 0.0601800 1.0000000 + 1 3.0440000 1.0000000 +P 1 + 1 0.7580000 1.0000000 D 1 - 1 0.2380000 1.0000000 - + 1 1.9650000 1.0000000 diff --git a/input/methods b/input/methods index 7e8729e..a8010f9 100644 --- a/input/methods +++ b/input/methods @@ -3,7 +3,7 @@ # MP2 MP3 MP2-F12 T F F # CCD CCSD CCSD(T) drCCD rCCD lCCD pCCD - F F F T F T T + F T F F F F F # CIS RPA RPAx ppRPA ADC F F F F F # G0F2 evGF2 G0F3 evGF3 diff --git a/input/molecule b/input/molecule index 6a6f6d1..c78e87e 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,4 @@ # nAt nEla nElb nCore nRyd - 1 2 2 0 0 + 1 1 1 0 0 # Znuc x y z - Be 0.0 0.0 0.0 + He 0.0 0.0 0.0 diff --git a/input/molecule.xyz b/input/molecule.xyz index 8023e37..797b5fc 100644 --- a/input/molecule.xyz +++ b/input/molecule.xyz @@ -1,3 +1,3 @@ 1 - Be 0.0000000000 0.0000000000 0.0000000000 + He 0.0000000000 0.0000000000 0.0000000000 diff --git a/input/weight b/input/weight index 1ea2746..c08616f 100644 --- a/input/weight +++ b/input/weight @@ -1,30 +1,16 @@ 1 6 -S 8 - 1 2940.0000000 0.0006800 - 2 441.2000000 0.0052360 - 3 100.5000000 0.0266060 - 4 28.4300000 0.0999930 - 5 9.1690000 0.2697020 - 6 3.1960000 0.4514690 - 7 1.1590000 0.2950740 - 8 0.1811000 0.0125870 -S 8 - 1 2940.0000000 -0.0001230 - 2 441.2000000 -0.0009660 - 3 100.5000000 -0.0048310 - 4 28.4300000 -0.0193140 - 5 9.1690000 -0.0532800 - 6 3.1960000 -0.1207230 - 7 1.1590000 -0.1334350 - 8 0.1811000 0.5307670 +S 4 + 1 234.0000000 0.0025870 + 2 35.1600000 0.0195330 + 3 7.9890000 0.0909980 + 4 2.2120000 0.2720500 S 1 - 1 0.0589000 1.0000000 -P 3 - 1 3.6190000 0.0291110 - 2 0.7110000 0.1693650 - 3 0.1951000 0.5134580 + 1 0.6669000 1.0000000 +S 1 + 1 0.2089000 1.0000000 P 1 - 1 0.0601800 1.0000000 + 1 3.0440000 1.0000000 +P 1 + 1 0.7580000 1.0000000 D 1 - 1 0.2380000 1.0000000 - + 1 1.9650000 1.0000000 diff --git a/src/eDFT/GOK_RKS.f90 b/src/eDFT/GOK_RKS.f90 index 5cc8c56..f2adb51 100644 --- a/src/eDFT/GOK_RKS.f90 +++ b/src/eDFT/GOK_RKS.f90 @@ -288,7 +288,6 @@ subroutine GOK_RKS(restart,x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGrid,weight,maxS ! Correlation energy call restricted_correlation_energy(c_rung,c_DFA,nEns,wEns(:),nGrid,weight(:),rhow(:),drhow(:,:),Ec) -! print*,'Done with restricted_correlation_energy' ! Total energy diff --git a/src/eDFT/eDFT.f90 b/src/eDFT/eDFT.f90 index a00e1ce..333a77e 100644 --- a/src/eDFT/eDFT.f90 +++ b/src/eDFT/eDFT.f90 @@ -56,6 +56,10 @@ program eDFT write(*,*) '******************************************' write(*,*) +! Test numgrid + +! call test_numgrid() + !------------------------------------------------------------------------ ! Read input information !------------------------------------------------------------------------ diff --git a/src/eDFT/restricted_density_matrix.f90 b/src/eDFT/restricted_density_matrix.f90 index a5add09..2fd36a8 100644 --- a/src/eDFT/restricted_density_matrix.f90 +++ b/src/eDFT/restricted_density_matrix.f90 @@ -24,15 +24,17 @@ subroutine restricted_density_matrix(nBas,nEns,nO,c,P) ! Ground state density matrix iEns = 1 + P(:,:,iEns) = 2d0*matmul(c(:,1:nO),transpose(c(:,1:nO))) ! Doubly-excited state density matrix iEns = 2 + if(nO > 1) then - P(:,:,iEns) = 2d0*matmul(c(:,1:nO-1),transpose(c(:,1:nO-1))) - + else + P(:,:,iEns) = 0d0 end if P(:,:,iEns) = P(:,:,iEns) + 2d0*matmul(c(:,nO+1:nO+1),transpose(c(:,nO+1:nO+1))) diff --git a/src/eDFT/test_explicit.f90 b/src/eDFT/test_explicit.f90 index 2214109..87cd777 100644 --- a/src/eDFT/test_explicit.f90 +++ b/src/eDFT/test_explicit.f90 @@ -69,7 +69,7 @@ subroutine test_numgrid alpha_min(2) = 0.2753d0 alpha_min(3) = 1.185d0 - open(unit=io_unit, file='../test/reference_grid/cc-pVDZ.txt', access='sequential', action='read') + open(unit=io_unit, file='/Users/loos/Work/numgrid/test/reference_grid/cc-pVDZ.txt', access='sequential', action='read') context = numgrid_new_atom_grid(radial_precision, & min_num_angular_points, &