-
Notifications
You must be signed in to change notification settings - Fork 28
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
Automatic orbital wise analysis functionality in analyze module #132
Conversation
Hi @JaGeo , Below is the current output of condensed bonding analysis dict when oribital wise analysis is switched on. Please have a look at the output information I am providing. Suggestions are most welcome 😃 |
Closes #113 |
Hi @JaGeo , here is the updated output skeleton that fixes the discrepancies in previous results. NaCl3s-3s (57%)3px-3s (42%)#ZnS 3s-4s (38%)3py-4s (20%) |
This PR is ready for review now. I have updated the interactive plotter legends for Orbitalwise analysis. |
Btw, could you make a PR adding the units to the plotter as well? |
Yes sure! Thanks for pointing this out. Somwhow got overlooked so far |
Hi @JaGeo, I think it would be better if I introduce another parameter to limit the orbital contributions, I am currently using the same parameter limit of ICOHP cutoff i.e. 10% for limiting the orbital contributions. I found 10% cutoff can result in no orbital interactions being shown. (For example, in diamond, mp-66: no orbital-orbital interactions are detected using a 10% cutoff as all the contributions to total summed icohp are around 8%) If we simply change the cutoff_icohp arg in the analysis, this fixes the issue. But that could affect our other results Please let me know what you think is the best. |
Hi @JaGeo , it would be best to merge this after COBI coop extension PR as lot of changes needs to be updated in here (Merge conflicts will arise) |
lobsterpy/cohp/test/test_describe.py
Outdated
"In the Sb-F bond, the maximum contribution are from Sb(5pz)-F(2s), Sb(5py)-F(2s), " | ||
"and Sb(5px)-F(2s) orbitals, contributing 39.12, 39.12, and 39.12 percent, respectively, " | ||
"whereas the maximum antibonding contribution is from the Sb(5s)-F(2s) orbital, " | ||
"contributing 35.799 percent.", |
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.
It says: there is no antibonding contribution but then you list an orbital contribution for it.
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 also spotted this inconsistency yesterday. Trying an alternative approach for it. It happens because I did not use summed cohps of all relevant bonds , but rather looked relevant bond label to extract orbital contributions. Working on it since yesterday
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.
I tried with alternative approach, results change when using summed cohps, but it will still happen and it makes sense as we also see it in the plots 😅
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.
Then you need to rephrase the text ;). The sum is 0 but there are antibonding contributions from individual orbitals.
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.
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 then the text is not describing it correctly. It's not a percentage of the 0.0% antibonding interactions. Make sure this is clear from the text.
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.
In general: what percentage are you giving there? orbital COHP/overall COHP? And then antibonding orbtia interactions/overall orbital interaction strength? Might also not be exactly clear.
lobsterpy/cohp/test/test_describe.py
Outdated
"It has 4 C-C (mean ICOHP: -9.59 eV, 0.0 percent antibonding interaction below EFermi) bonds.", | ||
"In the C-C bond, the maximum contribution are from C(2py)-C(2s), C(2pz)-C(2s), C(2px)-C(2s), " | ||
"C(2s)-C(2py), C(2s)-C(2pz), and C(2s)-C(2px) orbitals, contributing 7.94, 7.94, 7.94, 7.94, " | ||
"7.94, and 7.94 percent, respectively, whereas the maximum antibonding contribution is from " |
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.
0.0 percent antibonding contribution and then a list of the max antibonding contribution.
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.
Hi @JaGeo , I found the current version of implementation does not work very well with just using ICOHPs to find the contributions, I would need to rewrite it. I Think to find most relevant orbitals, I would need to first compute area under intergrals from COHPs and then compute the percentage of contribution (This will take longer to run especially for larger structures or that have many orbital pairs) If you have any suggestions, please let me know 😃 |
Maybe, you could add this as an additional optional flag and not make it part of the standard orbital-wise analysis? I think people might just want to plot the most important orbital interactions and not much more. |
Hi @JaGeo, I made the code changes to include space between the sentences. So this PR could be merged. Let me know if I should add more comments for the implementation. |
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.
Hi @naik_aakash, this looks great. I left some further comments to avoid potenial code repetition.
Next steps should be documenting this functionality very well - both within our repository and for our publication. I would like to wait with a release until we have done this. I think users might have a lot of questions without it.
Another idea that I had: should we move to pytest completely? I think there are automatic tools to do so.
lobsterpy/plotting/__init__.py
Outdated
if label_with_count + suffix not in self._cohps: | ||
self._cohps[label_with_count + suffix] = {} | ||
plot_data_orb = analyse.get_site_orbital_resolved_labels() | ||
drop_down_key = label_with_count + suffix |
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.
this looks similar below.
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.
this looks similar below.
Now with comments added, it probably makes clearer how it differ
Yes, I wiIl document this soon for repo and publication. And I am not familiar with the tools, but should be easy I guess to find it out. Will check that |
I will merge this now. However, we need a clear description of how this orbital-wise automatic analysis works in our documentation, the tutorials and the paper. We should showcase the results for several examples of different complexity. |
Thanks, I will do this 😃 |
This PR implements the feature request of #113
Added
Todo