# 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. ndarray – The transformed position after this symmetry operation.
`__eq__`(symop)

Implement the `(self == symop)` test of equality.

Return `True` when self and symop difference is within tiny round-off errors.

`is_identity`()

Check if this SymOp is an identity operation.

Returns: bool – `True` if this is an identity operation within a small round-off. Return `False` otherwise.
class `SpaceGroup`(number=None, num_sym_equiv=None, num_primitive_sym_equiv=None, short_name=None, alt_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. alt_name (str) – Alternative space group symbol consistent with FullProf. 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
`alt_name`

Alternative space group symbol consistent with FullProf. Deprecated.

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
`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. bool – `True` if the specified name matches one of the recognized names of this space group or if it equals its `number`. Return `False` otherwise.
`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_equiv` positions regardless of initial coordinates being a special symmetry position or not.

Parameters: vec (ndarray) – The initial position in fractional coordinates. ndarray – The symmetry equivalent positions in fractional coordinates. The positions may be duplicate or outside of the `0 <= x < 1` unit cell bounds.