Commit 17b9041e authored by Gregor Michalicek's avatar Gregor Michalicek

Add exchange matrix to the correct triangle of the Hamiltonian and use subvxc on correct triangle

+ add some debug output in hybrid branch
parent 4e312069
......@@ -129,8 +129,20 @@ CONTAINS
CALL eigen_hssetup(jsp,mpi,DIMENSION,hybrid,enpara,input,vacuum,noco,sym,&
stars,cell,sphhar,atoms,ud,td,v,lapw,l_real,smat,hmat)
CALL timestop("Setup of H&S matrices")
IF(hybrid%l_hybrid) THEN
DO i = 1, hmat%matsize1
DO j = 1, i
IF (hmat%l_real) THEN
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1233,'(2i7,2f15.8)') i, j, hmat%data_r(i,j), hmat%data_r(j,i)
END IF
ELSE
ENDIF
END DO
END DO
! Write overlap matrix smat to direct access file olap
print *,"Wrong overlap matrix used, fix this later"
CALL write_olap(smat,(jsp-1)*kpts%nkpt+nk) ! Note: At this moment this only works without MPI parallelization
......
......@@ -83,9 +83,13 @@ MODULE m_add_vnonlocal
DO n = 1, v_x%matsize1
DO nn = 1, n
IF (hmat%l_real) THEN
hmat%data_r(n,nn) = hmat%data_r(n,nn) - a_ex*v_x%data_r(n,nn)
hmat%data_r(nn,n) = hmat%data_r(nn,n) - a_ex*v_x%data_r(nn,n)
IF ((n.LE.5).AND.(nn.LE.5)) THEN
WRITE(1234,'(2i7,4f15.8)') n, nn, hmat%data_r(n,nn), hmat%data_r(nn,n), v_x%data_r(n,nn), v_x%data_r(nn,n)
WRITE(1236,'(2i7,2f15.8)') n, nn, v_x%data_r(n,nn), v_x%data_r(nn,n)
END IF
ELSE
hmat%data_c(n,nn) = hmat%data_c(n,nn) - a_ex*v_x%data_c(n,nn)
hmat%data_c(nn,n) = hmat%data_c(nn,n) - a_ex*v_x%data_c(nn,n)
ENDIF
END DO
END DO
......
......@@ -224,6 +224,18 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
CALL timestop("time for performing T^-1*mat_ex*T^-1*")
CALL symmetrizeh(atoms,kpts%bkf(:,nk),dimension,jsp,lapw,gpt,sym,hybdat%kveclo_eig,cell,nsymop,psym,v_x)
DO i = 1, v_x%matsize1
DO j = 1, i
IF (v_x%l_real) THEN
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1232,'(2i7,2f15.8)') i, j, v_x%data_r(i,j), v_x%data_r(j,i)
END IF
ELSE
ENDIF
END DO
END DO
CALL write_v_x(v_x,kpts%nkpt*(jsp-1) + nk)
END IF ! hybrid%l_calhf
......
......@@ -493,9 +493,12 @@ CONTAINS
DO nn = 1, n
i = i + 1
IF (hmat%l_real) THEN
hmat%data_r(n,nn) = hmat%data_r(n,nn) - a_ex*REAL(vxc(i))
hmat%data_r(nn,n) = hmat%data_r(nn,n) - a_ex*REAL(vxc(i))
IF ((n.LE.5).AND.(nn.LE.5)) THEN
WRITE(1235,'(2i7,3f15.8)') n, nn, hmat%data_r(n,nn), hmat%data_r(nn,n), REAL(vxc(i))
END IF
ELSE
hmat%data_c(n,nn) = hmat%data_c(n,nn) - a_ex*vxc(i)
hmat%data_c(nn,n) = hmat%data_c(nn,n) - a_ex*vxc(i)
ENDIF
END DO
END DO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment