File: test_things.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (15 lines) | stat: -rw-r--r-- 636 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def test_things():
    from ase.dft.kpoints import monkhorst_pack
    from ase.units import Hartree, Bohr, kJ, mol, kcal, kB, fs
    from ase.build import bulk

    assert [0, 0, 0] in monkhorst_pack((1, 3, 5)).tolist()
    assert [0, 0, 0] not in monkhorst_pack((1, 3, 6)).tolist()
    assert len(monkhorst_pack((3, 4, 6))) == 3 * 4 * 6

    print(Hartree, Bohr, kJ / mol, kcal / mol, kB * 300, fs, 1 / fs)

    hcp = bulk('X', 'hcp', a=1) * (2, 2, 1)
    assert abs(hcp.get_distance(0, 3, mic=True) - 1) < 1e-12
    assert abs(hcp.get_distance(0, 4, mic=True) - 1) < 1e-12
    assert abs(hcp.get_distance(2, 5, mic=True) - 1) < 1e-12