Skip to content

Commit

Permalink
replace label by spin
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Dec 6, 2024
1 parent 682101f commit 53fd777
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sphinx_parser/ase.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import numpy as np
mport numpy as np
import scipy.constants as sc
from sphinx_parser.input import sphinx
from ase.io.vasp import _handle_ase_constraints
Expand All @@ -20,11 +20,11 @@ def _get_movable(selective):
return {"movable": False}


def _get_atom_list(positions, labels, movable, elm_list):
def _get_atom_list(positions, spins, movable, elm_list):
atom_list = []
for elm_pos, elm_magmom, selective in zip(
positions[elm_list],
labels[elm_list],
spins[elm_list],
movable[elm_list],
):
atom_group = {
Expand All @@ -36,11 +36,11 @@ def _get_atom_list(positions, labels, movable, elm_list):
return atom_list


def _get_species_list(elements, labels, movable):
def _get_species_list(elements, spins, movable):
species = []
for elm_species in np.unique(elements):
elm_list = elements == elm_species
atom_list = _get_atom_list(positions, labels, movable, elm_list)
atom_list = _get_atom_list(positions, spins, movable, elm_list)
species.append(
sphinx.structure.species.create(element=elm_species, atom=atom_list)
)
Expand All @@ -60,9 +60,9 @@ def get_structure_group(structure, use_symmetry=True):
"""
cell, positions = _to_angstrom(structure.cell, structure.positions)
movable = ~_handle_ase_constraints(structure)
labels = structure.get_initial_magnetic_moments()
spins = structure.get_initial_magnetic_moments()
elements = np.array(structure.get_chemical_symbols())
species = _get_species_list(elements, labels, movable)
species = _get_species_list(elements, spins, movable)
symmetry = None
if not use_symmetry:
symmetry = sphinx.structure.symmetry.create(
Expand Down

0 comments on commit 53fd777

Please sign in to comment.