Coverage for hiphive/core/config.py: 100%

36 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2025-08-01 17:04 +0000

1# This module contains the various variables used as tolerances and similar 

2# throughout the code in the core functionality. 

3 

4 

5class config: 

6 class eigensymmetries: 

7 rotation_integer_tolerance = 1e-12 

8 method = 'iterative' 

9 crystal_symmetries = True 

10 

11 class iterative: 

12 zero_tolerance = 1e-12 

13 simplify = True 

14 simplify_tolerance = None 

15 method = 'symbolic' 

16 

17 

18integer_tolerance: float = 1e-12 

19"""This is the tolerance used when the rotation matrices and similar are tested 

20if they are integers. 

21""" 

22 

23eigentensor_compress_mode: str = None 

24""" For each symmetry, the constraint matrix can be reduced to square 

25again. This can be done either by `'symbolic'`, `'numeric'` or not at all 

26(`None`). Default is `None` since the matrix is often small enough to fit 

27in memory. 

28""" 

29 

30eigentensor_simplify_before_compress: bool = False 

31"""If this is `True`, before every symbolic compression the values will be 

32simplified by sympy, potentially turning them into exact rational or 

33irrational numbers. This can be useful for systems with non-integer 

34rotation matrices in cartesian coordinates, e.g., hcp. The main purpose is 

35to make the rref more stable against repeating rounding errors. 

36""" 

37 

38eigentensor_simplify_before_last_compress: bool = False 

39""" If non compress was used during construction but used before solving. 

40""" 

41 

42eigentensor_compress_before_solve: str = None 

43"""If the compress_mode is `None` the constraint matrix might be compressed 

44right before the :func:`nullspace()` solver. 

45Possible values are `'numeric'`, `'symbolic'`, `None`. 

46""" 

47 

48eigentensor_simplify_before_solve: bool = True 

49"""This might make the :func:`nullspace()` solver more stable. 

50""" 

51 

52eigentensor_solve_mode: str = 'symbolic' 

53""" 

54Possible values are `'symbolic'`, `'numeric'`. 

55""" 

56 

57sum_rule_constraint_mode: str = 'symbolic' 

58""" 

59Possible values are `'symbolic'`, `'numeric'`. 

60""" 

61 

62sum_rule_constraint_simplify: bool = True 

63""" 

64Possible values are `True`, `False`. 

65""" 

66 

67constraint_vectors_simplify_before_compress: bool = True 

68""" 

69Possible values are `True`, `False`. 

70""" 

71 

72constraint_vectors_compress_mode: str = 'symbolic' 

73""" 

74Possible values are `'symbolic'`, `'numeric'`, `None`. 

75""" 

76 

77constraint_vectors_simplify_before_solve: bool = True 

78""" 

79Possible values are `True`, `False`. 

80""" 

81 

82constraint_vectors_solve_mode: str = 'symbolic' 

83""" 

84Possible values are `'symbolic'`, `'numeric'`. 

85"""