4
1
mirror of https://github.com/pfloos/quack synced 2024-11-19 12:32:36 +01:00

v1 of test col

This commit is contained in:
Abdallah Ammar 2023-11-17 10:54:53 +01:00
parent df72721855
commit 5e93c8bcc4

View File

@ -256,6 +256,8 @@ subroutine print_GHF(nBas,nBas2,nO,eHF,C,P,S,ENuc,ET,EV,EJ,EK,EGHF,dipole)
call vecout(nBas2,eHF) call vecout(nBas2,eHF)
write(*,*) write(*,*)
call print_GHFspin(nBas, nBas2, nO, C, S)
end subroutine end subroutine
! --- ! ---
@ -271,39 +273,27 @@ subroutine print_GHFspin(nBas, nBas2, nO, C, S)
double precision :: Na, Nb double precision :: Na, Nb
double precision :: nonco_z, contam_ghf double precision :: nonco_z, contam_ghf
double precision :: S2, Sz, Sz2 double precision :: S2, Sz, Sz2
double precision, allocatable :: Ca(:,:), Cb(:,:), Stmp(:,:) double precision, allocatable :: Ca(:,:), Cb(:,:)
double precision, allocatable :: Paa(:,:), Pab(:,:), Pba(:,:), Pbb(:,:) double precision, allocatable :: Paa(:,:), Pab(:,:), Pba(:,:), Pbb(:,:)
double precision, allocatable :: Mc(:,:), Eigc(:) double precision, allocatable :: Mc(:,:), Eigc(:)
! TODO print *, ' Spin properties for GHF WF:'
! Check Cab and Cba
allocate(Ca(nBas2,nBas), Cb(nBas2,nBas))
do i = 1, nBas allocate(Ca(nBas,nO), Cb(nBas,nO))
do j = 1, nBas2 do i = 1, nO
Ca(j,i) = C(j, i)
Cb(j,i) = C(j,nBas+i)
enddo
enddo
allocate(Stmp(nBas2,nBas2))
do i = 1, nBas
do j = 1, nBas do j = 1, nBas
Stmp( j, i) = S(j,i) Ca(j,i) = C( j,i)
Stmp( j,nBas+i) = S(j,i) Cb(j,i) = C(nBas+j,i)
Stmp(nBas+j, i) = S(j,i)
Stmp(nBas+j,nBas+i) = S(j,i)
enddo enddo
enddo enddo
! TODO DGEMM ! TODO DGEMM
allocate(Paa(nBas,nBas), Pab(nBas,nBas), Pba(nBas,nBas), Pbb(nBas,nBas)) allocate(Paa(nO,nO), Pab(nO,nO), Pba(nO,nO), Pbb(nO,nO))
Paa = matmul(transpose(Ca), matmul(Stmp, Ca)) Paa = matmul(transpose(Ca), matmul(S, Ca))
Pab = matmul(transpose(Ca), matmul(Stmp, Cb)) Pab = matmul(transpose(Ca), matmul(S, Cb))
Pba = matmul(transpose(Cb), matmul(Stmp, Ca)) Pba = matmul(transpose(Cb), matmul(S, Ca))
Pbb = matmul(transpose(Cb), matmul(Stmp, Cb)) Pbb = matmul(transpose(Cb), matmul(S, Cb))
deallocate(Stmp)
deallocate(Ca, Cb) deallocate(Ca, Cb)
Na = 0.d0 Na = 0.d0
@ -354,6 +344,7 @@ subroutine print_GHFspin(nBas, nBas2, nO, C, S)
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,j))
enddo enddo
enddo enddo
Mc(3,1) = Mc(1,3)
call diagonalize_matrix(3, Mc, Eigc) call diagonalize_matrix(3, Mc, Eigc)
print *, ' eigenvalues of Collinearity matrix:', Eigc print *, ' eigenvalues of Collinearity matrix:', Eigc