Commit c229916b authored by Victor Yu's avatar Victor Yu
Browse files

Update density matrix build

The code should now be able to handle a special case where the occupation
numbers are like 0, ..., 0, 1, ..., 1, 0, ..., 0.
parent a916cceb
......@@ -7,7 +7,7 @@ SET(elsi_URL "http://elsi-interchange.org")
SET(elsi_EMAIL "elsi-team@duke.edu")
SET(elsi_LICENSE "BSD 3")
SET(elsi_DESCRIPTION "Electronic Structure Infrastructure")
SET(elsi_DATESTAMP "20201030")
SET(elsi_DATESTAMP "20201101")
### CMake modules ###
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
......
......@@ -828,7 +828,11 @@ subroutine elsi_build_dm_edm_real(ph,bh,factor,evec,dm,which)
call pdgemm("N","T",ph%n_basis,ph%n_basis,ph%n_states_solve,alpha,tmp,1,&
1,bh%desc,evec,1,1,bh%desc,0.0_r8,dm,1,1,bh%desc)
else
max_state = count(factor > 0.0_r8)
do i = 1,ph%n_states
if(factor(i) > 0.0_r8) then
max_state = i
end if
end do
do i = 1,bh%n_lcol
call elsi_get_gid(bh%my_pcol,bh%n_pcol,bh%blk,i,gid)
......@@ -943,7 +947,11 @@ subroutine elsi_build_dm_edm_cmplx(ph,bh,factor,evec,dm,which)
call pzgemm("N","C",ph%n_basis,ph%n_basis,ph%n_states_solve,alpha,tmp,1,&
1,bh%desc,evec,1,1,bh%desc,(0.0_r8,0.0_r8),dm,1,1,bh%desc)
else
max_state = count(factor > 0.0_r8)
do i = 1,ph%n_states
if(factor(i) > 0.0_r8) then
max_state = i
end if
end do
do i = 1,bh%n_lcol
call elsi_get_gid(bh%my_pcol,bh%n_pcol,bh%blk,i,gid)
......
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