Skip to content

Commit

Permalink
revert changes that break tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Apr 22, 2024
1 parent 6e2b326 commit de34eda
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions pymatgen/analysis/magnetism/heisenberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def _get_nn_dict(self):
dist = round(cs[-1], 2) # i_j distance

j = cs[2] # j index
j_key = None
for key, value in unique_site_ids.items():
if j in key:
j_key = value
Expand Down Expand Up @@ -282,7 +281,6 @@ def _get_exchange_df(self):
# s_i_sign = np.sign(sgraph.structure.site_properties['magmom'][i])
s_i = sgraph.structure.site_properties["magmom"][idx]

i_index = 0
for k, v in unique_site_ids.items():
if idx in k:
i_index = v
Expand All @@ -299,20 +297,17 @@ def _get_exchange_df(self):
# s_j_sign = np.sign(sgraph.structure.site_properties['magmom'][j_site])
s_j = sgraph.structure.site_properties["magmom"][j_site]

j_index = 0
for k, v in unique_site_ids.items():
if j_site in k:
j_index = v

# Determine order of connection
order = ""
if abs(dist - dists["nn"]) <= tol:
order = "-nn"
elif abs(dist - dists["nnn"]) <= tol:
order = "-nnn"
elif abs(dist - dists["nnnn"]) <= tol:
order = "-nnnn"

j_ij = f"{i_index}-{j_index}{order}"
j_ji = f"{j_index}-{i_index}{order}"

Expand Down Expand Up @@ -398,8 +393,6 @@ def get_low_energy_orderings(self):
fm_struct, afm_struct = None, None
mag_min = np.inf
mag_max = 0.001
fm_e = 0
afm_e = 0
fm_e_min = 0
afm_e_min = 0

Expand Down Expand Up @@ -595,16 +588,15 @@ def _get_j_exc(self, i, j, dist):
j_exc (float): Exchange parameter in meV
"""
# Get unique site identifiers
i_index = 0
j_index = 0
for k, v in self.unique_site_ids.items():
if i in k:
i_index = v
if j in k:
j_index = v

# Determine order of interaction
order = ""

# Determine order of interaction
if abs(dist - self.dists["nn"]) <= self.tol:
order = "-nn"
elif abs(dist - self.dists["nnn"]) <= self.tol:
Expand Down Expand Up @@ -966,16 +958,15 @@ def _get_j_exc(self, i, j, dist):
j_exc (float): Exchange parameter in meV
"""
# Get unique site identifiers
i_index = 0
j_index = 0
for k in self.unique_site_ids:
if i in k:
i_index = self.unique_site_ids[k]
if j in k:
j_index = self.unique_site_ids[k]

# Determine order of interaction
order = ""

# Determine order of interaction
if abs(dist - self.dists["nn"]) <= self.tol:
order = "-nn"
elif abs(dist - self.dists["nnn"]) <= self.tol:
Expand Down

0 comments on commit de34eda

Please sign in to comment.