Skip to content

Fix: Remove nonzero tails beyond spherical Bessel projector cutoffs (Useful Information for updating DeePKS benchmark data)#7673

Merged
mohanchen merged 4 commits into
deepmodeling:developfrom
AsTonyshment:deepks_td
Jul 24, 2026
Merged

Fix: Remove nonzero tails beyond spherical Bessel projector cutoffs (Useful Information for updating DeePKS benchmark data)#7673
mohanchen merged 4 commits into
deepmodeling:developfrom
AsTonyshment:deepks_td

Conversation

@AsTonyshment

@AsTonyshment AsTonyshment commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes generated DeePKS spherical-Bessel projector files that contained nonzero oscillatory samples beyond their declared cutoff radius. It preserves the requested radial spacing, keeps generated output meshes compatible with Simpson integration, repairs the affected versioned projector files, warns about inconsistent orbital metadata during reading, and refreshes all numerical references affected by the corrected projectors.

Background

Bessel_Basis::init_TableOne() extends its internal radial mesh with auxiliary points for Simpson integration. The same mesh was previously written directly to jle.orb, so a file declaring a 2.0 Bohr cutoff and a 0.01 Bohr spacing could contain 205 points and extend to 2.04 Bohr. Because the spherical Bessel function grows again after its zero at the cutoff, those extra points formed a nonzero tail and caused inconsistent results between grid and two-center projector integrations.

image

Changes

  • Preserve the original dr when writing generated projectors.
  • When the cutoff lies on the radial grid and the exact-cutoff mesh contains an odd number of points, set Mesh so that $(\mathrm{Mesh}-1)dr=r_{\mathrm{cut}}$ and omit auxiliary integration points from the file.
  • When the exact-cutoff mesh would contain an even number of points, retain one additional zero-valued sample at $r_{\mathrm{cut}}+dr$ so that the output mesh remains compatible with Simpson integration.
  • When the cutoff does not lie on the grid, retain the existing mesh but write zero for every sample beyond $r_{\mathrm{cut}}$.
  • Add nonfatal warnings to the modern AtomicRadials reader and the legacy LCAO_Orbitals reader when the declared cutoff differs from $(\mathrm{Mesh}-1)dr$.
  • Extend the Bessel-basis unit test to cover an exact-cutoff case that would otherwise produce an even mesh, verifying that the generated mesh is odd and the additional sample is zero.
  • Repair all eight affected versioned jle.orb files in examples, fixtures, and DeePKS integration cases.
  • Refresh 39 DeePKS unit-test references, 31 integration-test result.ref files, and 8 CSR references. Existing totaltimeref values are preserved.

Thread-sensitive integration references

The Gamma-point nspin=2 cases 29 and 31 follow different SCF trajectories with one and two OpenMP threads per MPI process. GitHub CI runs these cases with 4 MPI processes and OMP_NUM_THREADS=2, so their references were generated with the same configuration. No test threshold was relaxed.

Verification

  • MODULE_IO_bessel_basis_test: 3/3 passed, including the even-mesh safeguard case.
  • MODULE_NAO_atomic_radials: 5/5 passed.
  • MODULE_AO_ORB_read_test --gtest_filter='LcaoOrbitalsTest.ReadOrbitals': passed.
  • Existing DeePKS unit-test targets: 28/28 passed.
  • Full 09_DeePKS integration suite with 4 MPI processes and OMP_NUM_THREADS=2: all 31 cases passed.
  • Repository scan after repair: 0 inconsistent complete .orb files among the 81 files with complete cutoff and mesh metadata.
  • git diff --check: passed.

Compatibility

Existing user projector files are not modified automatically. Readers only report inconsistent metadata and continue with the original samples. Newly generated files either end at the declared cutoff or retain only zero-valued samples beyond it, and their output meshes remain compatible with Simpson integration. No INPUT parameter or DeePKS model format is changed.

Documentation

No user-facing INPUT parameter or documented interface changes, so generated parameter documentation does not need an update. The compatibility behavior and the new reader warning are described in this PR body; intermediate diagnostic reports and figures are intentionally excluded from the PR.

Governance notes

The generator and reader changes do not introduce new cross-layer global dependencies or new header dependencies.

Copilot AI review requested due to automatic review settings July 22, 2026 16:45

This comment was marked as spam.

Copilot AI review requested due to automatic review settings July 23, 2026 04:24

This comment was marked as spam.

Copilot AI review requested due to automatic review settings July 23, 2026 04:30

This comment was marked as spam.

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 Useful Information Useful information for others to learn/study Machine Learning & AI Issues related to AI and removed The Absolute Zero Reduce the "entropy" of the code to 0 labels Jul 24, 2026
@mohanchen mohanchen changed the title Fix: Remove nonzero tails beyond spherical Bessel projector cutoffs Fix: Remove nonzero tails beyond spherical Bessel projector cutoffs (Useful Information for updating DeePKS benchmark data) Jul 24, 2026
@mohanchen
mohanchen merged commit 854103e into deepmodeling:develop Jul 24, 2026
20 checks passed
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 Machine Learning & AI Issues related to AI Refactor Refactor ABACUS codes Useful Information Useful information for others to learn/study

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants