-
Notifications
You must be signed in to change notification settings - Fork 16
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
[feature] add the support of NRL-TB #22
Conversation
update 12 files and create 1 file 1. add onsite formula 2. modify the onsitefunc to be the same style of sk hoping integralfunc 3. use the onsite formula to get onsite orbital energy 4. the strain mode is special still treat in the sk hopping style.
…ite_neurons settings in init_dptb and init_nnsk
1. add NRL TB onsite energy formula NRL in the onsite_formula.py 2. modify the onsite_func.py to adopt the NRL 3. modify init_nnsk init_dptb to adopt the changes in onsite_func 3. modify the test train nnsk and dptb .py to adopt the changes in onsite_func 4. add new parameters for NRL TB onsite energy in argcheck.py 5. add index_mapping NRL (temporarily using the uniform format) in the future the t2g eg orbital will be added!
… is also one mode.
For init_correction_model for NRL TB json model.
remove the return in the test function
change From rev_latt =(np.matrix(structase.cell).I.T) kdiff_cart = np.asarray(kdiff * rev_latt) To: rev_latt = np.linalg.inv(np.array(structase.cell).T) kdiff_cart = np.dot(kdiff, rev_latt)
… uniform strain and none mode.
add test test_NRL_skint_type_constants
''' | ||
assert self.overlap, 'overlap is False, no overlap function is defined.' | ||
|
||
if self.functype == 'NRL': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user wants to define an overlap in the form of varTang96 or power-law, is there anything needed to be done besides modifying the formula here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user wants to define an overlap in the form of varTang96 or power-law, is there anything that needs to be done besides modifying the formula here?
Re: now looks like that only modifying the formula is enough. If not, it must be some tiny changes to the other part. I don't check it.
x_env_indlist = onsite_env[kf][:,2] == xind | ||
x_onsite_envs = onsite_env[kf][x_env_indlist,8] # r_jis | ||
|
||
paras = {'x_onsite_envs':x_onsite_envs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bravo! This approach of getting analytic environmental-dependent onsites can easily generalize to the hopping part, which helps to implement the environment-dependent hoppings such as Prof. Pan's.
self.para_Consts = None | ||
|
||
if functype == 'NRL': | ||
self.para_Consts = NRL_skint_type_constants(reducted_skint_types) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the deltas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
nnsk_overlaps = batch_nnsk_overlaps[ii] | ||
else: | ||
nnsk_overlaps = None | ||
onsiteEs, hoppings, onsiteSs, overlaps, soc_lambdas = nnsk_correction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dptb does not correct overlap value right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, dptb will not correct the overlap. only hoppings are enough I think. at least at this stage.
{ | ||
"common_options": { | ||
"unit": "Ry", | ||
"onsitemode": "NRL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it better to move onsitemode and onsite cutoff to onsite function in model_options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but moving this para to model options will make the previous model fail.
@@ -328,7 +344,7 @@ def model_options(): | |||
|
|||
doc_model_options = "The parameters to define the `nnsk` and `dptb` model." | |||
|
|||
return Argument("model_options", dict, sub_fields=[skfunction(), sknetwork(), dptb()], sub_variants=[], optional=False, doc=doc_model_options) | |||
return Argument("model_options", dict, sub_fields=[skfunction(), sknetwork(), onsitefuncion(), dptb()], sub_variants=[], optional=False, doc=doc_model_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corresponding to onsitefunction, is it better to change skfunction to hoppingfunction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I create a new issue to do this. since this NRL PR contains too much information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is pth and json's result different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is pth and json's result different?
This is because the json model is from the original NRL model, but the pth one is from further trained result init by the json one.
related issue #17
**Note: ** The lambda for onsite density is different for different elements for compound, but now we did not have this freedom. so only it works for substance.