Skip to content

SDFT: TSRelative Chebyshev Precision is abnormally large (orders of magnitude above NeRelative) #8380

In review

Description

@LiYuqiii

Describe the bug

Summary

At high electronic temperature, esolver_type sdft reports a wildly wrong entropy term while the electron number of the same Chebyshev run looks perfectly converged. For one SCF step of the input below the log prints

NeRelative Chebyshev Precision: 5.11834e-06E-09     # = 5.1e-15
TSRelative Chebyshev Precision: 7.25973e+08E-09     # = 0.73   (73 % relative error)
  E_entropy(-TS) -128255844.5287994593 -1745010287.3937978745   # Ry
 !FINAL_ETOT_IS -1745008358.044205 eV

i.e. a single Si atom ends up with a total energy of -1.7e9 eV and an entropy term of -1.3e8 Ry, while the same run reports its Chebyshev lower bound as positive (New Emin 89.1701 Ry), above every bound state of the cell. Because the printed TSRelative is the only convergence indicator available for the stochastic part, the user has no way to notice this from the log.

fig3_ts_text fig4_ts_bars

Observed

$ grep -E 'Relative|E_entropy' OUT.autotest/running_scf.log
NeRelative Chebyshev Precision: 3.7386e-07E-09      # = 3.7e-16
TSRelative Chebyshev Precision: 7.81354e+08E-09     # = 0.78
NeRelative Chebyshev Precision: 5.11834e-06E-09     # = 5.1e-15
TSRelative Chebyshev Precision: 7.25973e+08E-09     # = 0.73
  E_entropy(-TS) -128255844.5287994593 -1745010287.3937978745

$ grep 'new Emin' OUT.autotest/running_scf.log
New Emax Ry822.605 ; new Emin 89.1701 Ry             <-- Emin is positive

$ grep 'FINAL_ETOT_IS' OUT.autotest/running_scf.log
 !FINAL_ETOT_IS -1745008358.044205 eV
  • Ne and -TS are two Chebyshev traces of the same Hamiltonian evaluated in the same step, yet
    their relative errors differ by 14 orders of magnitude.
  • The Chebyshev interval [89.17, 822.6] Ry does not contain the occupied part of the spectrum, so
    the polynomial expansion is evaluated far outside [-1, 1] for those states.
  • Nothing in the output flags this: the run reports #SCF IS CONVERGED# and finishes normally.
  • The same asymmetry is seen on the warm-dense-carbon production setup that motivated the report
    (ecutwfc 900, nche_sto 40, nbands_sto 40, smearing_sigma 25.57754484, ABACUS 3.11.0-beta10,
    8 atoms): NeRelative = 1.0e-15, TSRelative = 1.1, E_entropy(-TS) = -7.58e5 / -1.03e7 Ry.

Expected behavior

  • Ne and -TS computed from the same Chebyshev expansion should have comparable relative accuracy, and the printed NeRelative / TSRelative values should be usable as convergence indicators.
  • E_entropy(-TS) should be stable with respect to nche_sto and to the choice of the Chebyshev interval.

To Reproduce

Si.pz-vbc.UPF from tests/PP_ORB: 1 Si atom in a 5 bohr cubic cell, Γ point, symmetry 1.

INPUT:

INPUT_PARAMETERS
suffix            autotest
calculation       scf
esolver_type      sdft
method_sto        2
nbands            10
nbands_sto        20
nche_sto          40         # small on purpose: shows the tail problem faster
emin_sto          0
emax_sto          0
seed_sto          20000
pseudo_dir        ../../PP_ORB
pw_seed           1
symmetry          1
ecutwfc           900        # large ecut => large spectral range
scf_thr           1e-5
scf_nmax          2          # two steps are enough to see it
basis_type        pw
smearing_method   fd
smearing_sigma    25.57754484   # 348 eV
mixing_type       broyden
mixing_beta       0.4
out_dos           0
npart_sto         1

STRU and KPT:

ATOMIC_SPECIES
Si 14 Si.pz-vbc.UPF

LATTICE_CONSTANT
5

LATTICE_VECTORS
1 0 0
0 1 0
0 0 1

ATOMIC_POSITIONS
Direct
Si
0.0
1
0.00 0.00 0.00 1 1 1
K_POINTS
0
Gamma
1 1 1 0 0 0

Environment

  • ABACUS develop @ 503be43 (v3.11.0-beta13), CPU build (abacus_pw_para), GNU 11.4.0, OpenMPI 5.0.10
  • mpirun -np 4, Γ point only

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Activity

  1. added
    Bugs
    on Nov 24, 2026
  2. added theissue type on Nov 24, 2026
  3. ABACUS-PR-BOT commented on Nov 24, 2026

    @ABACUS-PR-BOT
    Collaborator

    The method-2 NeRelative/TSRelative diagnostic has a definite operand/stride bug at 503be43, so these printed values cannot be treated as verified relative errors. That bug does not directly change the entropy value; the reported -1.3e8 Ry therefore requires a separate numerical diagnosis.

    Stochastic_Iter::dot ignores its x, y, incx, and incy arguments. The method-2 precision check requests the last row and column of the polynomial Gram matrix, but receives the first contiguous column twice. The actual entropy trace uses the separate vTMv path. A regression for the diagnostic should compare its last-order contribution with the independently computed difference between the full quadratic form and the same form with the final coefficient removed. Even after correction, this remains a last-order indicator, not a bound on total truncation or stochastic error.

    There is no mathematical requirement for number and entropy to have comparable relative truncation errors: they use different scalar functions and denominators. Here the root-occupation and root-entropy functions also have different tail cutoffs. The positive lower bound alone does not establish the cause in a mixed calculation with ten explicit KS states. Spectral containment, residual projection accuracy, and independent entropy/order convergence need validation against a known-spectrum reference and the original input.

    The source does emit a warning when the TS indicator exceeds 1e-4, but WARNING writes to warning.log rather than running_scf.log or stdout, and it does not stop SCF. SCF convergence is therefore not an entropy-accuracy certificate.

    The inspected #8382 head f8b4f78 and Draft #8383 head a5a9bf5 still contain that hardcoded dot call. The diagnostic correction remains outstanding in those snapshots, and neither proposal is merged into the inspected develop revision. Their numerical results remain author-reported.

    Static review only; no builds or runtime tests were run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugs

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions