Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/DFTsolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ int DFTsolver<OrbitalsType>::solve(OrbitalsType& orbitals,
const bool ortho
= (ct.getOrthoType() == OrthoType::Eigenfunctions || orthof);

if (!ortho)
if (!ortho || !ct.fullyOccupied())
{
// strip dm from the overlap contribution
// dm <- Ls**T * dm * Ls
Expand All @@ -337,7 +337,14 @@ int DFTsolver<OrbitalsType>::solve(OrbitalsType& orbitals,
}
else
{
orbitals.orthonormalizeLoewdin();
bool updateDM = false;
if (!ct.fullyOccupied())
{
orbitals.computeGramAndInvS();
dm_strategy_->dressDM();
updateDM = true;
}
orbitals.orthonormalizeLoewdin(true, nullptr, updateDM);

orbitals_stepper_->restartMixing();
}
Expand Down
15 changes: 11 additions & 4 deletions src/ProjectedMatrices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,14 @@ void ProjectedMatrices<MatrixType>::updateDM(const int iterative_index)

#ifndef NDEBUG
double nel = getNel();
std::cout << "ProjectedMatrices<MatrixType>::updateDM(), nel = " << nel
<< std::endl;
if (mmpi.instancePE0())
std::cout << "ProjectedMatrices<MatrixType>::updateDM(), nel = " << nel
<< std::endl;
assert(std::isfinite(nel));
double energy = getExpectationH();
std::cout << "ProjectedMatrices<MatrixType>::updateDM(), energy = "
<< energy << std::endl;
if (mmpi.instancePE0())
std::cout << "ProjectedMatrices<MatrixType>::updateDM(), energy = "
<< energy << std::endl;
#endif
}

Expand Down Expand Up @@ -935,6 +937,11 @@ void ProjectedMatrices<MatrixType>::computeLoewdinTransform(

if (transform_matrices)
{
Control& ct = *(Control::instance());
MGmol_MPI& mmpi = *(MGmol_MPI::instance());
if (mmpi.instancePE0() && ct.verbose > 1)
std::cout << "Transform DM to reflect Loewdin orthonormalization"
<< std::endl;
assert(sqrtMat);

// transform DM to reflect Loewdin orthonormalization
Expand Down
1 change: 1 addition & 0 deletions tests/MVP/mvp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type=QUENCH
solver=PSD
max_steps=300
atol=1.e-7
ortho_freq=10
[Orbitals]
nempty=10
initial_type=random
Expand Down