Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ml_peg/calcs/molecular_crystal/CPOSS209/calc_CPOSS209.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def test_lattice_energy(mlip: tuple[str, Any]) -> None:

# Read crystal structure
solid = read(crystal_path, index=0)
# Set default charge and spin
solid.info.setdefault("charge", 0)
solid.info.setdefault("spin", 1)
solid.calc = copy(calc)
solid.get_potential_energy()

Expand Down Expand Up @@ -126,6 +129,8 @@ def test_lattice_energy(mlip: tuple[str, Any]) -> None:

# Read gas phases
molecule = read(molecule_path, index=0)
molecule.info.setdefault("charge", 0)
molecule.info.setdefault("spin", 1)
molecule.calc = copy(calc)
molecule.get_potential_energy()

Expand Down
3 changes: 3 additions & 0 deletions ml_peg/calcs/physicality/diatomics/calc_diatomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def run_diatomics(model_name: str, model) -> None:
[element1, element2],
positions=[(0.0, 0.0, 0.0), (0.0, 0.0, float(distance))],
)
# Set default charge and spin
atoms.info.setdefault("charge", 0)
atoms.info.setdefault("spin", 1)

atoms.calc = calc
energy = float(atoms.get_potential_energy())
Expand Down