Skip to content

Commit

Permalink
fixing doubling the MOs in znemo after the iterations..
Browse files Browse the repository at this point in the history
  • Loading branch information
fbischoff committed Dec 3, 2023
1 parent 69ace58 commit d108709
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/apps/znemo/znemo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ int main(int argc, char** argv) {

// compute the energy to get converged orbitals
double energy=0.0;
if (not analyze_only) energy=znemo->value();
auto zmos=znemo->read_reference();
for (int i=0; i<znemo->get_cparam().nalpha(); ++i) znemo->amo.push_back(zmos.first.get_mos()[i]);
for (int i=0; i<znemo->get_cparam().nbeta(); ++i) znemo->bmo.push_back(zmos.second.get_mos()[i]);
energy=znemo->analyze();
if (not analyze_only) {
energy=znemo->value();
} else {
auto zmos=znemo->read_reference();
for (int i=0; i<znemo->get_cparam().nalpha(); ++i) znemo->amo.push_back(zmos.first.get_mos()[i]);
for (int i=0; i<znemo->get_cparam().nbeta(); ++i) znemo->bmo.push_back(zmos.second.get_mos()[i]);
energy=znemo->analyze();
}

if (world.rank()==0) {
printf("final energy %12.8f\n", energy);
Expand Down

0 comments on commit d108709

Please sign in to comment.