add support atomwise rmax for sktb module#209
Merged
QG-phy merged 68 commits intodeepmodeling:mainfrom Dec 21, 2024
Merged
Conversation
…or r_max functionality
…nly support the format of ['2s','3p','d*'], where the main quantum number must be there before the orbital or the * after the orbital symbol.
…saved in unit AA.
This commit adds a new function `cal_rmin_rmax` to calculate the minimum and maximum atomic radii based on the given skdata. It uses the `find_first_false` function to find the index of the first occurrence of False in each row of a 2D array. The calculated atomic radii are stored in the `atomic_r_min_dict` and `atomic_r_max_dict` dictionaries.
… to align the distance introduce the mask for rij out the grid from skfiles. This commit modifies the SKParam class in sk_param.py to calculate and update the minimum and maximum atomic radii based on the given skdata. It introduces a new function `cal_rmin_rmax` that uses the `find_first_false` function to find the index of the first occurrence of False in each row of a 2D array. The calculated atomic radii are stored in the `atomic_r_min` and `atomic_r_max` attributes of the SKParam class.
This commit adds a range check for the bond distance `rij` in the `HoppingIntp` class of `hopping_dftb.py`. If any `rij` values are outside the interpolation range defined by `min_x` and `max_x`, a warning message is logged and those values are set to 0.0. The interpolated values are then calculated using the modified `rij` array.
…fy the class This commit adds the 'poly4pow' hopping formula to the HoppingFormula class in hopping.py. The formula calculates the SK integrals without the environment dependence of the form of powerlaw. It takes into account parameters such as alpha1, alpha2, alpha3, alpha4, alpha5, and alpha6. The function poly4pow() is used to calculate the value of the hopping formula. If the functype is 'NRL0' or 'NRL1', the NRL_HOP method is called. Otherwise, the method corresponding to the functype is called. If the functype is not recognized, a ValueError is raised.
This commit adds the 'poly3exp' and 'poly4exp' hopping formulas to the HoppingFormula class in hopping.py. These formulas calculate the SK integrals without the environment dependence of the form of powerlaw. They take into account parameters such as alpha1, alpha2, alpha3, alpha4, alpha5, and alpha6. The functions poly3exp() and poly4exp() are used to calculate the values of the hopping formulas. If the functype is 'NRL0' or 'NRL1', the NRL_HOP method is called. Otherwise, the method corresponding to the functype is called. If the functype is not recognized, a ValueError is raised.
…iles to nn-sk TB model
…and CosineAnnealingLR learning rate scheduler
…bug related to the pbc parameter
…hen r_max is not provided in dftbsk model options
dptb/data/AtomicData.py
Outdated
| for k in r_max.keys(): | ||
| assert len(k.split('-')) == 2 | ||
| atom_a, atom_b = k.split('-') | ||
| if atom_a not in atom_species_num: |
Member
There was a problem hiding this comment.
这里atom_a, atom_b 应该是str,atom_species_num里应该放的是 int,为啥判断atom_a not in atom_species_num?
Collaborator
Author
There was a problem hiding this comment.
嗯是的这里写错了。不过似乎不用加判断也许。后面用到atom_species_num的时候只是用到了取最大值。
dptb/data/AtomicData.py
Outdated
| atom_a, atom_b = k.split('-') | ||
| if atom_a not in atom_species_num: | ||
| atom_species_num.append(atomic_num_dict[atom_a]) | ||
| if atom_b not in atom_species_num: |
|
|
||
| return True | ||
|
|
||
| def save(self,filepath): |
Member
There was a problem hiding this comment.
感觉这个功能很像是deeptb软件的一个插件。所有功能基本都独立,参数也独立写了一个子集
Collaborator
Author
There was a problem hiding this comment.
这个其实是一个非常不常用的功能。只有在做dftb2nnsk的的大模型才用到,用来存中间的存档。其他时间用不到。单个体系的训练这部分其实也不要中间存训练的存档。没必要在这个地方搞什么事情。
floatingCatty
approved these changes
Dec 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.