Skip to content
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

Interstitial Generator Have to Take CHGCAR? #59

Closed
JiQi535 opened this issue Dec 3, 2022 · 5 comments
Closed

Interstitial Generator Have to Take CHGCAR? #59

JiQi535 opened this issue Dec 3, 2022 · 5 comments

Comments

@JiQi535
Copy link

JiQi535 commented Dec 3, 2022

Hi!

I cannot find the previous method in InterstitialGenerator, which takes just a pmg structure and target element to insert and finds possible interstitial sites. Now, it seems that the CHGCAR is compulsory. May I ask why the previous method is removed?

For reference, the above mentioned legacy InterstitialGenerator is in the last release of pymatgen that still contains the InterstitialGenerator, which is v2022.7.19. And the generator was defined this way: https://github.com/materialsproject/pymatgen/blob/0adae3b3eab8217be6d1abbb314d1b733dfebad6/pymatgen/analysis/defects/generators.py#L149-L187

@jmmshn
Copy link
Collaborator

jmmshn commented Dec 4, 2022

Hi, @JiQi535 the previous version was removed because we found it basically impossible to train our team members to use it and it was not maintained at all. And the old charge insertion class relies on a lot of improper use of the data frames which was slow and difficult to maintain and difficult to build databases with. I originally designed the new package to simply mask the old one but it was decided that the old one should just be removed to avoid package name confusion. materialsproject/pymatgen#2582

In our extensive testing the AECCAR is the most reliable way of identifying interstitials. That is why we added this first.

@jmmshn
Copy link
Collaborator

jmmshn commented Dec 10, 2022

If you want to use the older interstitial finders you can just install the older pymatgen as discussed here in #55

@JiQi535
Copy link
Author

JiQi535 commented Dec 11, 2022

Thanks for the explanation. I personally think the previous code is quite nice to find tetrahedral and octahedra interstitial sites, which uses different method than using CHGCARs. Would it be possible and necessary to have it back somewhere in pymatgen or pymatgen-analysis-defect? Otherwise, I will close the issue.

@jmmshn
Copy link
Collaborator

jmmshn commented Dec 15, 2022

I will take some time and add the Voronoi generator back in but that will have to wait until January since I'm focused on some radiative stuff now.
If you need it more urgently please feel free to create a PR and I'll to my best to look at it ASAP.

@jmmshn
Copy link
Collaborator

jmmshn commented Dec 29, 2022

Resolved in PR #82

Example usage:

def test_voronoi_interstitial_generator(chgcar_fe3o4):
gen = VoronoiInterstitialGenerator().get_defects(chgcar_fe3o4.structure, {"Li"})
cnt = 0
for defect in gen:
assert isinstance(defect, Interstitial)
assert defect.site.specie.symbol == "Li"
cnt += 1
assert cnt == 4

@jmmshn jmmshn closed this as completed Dec 29, 2022
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

No branches or pull requests

2 participants