msite calc order change
now doing sc_msite first then convert to uc
@@ -82,24 +82,29 @@ def get_uc_pos(
sc_m, total_t = mapping
sc_ipos = isite.frac_coords
- sc_ipos = sc_ipos - total_t
- uc_ipos = sc_ipos.dot(sc_m)
+ sc_ipos_t = sc_ipos - total_t
+ uc_ipos = sc_ipos_t.dot(sc_m)
image_trans = np.floor(uc_ipos)
uc_ipos = uc_ipos - image_trans
uc_ipos = _get_first_close_site(uc_ipos, uc)
sc_epos = esite.frac_coords
- sc_epos = sc_epos - total_t
- uc_epos = sc_epos.dot(sc_m)
+ sc_epos_t = sc_epos - total_t
+ uc_epos = sc_epos_t.dot(sc_m)
uc_epos = uc_epos - image_trans
uc_epos = _get_first_close_site(uc_epos, uc)
- msite = PeriodicSite(
+ sc_msite = PeriodicSite(
esite.specie,
- (uc_ipos + uc_epos) / 2,
+ (sc_ipos + sc_epos) / 2,
esite.lattice,
)
- uc_mpos = msite.frac_coords
+ sc_mpos = sc_msite.frac_coords
+
+ sc_mpos_t = sc_mpos - total_t
+ uc_mpos = sc_mpos_t.dot(sc_m)
+ uc_mpos = uc_mpos - image_trans
+ uc_mpos = _get_first_close_site(uc_mpos, uc)
p0 = PeriodicSite(isite.specie, uc_ipos, uc.lattice)
p1 = PeriodicSite(esite.specie, uc_mpos, uc.lattice)
@@ -152,7 +157,7 @@ def get_unique_hop(
symprec = mg.symprec
sm = StructureMatcher(ignored_species=[list(mg.m_graph.graph.edges(data=True))[0][2]["hop"].isite.specie.name])
uc_isite, uc_msite, uc_esite = get_uc_pos(isite, esite, mg.symm_structure, sc, sm)
- mh_from_sc = MigrationHop(uc_isite, uc_esite, symm_structure=mg.symm_structure, symprec=symprec)
+ mh_from_sc = MigrationHop(uc_isite, uc_esite, symm_structure=mg.symm_structure)
result = []
for k, v in mg.unique_hops.items():
# tolerance may be changed here
