Skip to content

Commit

Permalink
must write gradient outside of gradient function to preserve const
Browse files Browse the repository at this point in the history
  • Loading branch information
ahurta92 committed Jul 1, 2024
1 parent a15f76c commit 9a2d55f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/apps/moldft/moldft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ int main(int argc, char **argv) {
brho = calc.make_density(world, calc.bocc, calc.bmo);
rho.gaxpy(1.0, brho, 1.0);

if (calc.param.derivatives()) calc.derivatives(world, rho);
if (calc.param.derivatives()){
auto gradient=calc.derivatives(world, rho);
calc.e_data.add_gradient(gradient);
}
// automatically print dipole moment and output scf info
std::map<std::string, double> results;
results["scf_energy"] = calc.current_energy;
Expand Down
1 change: 0 additions & 1 deletion src/madness/chem/SCF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,6 @@ tensorT SCF::derivatives(World& world, const functionT& rho) const {
r[i * 3 + 2]);
}
}
e_data.add_gradient(r);
return r;
}

Expand Down

0 comments on commit 9a2d55f

Please sign in to comment.