diffpy.structure.spacegroupmod
Symmetry operations as functions on vectors or arrays.
- class diffpy.structure.spacegroupmod.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)[source]
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 % 1000
to get the standard space group number from International Tables.- Type:
int
- num_sym_equiv
The number of symmetry equivalent sites for a general position.
- Type:
int
- num_primitive_sym_equiv
The number of symmetry equivalent sites in a primitive unit cell.
- Type:
int
- short_name
The short Hermann-Mauguin symbol of the space group.
- Type:
str
- point_group_name
The point group to which this space group belongs to.
- Type:
str
- crystal_system
The crystal system of this space group. The possible values are
"TRICLINIC", "MONOCLINIC", "ORTHORHOMBIC", "TETRAGONAL", "TRIGONAL" "HEXAGONAL", "CUBIC"
.- Type:
str
- pdb_name
The full Hermann-Mauguin symbol of the space group.
- Type:
str
- symop_list
A list of SymOp objects for all symmetry operations in this space group.
- Type:
list of SymOp
- check_group_name(name)[source]
Check if given name matches this space group.
- Parameters:
name (str or int) – The space group identifier, a string name or number.
- Returns:
True
if the specified name matches one of the recognized names of this space group or if it equals its number. ReturnFalse
otherwise.- Return type:
bool
- iter_equivalent_positions(vec)[source]
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_equiv positions regardless of initial coordinates being a special symmetry position or not.
- Parameters:
vec (numpy.ndarray) – The initial position in fractional coordinates.
- Yields:
numpy.ndarray – The symmetry equivalent positions in fractional coordinates. The positions may be duplicate or outside of the
0 <= x < 1
unit cell bounds.
- class diffpy.structure.spacegroupmod.SymOp(R, t)[source]
The transformation of coordinates to a symmetry-related position.
The SymOp operation involves rotation and translation in cell coordinates.
- Parameters:
R (numpy.ndarray) – The 3x3 matrix of rotation for this symmetry operation.
t (numpy.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:
numpy.ndarray
- t
The translation of cell coordinates applied after rotation R.
- Type:
numpy.ndarray
- __call__(vec)[source]
Return symmetry-related position for the specified coordinates.
- Parameters:
vec (numpy.ndarray) – The initial position in fractional cell coordinates.
- Returns:
The transformed position after this symmetry operation.
- Return type:
numpy.ndarray