File: utils.py

package info (click to toggle)
python-ase 3.22.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,344 kB
  • sloc: python: 126,379; xml: 946; makefile: 111; javascript: 47
file content (5 lines) | stat: -rw-r--r-- 219 bytes parent folder | download | duplicates (5)
1
2
3
4
5
def get_magmoms(atoms):
    if atoms.calc is not None:
        if not atoms.calc.calculation_required(atoms, ['magmoms']):
            return atoms.get_magnetic_moments()
    return atoms.get_initial_magnetic_moments()