Skip to content

Conversation

@WHUweiqingzhou
Copy link
Collaborator

Fix #6128
Fix #6086

Because the tolerance for negative values in numerical stability calculations is uncertain, I'm not sure whether to add a warning or a warningQuit here.

chr->rhog[1][ig] = 0.5 * (rhog_mag[ig] - rhog_mag[ig+npw]);
if (chr->rhog[1][ig] < 0.0)
{
ModuleBase::WARNING_QUIT("Charge_Mixing", "Magnetism is larger than Charge at some grid, please try a smaller mixing_beta_mag!");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use "max(0.0, rhog[is][ig])" rather than if and warning_quit

@mohanchen
Copy link
Collaborator

reopen it if needed

@mohanchen mohanchen closed this Jan 6, 2026
@WHUweiqingzhou WHUweiqingzhou reopened this Jan 6, 2026
@mohanchen mohanchen added Refactor Refactor ABACUS codes Bugs Bugs that only solvable with sufficient knowledge of DFT labels Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative beta rho in DFT calculations outlying behavior when running with 2 cores for mixing kinetic energy density

3 participants