/usr/share/pyshared/ase/test/noncollinear.py is in python-ase 3.6.0.2515-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from ase import Atom, Atoms
a = Atoms('H2')
a[0].magmom = 1
m = a.get_initial_magnetic_moments()
assert m.shape == (2,) and (m == [1, 0]).all()
a[1].magmom = -1
m = a.get_initial_magnetic_moments()
assert m.shape == (2,) and (m == [1, -1]).all()
assert a[1].magmom == -1
a.set_initial_magnetic_moments()
a[0].magmom = (0, 1, 0)
m = a.get_initial_magnetic_moments()
assert m.shape == (2, 3) and (m == [(0, 1, 0), (0, 0, 0)]).all()
a[1].magmom = (1, 0, 0)
m = a.get_initial_magnetic_moments()
assert m.shape == (2, 3) and (m == [(0, 1, 0), (1, 0, 0)]).all()
assert (a[1].magmom == (1, 0, 0)).all()
|