Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support atomwise rmax for sktb module (#209)
* feat: add logging for self-interaction warnings and implement tests for r_max functionality * feat: add support for atom-wise rs rmax setting in deeptb sk modula. * remove check atomic_number shape in get_r_map * add Covalent_radii database * Add support for basis input in the format : ['s','p','d'], previous only support the format of ['2s','3p','d*'], where the main quantum number must be there before the orbital or the * after the orbital symbol. * fix test error when add the support for basis input format of ['s','p','d'] * change the unit of bond_length_list from bohr to \AA * add test_Covalent_radii * add some comment in dftbsk * add BondLenCovalent * add new onsite formula uniform_noref * remove the unit transition from bohr to \AA since gthe bondlenth are saved in unit AA. * rename BondLenCovalent to R_cov_list * chore: Update test_SKHamiltonian to use torch.allclose with specified tolerances * Refactor AtomicData.py to use environment variable for error handling * add atomic radius in bondlengthDB * Refactor covalent radii database to use \AA as unit * feat: Calculate minimum and maximum atomic radii based on skdata 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. * add new dftb2nnsk * add new dftb2nnsk * feat: Update SKParam class to update atomic radii and format_skparams 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. * feat: Add range check for bond distance in HoppingIntp 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. * feat: Add poly4pow hopping formula to HoppingFormula class and simplify 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. * update dftb2nnsk to accept large model * delete temp * add get_rmap for bond_wise cutoff seting style * feat: Add poly3exp and poly4exp hopping formulas to HoppingFormula class 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. * feat: update AtomicData.neighbor_list_and_relative_vec to support bond wise rmax * feat:add support bond-wise rmax in nnsk * feat: Update NNSK class to support bond-wise rs values This commit updates the NNSK class in nnsk.py to support bond-wise rs values. It introduces a conditional statement to check if the rs values are atom-wise or bond-wise. If the rs values are bond-wise, the get_r_map_bondwise() function is called to generate the r_map dictionary. The r_map_type attribute is set to 2 to indicate bond-wise rs values. This allows for more flexibility in defining the hopping options for the NNSK model. * feat: Update AtomicData.neighbor_list_and_relative_vec to support bond-wise rmax * feat: Add support for bond-wise rmax in build_dataset tests * test:update some tests * feat: add bondwise cal rmax and rim in skparam * use bondwise rmin and rmax in skparam and dftb2nnsk * Refactor bondwise rmax calculation in sk_param.py and dftb2nnsk.py * Refactor DFTB2NNSK add save and load model * Refactor NRL_OVERLAP0 and NRL_OVERLAP1 in hopping.py to use torch.Tensor instead of torch.float32 for rs and w parameters * Refactor get_lr_scheduler to add support for cosine annealing learning rate scheduler * Refactor optimise funciton in dftb2nnsk.py * Refactor collectskf.py and main.py to add support for converting sk files to nn-sk TB model * Refactor argcheck.py to add support for RMSprop and LBFGS optimizers and CosineAnnealingLR learning rate scheduler * Refactor argcheck.py to remove duplicate formulas in the hopping function * update test for dftb2nnsk * Refactor argcheck.py to remove duplicate formulas in the hopping function * rename functype to method in dftb2nnsk and fix bug in argcheck. * Add output inputpara * add bond integrl plot viz * add bond integrl plot viz * Refactor NNSK class to include support for different atomic radius options * Refactor atomic radius initialization in DFTB2NNSK and NNSK classes * fix: the support for uniform_noref onsite mode in nnsk * Refactor OnsiteFormula class in onsite.py * Refactor save method in NNSK class add device and dtype in dftb2nnsk and sk_param * Refactor ElecStruCal class to handle atomic radius options and fix a bug related to the pbc parameter * Refactor get_cutoffs_from_model_options function to handle the case when r_max is not provided in dftbsk model options * add example of dftb2nnsk * test: add skf2nnsk example * Refactor load method in DFTB2NNSK class to include an optional output parameter * add no check for model options in build.py * fix bug in lr_scheduler if argcheck * add base model and example * update uasge * fix the typo for get_r_map_bondwise
- Loading branch information