Skip to content

Commit

Permalink
Enforce 0.1 magnetization default for non-magnetic species
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Jan 9, 2025
1 parent 6e05162 commit 8e46b8d
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ def _update_default_moments(self):
}

def _to_moment(self, symbol: str, family: PseudoPotentialFamily) -> float:
magnetization = self._default_starting_magnetization.get(symbol, 0.0)
if self._DEFAULT_MOMENTS.get(symbol, {}).get("magmom"):
return magnetization * family.get_pseudo(symbol).z_valence
return 0.0
magnetization = (
self._default_starting_magnetization.get(symbol, 0.1)
if self._DEFAULT_MOMENTS.get(symbol, {}).get("magmom")
else 0.1
)
return round(magnetization * family.get_pseudo(symbol).z_valence, 3)

def _get_default_moments(self):
return deepcopy(self._defaults.get("moments", {}))

0 comments on commit 8e46b8d

Please sign in to comment.