Skip to content

Add cal_bandgap task and update related documentation and tests - #57

Merged
AsymmetryChou merged 16 commits into
deepmodeling:mainfrom
AsymmetryChou:bandgap
Nov 24, 2026
Merged

AsymmetryChou merged 16 commits into
deepmodeling:mainfrom
AsymmetryChou:bandgap

Conversation

@AsymmetryChou

Copy link
Copy Markdown
Collaborator

This pull request introduces support for a new standalone electronic band-gap calculation task (cal_bandgap) to the codebase. It adds the cal_bandgap option throughout the documentation, input schema, and main entrypoint, and implements comprehensive validation for its input parameters. The changes also ensure that only supported tasks are accepted, and improve documentation for clarity.

New Band-Gap Task Support

  • Added a new cal_bandgap task option to the documentation (docs/index.rst, docs/input_params/run_options.rst) and to the input schema (dpnegf/utils/argcheck.py), including detailed descriptions and option schema. [1] [2] [3] [4] [5]
  • Implemented the cal_bandgap task in the main run entrypoint (dpnegf/entrypoints/run.py), including dynamic import and execution of the band-gap calculator, and proper handling of its options and results. [1] [2] [3]

Validation and Schema Improvements

  • Added a comprehensive validate_cal_bandgap_options function to check cross-field constraints and apply defaults for all cal_bandgap options, ensuring robust error handling and user feedback.
  • Updated the normalize_run function to invoke band-gap validation when the task is cal_bandgap.

Supported systems

  • cal_bandgap is limited to finite structures (HOMO–LUMO gap) and one-dimensional periodic structures (a single periodic axis, as in this example). Two- or three-dimensional periodic boundary conditions are rejected with an explicit error; arbitrary 2D/3D k-space search is out of scope for this first version. Magnetic/SOC models, odd-electron counts and GPU solving are not supported yet.

Documentation and Usability Enhancements

  • Improved task documentation for clarity, including descriptions for the new band-gap task and more precise wording for structure and task options. [1] [2]

Task Handling and Code Cleanliness

  • Refactored task handling in the main entrypoint to ensure only supported tasks can be run, raising a clear error for unsupported tasks.

These changes collectively enable users to compute finite HOMO-LUMO gaps or one-dimensional band gaps, with robust input validation and clear documentation.

@AsymmetryChou
AsymmetryChou merged commit 494db45 into deepmodeling:main Nov 24, 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