site_symmetry
Site symmetry analysis for crystal structures.
This module provides data structures for tracking the site symmetry (stabilizer subgroup) of each atom in the asymmetric unit, which corresponds to the Wyckoff position.
SiteSymmetry
dataclass
Site symmetry information for a single asymmetric unit atom.
The site symmetry is the stabilizer subgroup - the set of symmetry operations that leave the site invariant (up to a lattice translation).
Attributes:
| Name | Type | Description |
|---|---|---|
multiplicity |
int
|
The Wyckoff multiplicity = |G| / |stabilizer| This is how many equivalent copies exist in the unit cell. |
stabilizer_symop_codes |
tuple[int, ...]
|
Tuple of integer codes for symops that fix this site |
n_stabilizer |
int
|
Size of stabilizer subgroup = len(stabilizer_symop_codes) |
is_general_position |
bool
|
True if site is on a general position (stabilizer = identity only) |
Source code in chmpy/crystal/site_symmetry.py
from_position(position, symops, tolerance=0.0001)
classmethod
Compute the site symmetry for a given position.
A symmetry operation g belongs to the stabilizer if
g(position) - position = lattice_vector (integer components)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
ndarray
|
(3,) fractional coordinates of the site |
required |
symops
|
list[SymmetryOperation]
|
List of space group symmetry operations |
required |
tolerance
|
float
|
Tolerance for detecting lattice translations |
0.0001
|
Returns:
| Type | Description |
|---|---|
SiteSymmetry
|
SiteSymmetry with stabilizer information |
Source code in chmpy/crystal/site_symmetry.py
SiteSymmetryTable
dataclass
Site symmetry information for all atoms in an asymmetric unit.
This table stores the stabilizer subgroup (site symmetry) for each asymmetric unit atom. Sites on special positions have larger stabilizers and lower multiplicities.
Attributes:
| Name | Type | Description |
|---|---|---|
site_symmetries |
tuple[SiteSymmetry, ...]
|
Tuple of SiteSymmetry, one per asymmetric unit atom |
general_position_mask |
ndarray
|
(N_asym,) bool array, True if site is general |
n_asym |
int
|
Number of atoms in asymmetric unit |
n_symops |
int
|
Number of symmetry operations in space group |
Source code in chmpy/crystal/site_symmetry.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
from_crystal(crystal, tolerance=0.0001)
classmethod
Build a SiteSymmetryTable from a Crystal object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
crystal
|
Crystal
|
The crystal structure to analyze |
required |
tolerance
|
float
|
Tolerance for detecting lattice translations |
0.0001
|
Returns:
| Type | Description |
|---|---|
SiteSymmetryTable
|
SiteSymmetryTable with site symmetry for each asymmetric unit atom |
Source code in chmpy/crystal/site_symmetry.py
get_multiplicity(asym_idx)
get_stabilizer_codes(asym_idx)
Get the stabilizer symop codes for an asymmetric unit atom.
is_general_position(asym_idx)
n_general_positions()
n_special_positions()
total_multiplicity()
Sum of all multiplicities.
For a valid structure, this should equal N_uc (number of atoms in unit cell).