Skip to content

Add direct-BTD and Refactor Hamiltonian HDF5 dataflow - #45

Merged
AsymmetryChou merged 3 commits into
deepmodeling:mainfrom
AsymmetryChou:oom
Oct 1, 2026
Merged

AsymmetryChou merged 3 commits into
deepmodeling:mainfrom
AsymmetryChou:oom

Conversation

@AsymmetryChou

Copy link
Copy Markdown
Collaborator

This pull request introduces significant improvements to the initialization and handling of block tridiagonal (BTD) Hamiltonians in the NEGF code, with a focus on supporting a new "direct" BTD initialization mode. It also enhances the management of contact metadata, improves error checking, and streamlines the retrieval of device Hamiltonian data from cache files. The changes ensure more robust and flexible initialization, especially for large systems, and improve code maintainability.

BTD Initialization and Direct Mode Support:

  • Added support for a "direct" BTD initialization mode in NegfHamiltonian, including new arguments (btd_initialization, direct_btd_max_mib), validation checks, and integration with the initialize_direct function for memory-efficient initialization without constructing the full Hamiltonian. (Fca3e61bL63, Fca3e61bL75, Fca3e61bL215, Fca3e61bL256)

Contact Metadata and Reduced Contacts:

  • Introduced and propagated contact_metadata to manage reduced contact information, enabling more accurate handling of lead-device coupling matrices and supporting explicit reduced contacts in both lead property calculations and cache packing. (Fccb08d0L310, Fccb08d0L385, Fccb08d0L408, Fccb08d0L892, Fccb08d0L964)

Device Hamiltonian Cache Handling:

  • Refactored get_hs_device to robustly read both .h5 and .pth cache formats, including explicit handling for incomplete or outdated caches, block tridiagonal vs. dense layouts, and improved error messages. Added a helper for k-point index lookup. (Fca3e61bL869, Fca3e61bL977)

Code Cleanup and Minor Fixes:

  • Removed unused imports and cleaned up legacy code related to sorting and regular expressions. (Fca3e61bL1, Fca3e61bL18)

References:

  • Fca3e61bL63, Fca3e61bL75, Fca3e61bL215, Fca3e61bL256, Fccb08d0L310, Fccb08d0L385, Fccb08d0L408, Fccb08d0L892, Fccb08d0L964, Fca3e61bL869, Fca3e61bL977, Fca3e61bL1, Fca3e61bL18

@AsymmetryChou
AsymmetryChou merged commit e0d2a9f into deepmodeling:main Oct 1, 2026
1 check 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