Summary
When yukawa_potential = 1 is enabled and yukawa_lambda is not specified, the on-the-fly screening-length calculation can produce NaN values for the Yukawa DFT+U parameters U and J.
Environment
- ABACUS 3.10.1 (LCAO build)
- DFT+U with
yukawa_potential 1
yukawa_lambda omitted, so it is calculated automatically
- Collinear spin-polarized calculation (
nspin = 2)
Relevant INPUT settings are:
dft_plus_u 1
yukawa_potential 1
# yukawa_lambda is not specified
Observed behavior
The calculation reports non-finite Yukawa parameters, for example:
The same calculation becomes finite when an explicit positive screening parameter is supplied (for example, yukawa_lambda 0.7, in the corresponding input units).
Suspected cause
In source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp, the automatic screening calculation evaluates a fractional power of the real-space charge density, schematically:
double lambda_ir = 2 * pow(3 * rho_ir / ModuleBase::PI, 1.0 / 6.0);
Small negative values of rho_ir caused by numerical round-off make this fractional power NaN, which then propagates into the computed screening length and subsequently into U and J.
Suggested fix
Could the automatic screening calculation:
- protect the fractional power against tiny negative densities, e.g. by using a non-negative density with an appropriate tolerance;
- check the normalization/denominator before dividing; and
- emit a diagnostic error or warning if the density is invalid rather than silently returning NaN?
A regression test containing a small negative mesh-density value would help prevent recurrence.
Note on a related issue
The separate interaction between Yukawa DFT+U and uramping/u_converged() appears to be addressed by PR #7369, so this issue is limited to the NaN generated by the default screening-length path.
Summary
When
yukawa_potential = 1is enabled andyukawa_lambdais not specified, the on-the-fly screening-length calculation can produce NaN values for the Yukawa DFT+U parametersUandJ.Environment
yukawa_potential 1yukawa_lambdaomitted, so it is calculated automaticallynspin = 2)Relevant INPUT settings are:
Observed behavior
The calculation reports non-finite Yukawa parameters, for example:
The same calculation becomes finite when an explicit positive screening parameter is supplied (for example,
yukawa_lambda 0.7, in the corresponding input units).Suspected cause
In
source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp, the automatic screening calculation evaluates a fractional power of the real-space charge density, schematically:Small negative values of
rho_ircaused by numerical round-off make this fractional power NaN, which then propagates into the computed screening length and subsequently intoUandJ.Suggested fix
Could the automatic screening calculation:
A regression test containing a small negative mesh-density value would help prevent recurrence.
Note on a related issue
The separate interaction between Yukawa DFT+U and
uramping/u_converged()appears to be addressed by PR #7369, so this issue is limited to the NaN generated by the default screening-length path.