File: test_spg_reps_O2.py

package info (click to toggle)
python-symfc 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,972 kB
  • sloc: python: 10,795; makefile: 12
file content (17 lines) | stat: -rw-r--r-- 483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Tests of SpgRepsO2 class."""

import numpy as np

from symfc.spg_reps import SpgRepsO2
from symfc.utils.utils import SymfcAtoms


def test_spg_reps_o2(cell_nacl_111: SymfcAtoms):
    """Test of SpgRepsO2."""
    spg_reps_o2 = SpgRepsO2(cell_nacl_111)
    trace_sum = 0
    for i, _ in enumerate(spg_reps_o2.unique_rotation_indices):
        trace_sum += np.count_nonzero(
            spg_reps_o2.get_sigma2_rep(i) == np.arange(64, dtype=int)
        )
    assert trace_sum == 960