Skip to content

Commit

Permalink
Fix: change the unit of decay gradient (#3826)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongriTianqi committed Mar 28, 2024
1 parent 14b9827 commit 21a0a5d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ bool SpinConstrain<std::complex<double>, psi::DEVICE_CPU>::check_gradient_decay(
std::cout << "maximum gradient: " << std::endl;
for (int it = 0; it < ntype; it++)
{
std::cout << max_gradient[it] << std::endl;
std::cout << max_gradient[it]/ModuleBase::Ry_to_eV << std::endl;
}
}
for (int it = 0; it < ntype; it++)
{
if (this->decay_grad_[it] > 0 && std::abs(max_gradient[it]) < this->decay_grad_[it])
{
std::cout << "Reach limitation of current step ( maximum gradient < " << this->decay_grad_[it]
std::cout << "Reach limitation of current step ( maximum gradient < " << this->decay_grad_[it]/ModuleBase::Ry_to_eV // uB^2/Ry to uB^2/eV
<< " in atom type " << it << " ), exit." << std::endl;
return true;
}
Expand Down

0 comments on commit 21a0a5d

Please sign in to comment.