Commit 594d0137 authored by Victor Yu's avatar Victor Yu
Browse files

Simplify complex density matrix build

In the complex case, it is ok to take the square root of negative
numbers. Therefore, there is no need to check whether or not all
the occupation numbers are non-negative.
parent 0bd62e99
......@@ -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 "20201104")
SET(elsi_DATESTAMP "20201105")
### CMake modules ###
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
......
# ELSI - ELectronic Structure Infrastructure (v2.6.3)
# ELSI - ELectronic Structure Infrastructure (development)
## About
......
......@@ -21,7 +21,7 @@
\begin{document}
% Title
\title{\includegraphics[scale=0.07]{elsi_logo.png}\\ \vspace{0.5cm} \textbf{ELSI Interface Users' Guide\\ v2.6.3}}
\title{\includegraphics[scale=0.07]{elsi_logo.png}\\ \vspace{0.5cm} \textbf{ELSI Interface Users' Guide}}
\author{The ELSI Team\\ \url{https://elsi-interchange.org}}
\maketitle
......
......@@ -939,21 +939,9 @@ subroutine elsi_build_dm_edm_cmplx(ph,bh,factor,evec,dm,which)
alpha = (-1.0_r8,0.0_r8)
end if
! Methfessel-Paxton or energy density matrix may have negative factors
if(any(factor < 0.0_r8)) then
do i = 1,bh%n_lcol
call elsi_get_gid(bh%my_pcol,bh%n_pcol,bh%blk,i,gid)
if(gid <= ph%n_states_solve) then
tmp(:,i) = evec(:,i)*factor(gid)
end if
end do
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 if(any(factor > 0.0_r8)) then
if(any(factor /= 0.0_r8)) then
do i = 1,ph%n_states
if(factor(i) > 0.0_r8) then
if(factor(i) /= 0.0_r8) then
max_state = i
end if
end do
......@@ -962,7 +950,7 @@ subroutine elsi_build_dm_edm_cmplx(ph,bh,factor,evec,dm,which)
call elsi_get_gid(bh%my_pcol,bh%n_pcol,bh%blk,i,gid)
if(gid <= max_state) then
tmp(:,i) = evec(:,i)*sqrt(factor(gid))
tmp(:,i) = evec(:,i)*sqrt(cmplx(factor(gid),kind=r8))
end if
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