-
Notifications
You must be signed in to change notification settings - Fork 10
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
Defect generation updates #133
Defect generation updates #133
Conversation
…Analyzer` (bugfix)
…rough to `InterstitialGenerator` superclass (bugfix)
… multiplicities (bugfix)
…_coords` parameter to `get_supercell_structure` to allow choice of generated defect site in supercell
…num_atoms < 5`, for accurate/complete Voronoi tessellation (small unit cells anyway so negligible cost!)
…nt (when guessing oxi state of substitution defect) – i.e. antisite defects!
# Conflicts: # pymatgen/analysis/defects/generators.py
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
- Coverage 91.29% 91.13% -0.16%
==========================================
Files 11 11
Lines 1952 1985 +33
Branches 364 377 +13
==========================================
+ Hits 1782 1809 +27
- Misses 91 94 +3
- Partials 79 82 +3
☔ View full report in Codecov by Sentry. |
…percell_structure` to make compatible with supertype `Defect`
@kavanase Thanks for the PR!
If you update the code I'll also dig through my misbehaving antisite case and add that to the tests. |
Hi @jmmshn, no worries! 😃
For this, I don't know if I'm totally understanding what you mean. If shifting to exactly the user-provided fractional coordinates (in the case where this doesn't already exactly match one of the equivalent defect sites in the supercell), then this would mean either shifting the supercell origin or moving the defect position right? About the substitution defect oxidation state issue, cool! |
I think I'm just not super clear about the exact downstream problem this is addressing and just assumed it was mostly for visualization.
So I am assuming that shifting this was mostly targeted at visualizing the defect since the physical system is ultimately the same. As such, I assumed that all calculations will be done with the original cell and that a final arbitrary shift of all the sites in the defect cell can be performed at the very end so it won't affect any results. If we want to have an arbitrary shift of the sites for visualization then it seems to me that we can just use the provided site for each defect in the UC and shift all the sites in the SC by the difference between the target and the SC position of the site. That method will also transfer well to complexes since we can just use a |
Sorry busy week! 😅 Yes it's mostly for visualisation purposes in the long run, but I think it makes sense here at the generation stage, because then the defect can be initialised near the target site before the relaxation calculations. About You might disagree with some of this though! |
OK agreed, this all makes sense now. |
…defect_generation_updates
…ther than Defect.defect_site) with `Substitution` defects
Can we add two tests?
currently gives |
…ll returned structure)
… `Interstitial` and `Substitution`
Hi Jimmy, sure! |
Hi @kavanase |
Hi @jmmshn!
These are some updates to the defect generation code:
equivalent_sites
parameter toDefect
objects. This is automatically computed by the defect generators anyway and is useful info (particularly for interstitials), so these have been updated to returnDefect
s with this parameter set accordingly.target_frac_coords
parameter toget_supercell_structure
which allows the user to specify a 'target position' for the defect site in the generated supercell, so that it generates the defect supercell with the defect site at the closest possible/equivalent position to this site in the supercell.return_site
optional parameter toget_supercell_structure
, to also return the site of the defect in the generated supercell (useful info to have for a lot of our workflows!)oxi_state
of the substituting specie in the host structure, if present, when guessing the oxi state of substitutional defects – i.e. antisite defects in this case.max_cell_range
to 2 inTopographyAnalyzer
ifnum_atoms < 5
, for accurate/complete Voronoi tessellation (small unit cells anyway so negligible cost!). – I noticed that for some small unit cells it was either missing out on Voronoi sites and/or getting the multiplicities wrong because ofmax_cell_range
being too low for these cases. Bumping it up to2
fixes it, and should have negligible additional cost because these are only for small/high-symmetry unit cells anyway.