From 1e21d8ff560504e04e5589fa96634355392e5197 Mon Sep 17 00:00:00 2001 From: Abdallah Ammar Date: Fri, 17 Nov 2023 11:08:38 +0100 Subject: [PATCH] fixed bug in Spin-GHF --- src/HF/print_GHF.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HF/print_GHF.f90 b/src/HF/print_GHF.f90 index aa958be..1eab043 100644 --- a/src/HF/print_GHF.f90 +++ b/src/HF/print_GHF.f90 @@ -266,13 +266,13 @@ subroutine print_GHFspin(nBas, nBas2, nO, C, S) contam_ghf = 0.d0 do j = 1, nO do i = 1, nO - contam_ghf = contam_ghf - (Pab(i,i)*Pba(j,j) - Pab(i,j)*Pba(j,i)) + contam_ghf = contam_ghf + (Pab(i,i)*Pba(j,j) - Pab(i,j)*Pba(j,i)) enddo enddo Sz = 0.5d0 * (Na - Nb) Sz2 = Sz*Sz + nonco_z - S2 = Sz * (Sz + 1.d0) + nonco_z + contam_ghf + S2 = 0.5d0 * (Na + Nb) * (Sz + 1.d0) + nonco_z + contam_ghf print *, 'Sz, Sz^2 = ', Sz, Sz2 print *, 'S^2 = ', S2 @@ -293,7 +293,7 @@ subroutine print_GHFspin(nBas, nBas2, nO, C, S) Mc(1,1) = Mc(1,1) - 0.25d0 * (Pba(i,j) + Pab(i,j))**2 Mc(2,2) = Mc(2,2) - 0.25d0 * (Pba(i,j) - Pab(i,j))**2 Mc(3,3) = Mc(3,3) - 0.25d0 * (Paa(i,j) - Pbb(i,j))**2 - Mc(1,3) = Mc(1,3) - 0.25d0 * (Pab(i,j) + Pba(i,j))*(Paa(j,i) - Pbb(j,j)) + Mc(1,3) = Mc(1,3) - 0.25d0 * (Pab(i,j) + Pba(i,j))*(Paa(j,i) - Pbb(j,i)) enddo enddo Mc(3,1) = Mc(1,3)