Skip to content

add support for baseline mode #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

QG-phy
Copy link
Collaborator

@QG-phy QG-phy commented Apr 7, 2025

Introduce support for a new basisref parameter in onsite energy calculations and add a function to display onsite energies. Restructure installation instructions for better readability and update configuration management for model parameters. Add commands for generating empirical SK parameters and streamline various code components for improved maintainability.

QG-phy and others added 13 commits March 28, 2025 16:15
Introduce a new `basisref` parameter in the `to_json` method to handle uniform_noref mode for onsite energies. This allows for referencing a uniform basis set when calculating onsite energies. Additionally, add a `show_onsites` function to display onsite energies for a given basis set, improving debugging and analysis capabilities.
Reorganize the installation steps in the documentation to improve readability and logical flow. Separate the installation of `torch` and `torch-scatter` into distinct steps and ensure consistent formatting across both the quick start guide and README.
The changes streamline the handling of uniform basis references by consolidating the logic into a single block. This reduces redundancy and improves code maintainability by ensuring consistent behavior across different parameter types (hopping, overlap, onsite, and SOC).
Add base_poly2.pth and base_poly4.pth files to the emp_base directory to support empirical base modeling
Add binary model files `base_poly2.pth` and `base_poly4.pth` to the DFTB neural network directory. These files are essential for initializing polynomial-based models in the DFTB framework.
Introduce a new `model` parameter in the `get_full_config` function to dynamically update the input template based on the provided model. This change allows for more flexible configuration management by leveraging the `gen_inputs` utility function. Additionally, simplify optimizer configurations and adjust the `eout_weight` default value for consistency.
Introduce a new command 'esk' to generate initial empirical SK parameters. This includes the addition of the `emp_sk.py` module, which handles the conversion of model parameters to empirical SK format. The command supports both 'poly2' and 'poly4' base models and saves the output in JSON format. Also, fix a minor bug in `gen_inputs.py` where `model_options` was incorrectly accessed as a method.
- Modify argument types in `argcheck.py` to include `None` for `r_max`, `oer_max`, and `er_max`
- Add help text for `basemodel` in `main.py` to clarify its options
- Adjust `eout_weight` in `config_skenv.py` for better training balance
- Introduce `atomic_radius` argument in `nnsk` for model flexibility
- Add `uniform_noref` option to `onsite` method for additional configuration
- Update `rs` argument type in `hopping` to accept `dict` for more complex scenarios
Ensure correct device type assignment by checking both string and torch.device instances. Additionally, freeze the overlap parameter in the nnsk model when overlap is detected to prevent unintended modifications.
将vasp_kpath函数的pathstr参数类型从str改为list[str],以提高代码的灵活性和可读性
…arameters and support generating band.json from structure files, add input validation and default Fermi energy setting"
fix(band): 添加日志以确认提供的费米能量与估计值匹配
fix(auto_band_config): 修正日志信息中的拼写错误
@QG-phy QG-phy requested a review from Copilot April 7, 2025 18:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (3)

dptb/utils/config_skenv.py:27

  • The doc string for 'eout_weight' still indicates a default value of 0.01, which is inconsistent with the updated default of 0.001. Consider updating the documentation to match the new value.
                "eout_weight": 0.001,

dptb/utils/config_sk.py:27

  • The default value documentation for 'eout_weight' remains as 'Default: 0.01' despite being updated to 0.001. Please update the doc string for accuracy.
                "eout_weight": 0.001,

dptb/nn/nnsk.py:980

  • [nitpick] The branch handling the case when 'basisref' is provided for onsite conversion uses 'print' instead of logging, which is inconsistent with the rest of the codebase. Consider replacing it with an appropriate logging method.
            else:

@@ -15,6 +15,19 @@
# 'Cs', 'Ba', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Rn'
# ]

def show_onsites(basis):
Copy link
Preview

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function 'show_onsites' references 'onsite_energy_database' but is defined before the variable is declared, which could lead to a NameError if called before the database is defined. Consider moving the variable definition above this function or adjusting the code order to ensure correct lookup.

Copilot uses AI. Check for mistakes.

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