File: test_rotate_euler.py

package info (click to toggle)
python-ase 3.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 15,448 kB
  • sloc: python: 144,945; xml: 2,728; makefile: 113; javascript: 47
file content (16 lines) | stat: -rw-r--r-- 382 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from math import sqrt

from ase import Atoms


def test_rotate_euler():

    d = 1.14
    a = Atoms('CO', [(0, 0, 0), (d, 0, 0)])
    a.euler_rotate(phi=90, theta=45, psi=180)
    for p in a[0].position:
        assert p == 0.0
    assert abs(a[1].position[0]) < 1e-15
    d2 = d / sqrt(2)
    assert abs(a[1].position[1] - d2) < 1e-15
    assert abs(a[1].position[2] - d2) < 1e-15