Coverage for gpaw/test/symmetry/test_check.py: 100%
8 statements
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-20 00:19 +0000
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-20 00:19 +0000
1"""Example from the gpaw-dev ML.
4 https://listserv.fysik.dtu.dk/pipermail/gpaw-users/2016-January/003864.html
5"""
6from ase import Atoms
7from gpaw.symmetry import atoms2symmetry
10def test_symmetry_check():
11 a = 3.9
12 atoms = Atoms('Ge2Si4',
13 cell=[[a, 0, 0],
14 [0, a, 0],
15 [-a / 2, -a / 2, a * 3 / 2**0.5]],
16 scaled_positions=[[2 / 3, 2 / 3, 1 / 3],
17 [11 / 12, 5 / 12, 5 / 6],
18 [0, 0, 0],
19 [1 / 4, 3 / 4, 1 / 2],
20 [1 / 3, 1 / 3, 2 / 3],
21 [7 / 12, 1 / 12, 1 / 6]],
22 pbc=True)
23 sym = atoms2symmetry(atoms)
24 ok = sym.check_grid((20, 20, 40))
25 assert not ok