4
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 20:35:36 +01:00

fixed the wrong-spin removal/addition problem

This commit is contained in:
Clotilde Marut 2020-07-26 17:56:25 +02:00
parent d1c24948dd
commit 9f34d27502
3 changed files with 17 additions and 17 deletions

View File

@ -21,7 +21,7 @@
# Ensemble weights: wEns(1),...,wEns(nEns-1)
0.00 0.00
# Parameters for CC weight-dependent exchange functional
0.420243 0.0700561 -0.288301
0.135068 -0.00774769 -0.0278205
0.420431 0.069097 -0.295049
0.135075 -0.00770826 -0.028057
# GOK-DFT: maxSCF thresh DIIS n_diis guess_type ortho_type
32 0.00001 T 5 1 1
500 0.00001 T 5 1 1

View File

@ -32,19 +32,19 @@ subroutine unrestricted_auxiliary_energy(nBas,nEns,nO,eps,Eaux)
iEns = 2
Eaux(1,iEns) = sum(eps(1:nO(1),1))
Eaux(2,iEns) = sum(eps(1:nO(2),2))
if(nO(2) > 1) then
Eaux(2,iEns) = sum(eps(1:nO(2)-1,2))
if(nO(1) > 1) then
Eaux(1,iEns) = sum(eps(1:nO(1)-1,1))
else
Eaux(2,iEns) = 0d0
Eaux(1,iEns) = 0d0
end if
! (N+1)-electron ground state
iEns = 3
Eaux(1,iEns) = sum(eps(1:nO(1)+1,1))
Eaux(2,iEns) = sum(eps(1:nO(2),2))
Eaux(2,iEns) = sum(eps(1:nO(2)+1,2))
Eaux(1,iEns) = sum(eps(1:nO(1),1))
end subroutine unrestricted_auxiliary_energy

View File

@ -29,19 +29,19 @@ subroutine unrestricted_density_matrix(nBas,nEns,nO,c,P)
P(:,:,ispin,iEns) = matmul(c(:,1:nO(ispin),ispin),transpose(c(:,1:nO(ispin),ispin)))
end do
! (N-1)-electron state: remove spin-down electrons
! (N-1)-electron state: remove spin-up electrons
iEns = 2
P(:,:,1,iEns) = matmul(c(:,1:nO(1) ,1),transpose(c(:,1:nO(1) ,1)))
if (nO(2) > 1) then
P(:,:,2,iEns) = matmul(c(:,1:nO(2)-1,2),transpose(c(:,1:nO(2)-1,2)))
P(:,:,2,iEns) = matmul(c(:,1:nO(2),2),transpose(c(:,1:nO(2),2)))
if (nO(1) > 1) then
P(:,:,1,iEns) = matmul(c(:,1:nO(1)-1,1),transpose(c(:,1:nO(1)-1,1)))
else
P(:,:,2,iEns) = 0.d0
P(:,:,1,iEns) = 0.d0
end if
! (N+1)-electron state: remove spin-up electrons
! (N+1)-electron state: remove spin-down electrons
iEns = 3
P(:,:,1,iEns) = matmul(c(:,1:nO(1)+1,1),transpose(c(:,1:nO(1)+1,1)))
P(:,:,2,iEns) = matmul(c(:,1:nO(2) ,2),transpose(c(:,1:nO(2) ,2)))
P(:,:,2,iEns) = matmul(c(:,1:nO(2)+1,2),transpose(c(:,1:nO(2)+1,2)))
P(:,:,1,iEns) = matmul(c(:,1:nO(1),1),transpose(c(:,1:nO(1),1)))
end subroutine unrestricted_density_matrix