diffpy.structure.spacegroupmod¶
Symmetry operations as functions on vectors or arrays.
-
class
SymOp(R, t)¶ The transformation of coordinates to a symmetry-related position.
The SymOp operation involves rotation and translation in cell coordinates.
Parameters: - R (ndarray) – The 3x3 matrix of rotation for this symmetry operation.
- t (ndarray) – The vector of translation in this symmetry operation.
-
R¶ The 3x3 matrix of rotation pertaining to unit cell coordinates. This may be identity, simple rotation, improper rotation, mirror or inversion. The determinant of R is either +1 or -1.
Type: ndarray
-
t¶ The translation of cell coordinates applied after rotation R.
Type: ndarray
-
__call__(vec)¶ Return symmetry-related position for the specified coordinates.
Parameters: vec (ndarray) – The initial position in fractional cell coordinates. Returns: ndarray – The transformed position after this symmetry operation.
-
__eq__(symop)¶ Implement the
(self == symop)test of equality.Return
Truewhen self and symop difference is within tiny round-off errors.
-
is_identity()¶ Check if this SymOp is an identity operation.
Returns: bool – Trueif this is an identity operation within a small round-off. ReturnFalseotherwise.
-
class
SpaceGroup(number=None, num_sym_equiv=None, num_primitive_sym_equiv=None, short_name=None, point_group_name=None, crystal_system=None, pdb_name=None, symop_list=None)¶ Definition and basic operations for a specific space group.
Provide standard names and all symmetry operations contained in one space group.
Parameters: - number (int) – The space group number.
- num_sym_equiv (int) – The number of symmetry equivalent sites for a general position.
- num_primitive_sym_equiv (int) – The number of symmetry equivalent sites in a primitive unit cell.
- short_name (str) – The short Hermann-Mauguin symbol of the space group.
- point_group_name (str) – The point group of this space group.
- crystal_system (str) – The crystal system of this space group.
- pdb_name (str) – The full Hermann-Mauguin symbol of the space group.
- symop_list (list of SymOp) – The symmetry operations contained in this space group.
-
number¶ A unique space group number. This may be incremented by several thousands to facilitate unique values for multiple settings of the same space group. Use
number % 1000to get the standard space group number from International Tables.Type: int
-
crystal_system¶ The crystal system of this space group. The possible values are
"TRICLINIC", "MONOCLINIC", "ORTHORHOMBIC", "TETRAGONAL", "TRIGONAL" "HEXAGONAL", "CUBIC".Type: str
-
symop_list¶ A list of
SymOpobjects for all symmetry operations in this space group.Type: list of SymOp
-
iter_symops()¶ Iterate over all symmetry operations in the space group.
Yields: SymOp– Generate all symmetry operations for this space group.
-
check_group_name(name)¶ Check if given name matches this space group.
Parameters: name (str or int) – The space group identifier, a string name or number. Returns: bool – Trueif the specified name matches one of the recognized names of this space group or if it equals itsnumber. ReturnFalseotherwise.
-
iter_equivalent_positions(vec)¶ Generate symmetry equivalent positions for the specified position.
The initial position must be in fractional coordinates and so are the symmetry equivalent positions yielded by iteration. This generates
num_sym_equivpositions regardless of initial coordinates being a special symmetry position or not.Parameters: vec (ndarray) – The initial position in fractional coordinates. Yields: ndarray – The symmetry equivalent positions in fractional coordinates. The positions may be duplicate or outside of the 0 <= x < 1unit cell bounds.