Skip to content

Commit 035ea62

Browse files
committed
Minor update to ensure defect supercell site coords exactly match the defect supercell (pmg analysis defects generation uses slightly inconsistent transforms)
1 parent f12115f commit 035ea62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doped/generation.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,16 @@ def _get_neutral_defect_entry(
406406
equivalent_supercell_sites,
407407
) = defect.get_supercell_structure(
408408
sc_mat=supercell_matrix,
409-
dummy_species="X", # keep track of the defect frac coords in the supercell
409+
dummy_species=_dummy_species.symbol, # keep track of the defect frac coords in the supercell
410410
target_frac_coords=target_frac_coords,
411411
return_sites=True,
412412
)
413+
dummy_sites = [site for site in dummy_defect_supercell if site.specie.symbol == _dummy_species.symbol]
414+
if dummy_sites: # set defect_supercell_site to exactly match coordinates,
415+
# as can have very small differences in generation due to rounding
416+
dummy_site = next(iter(dummy_sites))
417+
defect_supercell_site._frac_coords = dummy_site.frac_coords
418+
413419
neutral_defect_entry = get_defect_entry_from_defect(
414420
defect,
415421
dummy_defect_supercell,

0 commit comments

Comments
 (0)