Skip to content

Fix onsiteDB: add missing Tc, La, Po, At onsite energies#349

Merged
QG-phy merged 1 commit into
deepmodeling:mainfrom
QG-phy:fix-onsitedb-missing-elements
Jun 26, 2026
Merged

Fix onsiteDB: add missing Tc, La, Po, At onsite energies#349
QG-phy merged 1 commit into
deepmodeling:mainfrom
QG-phy:fix-onsitedb-missing-elements

Conversation

@QG-phy

@QG-phy QG-phy commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Problem

dptb/nn/sktb/onsiteDB.py's onsite_energy_database was missing four elements: Tc, La, Po, At. Downstream workflows that iterate over all elements (e.g. SK parameter generation that walks the full periodic table) hit AssertionError: <element> not found in onsite energy database.

Verification that this is pure data loss, not a recomputation

A full element-by-element, orbital-by-orbital comparison against a downstream fork (UniSK, derived from an older DeePTB) confirms:

  • Old copy: 72 elements; current main: 68 elements
  • All 68 shared elements are 100% numerically identical (zero differences, to machine precision)
  • The four missing elements (At, La, Po, Tc) are the only difference — they were dropped during a prior refactor, not recomputed with different values.

So adding them back is safe and conflicts with nothing.

Changes

Added the four elements at their periodic-table positions, using the same GAPW LDA source as the rest of the table:

Element Position Orbitals
Tc after Mo, before Ru 5s, 5p, 4d
La after Ba 5s, 6s, 5p, 6p, 5d, 4f, d*, f*
Po after Bi, before At 6s, 6p, d*
At after Po, before Rn 6s, 6p, d*

Restores full periodic-table coverage (72 elements).

Testing

Loaded the updated database and confirmed all four elements are present and queryable; no import errors. (No unit test added since this is a static data table, but happy to add one if maintainers prefer.)

Summary by CodeRabbit

  • New Features

    • Added onsite-energy support for additional elements, expanding the range of materials that can be handled.
    • New entries include Tc, La, Po, and At with their available orbital energy data.
  • Bug Fixes

    • Improved coverage for element-specific onsite energy lookups, reducing missing-data cases when working with these atoms.

The onsite_energy_database was missing four elements that are present in the
old derived fork: Tc, La, Po, At. A full element-by-element comparison against
the downstream copy (UniSK) confirmed that all 68 shared elements are 100%
numerically identical -- the four were simply dropped during a prior refactor,
not recomputed. The values below are from the same GAPW LDA source as the rest
of the table.

- Tc (after Mo, before Ru): 5s/5p/4d
- La (after Ba): 5s/6s/5p/6p/5d/4f/d*/f*
- Po (after Bi, before At): 6s/6p/d*
- At (after Po, before Rn): 6s/6p/d*

This restores full periodic-table coverage (72 elements) so downstream SK
parameter workflows that iterate over all elements no longer hit 'element not
found in onsite energy database'.
@github-actions

Copy link
Copy Markdown

This advisory review plan was generated from changed file names using trusted base-branch code.
此审查计划由受信任的 base 分支代码根据变更文件名生成,仅作为维护者辅助。

DeePTB PR Review Plan / DeePTB PR 审查计划

Risk / 风险等级: Low (低) · Changed files / 变更文件: 1

Why / 风险来源

  • Some files are unclassified by current risk_map.md. / 部分文件尚未被当前风险地图覆盖。

Recommended Review / 建议审查重点

  • Optional: run the Test Gap Review Prompt if examples, docs commands, or test markers changed. / 可选:如果示例、文档命令或测试 marker 有变更,运行测试缺口审查 prompt。
  • Confirm the changed behavior matches the PR scope. / 确认变更行为和 PR 范围一致。
Detailed risk areas
  • No mapped DeePTB risk area matched. Review scope manually.
  • Unclassified by current risk_map.md: dptb/nn/sktb/onsiteDB.py
Human review focus
  • Confirm the PR scope is clear and no unrelated cleanup is mixed in.
Local commands and hold conditions

Suggested local commands:

  • uv run pytest ./dptb/tests -m smoke

Hold conditions:

  • CI failed and the failure is not explained.
  • The PR scope is unclear or mixes unrelated changes.

Advisory only. / 仅作为审查辅助。

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 871ceabc-512b-46e6-98df-0dcb265bcaf3

📥 Commits

Reviewing files that changed from the base of the PR and between 9b456ab and 40fd55d.

📒 Files selected for processing (1)
  • dptb/nn/sktb/onsiteDB.py

📝 Walkthrough

Walkthrough

dptb/nn/sktb/onsiteDB.py adds onsite-energy entries for Tc, La, Po, and At to onsite_energy_database.

Changes

Onsite energy database updates

Layer / File(s) Summary
Add Tc, La, Po, and At entries
dptb/nn/sktb/onsiteDB.py
onsite_energy_database gains new orbital onsite-energy dictionaries for Tc, La, Po, and At.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: restoring missing onsite energy entries for Tc, La, Po, and At.
Description check ✅ Passed The description covers the problem, changes, and testing, but it omits several required template sections like scope, risk, and merge decision.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QG-phy QG-phy merged commit 86c60c7 into deepmodeling:main Jun 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant