/usr/share/pyshared/ase/test/crystal.py is in python-ase 3.6.0.2515-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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | import numpy as np
from ase.lattice.spacegroup import crystal
# A diamond unit cell
diamond = crystal('C', [(0,0,0)], spacegroup=227,
cellpar=[3.57, 3.57, 3.57, 90, 90, 90])
assert len(diamond) == 8
correct_pos = np.array([[ 0. , 0. , 0. ],
[ 0. , 0.5 , 0.5 ],
[ 0.5 , 0.5 , 0. ],
[ 0.5 , 0. , 0.5 ],
[ 0.75, 0.25, 0.75],
[ 0.25, 0.25, 0.25],
[ 0.25, 0.75, 0.75],
[ 0.75, 0.75, 0.25]])
assert np.allclose(diamond.get_scaled_positions(), correct_pos)
# A CoSb3 skutterudite unit cell containing 32 atoms
skutterudite = crystal(('Co', 'Sb'),
basis=[(0.25,0.25,0.25), (0.0, 0.335, 0.158)],
spacegroup=204, cellpar=[9.04, 9.04, 9.04, 90, 90, 90])
assert len(skutterudite) == 32
correct_pos = np.array([[ 0.25 , 0.25 , 0.25 ],
[ 0.75 , 0.75 , 0.25 ],
[ 0.75 , 0.25 , 0.75 ],
[ 0.25 , 0.75 , 0.75 ],
[ 0.75 , 0.75 , 0.75 ],
[ 0.25 , 0.25 , 0.75 ],
[ 0.25 , 0.75 , 0.25 ],
[ 0.75 , 0.25 , 0.25 ],
[ 0. , 0.335, 0.158],
[ 0. , 0.665, 0.158],
[ 0. , 0.335, 0.842],
[ 0. , 0.665, 0.842],
[ 0.158, 0. , 0.335],
[ 0.158, 0. , 0.665],
[ 0.842, 0. , 0.335],
[ 0.842, 0. , 0.665],
[ 0.335, 0.158, 0. ],
[ 0.665, 0.158, 0. ],
[ 0.335, 0.842, 0. ],
[ 0.665, 0.842, 0. ],
[ 0.5 , 0.835, 0.658],
[ 0.5 , 0.165, 0.658],
[ 0.5 , 0.835, 0.342],
[ 0.5 , 0.165, 0.342],
[ 0.658, 0.5 , 0.835],
[ 0.658, 0.5 , 0.165],
[ 0.342, 0.5 , 0.835],
[ 0.342, 0.5 , 0.165],
[ 0.835, 0.658, 0.5 ],
[ 0.165, 0.658, 0.5 ],
[ 0.835, 0.342, 0.5 ],
[ 0.165, 0.342, 0.5 ]])
assert np.allclose(skutterudite.get_scaled_positions(), correct_pos)
|