Skip to content

#1436 OpenMX Spin input write: Preserve the sign of magnetic moments in the collinear spin case.

Hongkee Yoon requested to merge bluehope/ase:OpenMX.magmom_fix into master

Patch for def get_up_down_spin(magmom, element, xc, data_path, year): at ase/calculators/openmx/writer.py https://gitlab.com/ase/ase/-/blob/master/ase/calculators/openmx/writer.py#L411

Differentiate between collinear (float or int type) and non-collinear spin (array) configurations based on the type of magmom. In the case of collinear spins, the sign of magnetic moments should be preserved without applying the norm. Specifically, if magmom is either a float or an int, it is explicitly cast to float to maintain consistency.

Checklist

Merge request reports