Skip to content

Conversation

@QG-phy
Copy link
Collaborator

@QG-phy QG-phy commented Dec 18, 2025

Add orbital number mappings and transformation matrices for ABACUS, DeePTB, and OPENMX DFT codes. These constants define the magnetic quantum number ordering and provide conversion matrices between different code conventions, enabling proper orbital basis transformations.

Summary by CodeRabbit

  • New Features
    • Enhanced support for OpenMX computational package with new orbital number mappings.
    • Improved orbital data handling across ABACUS, DeePTB, and OpenMX packages.
    • Expanded configuration support for accurate data conversion between different computational software formats.

✏️ Tip: You can customize this high-level summary in your review settings.

Add orbital number mappings and transformation matrices for ABACUS, DeePTB, and OPENMX DFT codes. These constants define the magnetic quantum number ordering and provide conversion matrices between different code conventions, enabling proper orbital basis transformations.
Updated variable name in constants.py to align with the project's naming
convention and reflect the transition from DeePTB to DFTIO. This change
improves code clarity and maintains consistency across the codebase.
@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

📝 Walkthrough

Walkthrough

Added new orbital number mappings for ABACUS, DeePTB, and OpenMX platforms defining per-angular-momentum lists. Introduced new OpenMX2DFTIO mapping with 2D-FFT index-to-identity configuration. Expanded ABACUS2DFTIO public mapping with updated index configurations across multiple orbital blocks.

Changes

Cohort / File(s) Summary
Orbital and format mappings
dftio/constants.py
Added three new orbital number mappings (ABACUS_orbital_number_m, DeePTB_orbital_number_m, OPENMX_orbital_number_m), introduced OPENMX2DFTIO with 2D-FFT index-to-identity mapping, and expanded ABACUS2DFTIO with updated index configurations across multiple orbital blocks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify correctness and completeness of the three new orbital number mappings for different angular momentum values
  • Validate the OPENMX2DFTIO 2D-FFT index-to-identity mapping aligns with OpenMX format specifications
  • Confirm updated index configurations in expanded ABACUS2DFTIO mapping are correct across all affected orbital blocks

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically describes the main change: adding orbital mapping constants for three DFT codes (ABACUS, DeePTB, OPENMX).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75c66b5 and fb1d7c9.

📒 Files selected for processing (1)
  • dftio/constants.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (GEMINI.md)

Follow PEP 8 conventions for coding style in Python files

Files:

  • dftio/constants.py
🔇 Additional comments (4)
dftio/constants.py (4)

15-22: LGTM!

The magnetic quantum number ordering follows a consistent pattern [0, 1, -1, 2, -2, ...] and element counts match expected values for each angular momentum (2l+1).


24-31: LGTM!

Standard ascending magnetic quantum number ordering [-l, ..., 0, ..., l] is correctly defined for each angular momentum.


80-85: Verify: OPENMX orbital support limited to f orbitals.

OPENMX_orbital_number_m only defines orbitals up to "f" (l=3), while ABACUS_orbital_number_m and DeePTB_orbital_number_m extend to "h" (l=5). If OPENMX supports g and h orbitals, consider adding those entries for consistency.


87-92: OPENMX2DFTIO appears incomplete and unused; clarify design intent.

This transformation matrix is not imported anywhere in the codebase and lacks an OPENMX parser implementation. Additionally, it:

  • Defines only l=0 to l=3, while ABACUS2DFTIO, RESCU2DFTIO, and SIESTA2DFTIO all extend to l=5
  • Omits the sign-flipping adjustments applied by all three other matrices

Clarify whether this is intentional stub code pending OPENMX parser implementation or should be removed as dead code. If completion is planned, verify whether sign modifications are needed to match other codes' phase conventions.


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 and usage tips.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.40%. Comparing base (317869d) to head (fb1d7c9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   40.35%   40.40%   +0.04%     
==========================================
  Files          43       43              
  Lines        4864     4868       +4     
==========================================
+ Hits         1963     1967       +4     
  Misses       2901     2901              
Flag Coverage Δ
unittests 40.40% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@QG-phy QG-phy merged commit c9d128f into deepmodeling:main Dec 18, 2025
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