Reference¶
Library¶
A tool for describing symmetry operations and their representations.
-
class
symmetry_representation.
SymmetryGroup
(symmetries, full_group=False)[source]¶ Describes a symmetry group.
- Parameters
symmetries (List[SymmetryOperation]) – Elements of the symmetry group.
full_group (bool) – Flag which determines whether the symmetry elements describe the full group or just a generating subset.
-
symmetries
¶ Elements of the symmetry group.
- Type
List[SymmetryOperation]
-
full_group
¶ Flag which determines whether the symmetry elements describe the full group or just a generating subset.
- Type
-
classmethod
from_hdf5
(hdf5_handle)¶ Deserializes the object stored in HDF5 format.
-
class
symmetry_representation.
SymmetryOperation
(*, rotation_matrix, translation_vector=None, repr_matrix, repr_has_cc=False, numeric=None)[source]¶ Describes a symmetry operation.
- Parameters
rotation_matrix (array) – Real-space rotation matrix of the symmetry (in reduced coordinates).
translation_vector (array) – Real-space displacement vector of the symmetry (in reduced coordinates).
repr_matrix (array) – Matrix of the representation corresponding to the symmetry operation.
repr_has_cc (bool) – Specifies whether the representation contains a complex conjugation.
numeric (bool) – Specifies whether the symmetry operation contains a numeric or analytic values. By default, this is determined by the type of the rotation matrix.
-
real_space_operator
¶ Real-space operator of the symmetry.
- Type
-
repr
¶ Symmetry representation.
- Type
-
classmethod
from_orbitals
(*, orbitals, real_space_operator, rotation_matrix_cartesian, numeric, **kwargs)[source]¶ Construct a (unitary) symmetry operation from the basis orbitals, real space operator and cartesian rotation matrix. The automatic construction of the representation matrix is used.
- Parameters
orbitals (Iterable[Orbital]) – The basis of orbitals with respect to which the represenation matrix is constructed.
real_space_operator (RealSpaceOperator) – The real space operator of the matrix.
rotation_matrix_cartesian (array) – The rotation matrix of the symmetry, in cartesian coordinates.
numeric (bool) – Determines whether a numeric (numpy) or analytic (sympy) representation matrix is constructed.
-
class
symmetry_representation.
RealSpaceOperator
(rotation_matrix, translation_vector=None, numeric=None)[source]¶ Describes the real-space operator of a symmetry operation.
- Parameters
rotation_matrix (array) – Describes the rotation matrix of the symmetry, in reduced coordinates
translation_vector (array) – The translation vector of the symmetry.
numeric (bool) – Specifies whether the symmetry operation contains a numeric or analytic values. By default, this is determined by the type of the rotation matrix.
-
classmethod
from_hdf5
(hdf5_handle)¶ Deserializes the object stored in HDF5 format.
-
property
is_lattice_translation
¶ Checks if the operation is a lattice translation, i.e. a pure translation where the translation vector is a lattice vector.
-
property
is_pure_translation
¶ Checks whether the operation is a pure translation, without rotation or reflection part.
-
class
symmetry_representation.
Representation
(matrix, has_cc=False, numeric=None)[source]¶ Describes an (anti-)unitary representation of a symmetry operation. For unitary symmetry, the representation is given as a unitary matrix \(U_g\). For anti-unitary symmetries, it is given as \(U_g \hat{K}\), where \(\hat{K}\) is the complex conjugation operator.
- Parameters
matrix (array) – The unitary matrix of the representation.
has_cc (bool) – Determines whether the representation contains complex conjugation (that is, whether it is anti-unitary).
numeric (bool) – Determines if the representation matrix is numeric or analytic. By default this is determined from the type of the passed matrix.
-
classmethod
from_hdf5
(hdf5_handle)¶ Deserializes the object stored in HDF5 format.
-
property
is_identity
¶ Checks if a representation is the identity.
-
symmetry_representation.
is_compatible
(*, structure, symmetry)[source]¶ Checks whether a given symmetry’s real space action (rotation + translation vector) is consistent with a given structure.
- Parameters
structure (pymatgen.Structure) – The crystal structure.
symmetry (SymmetryOperation) – The symmetry operation that is checked for compatibility.
-
symmetry_representation.
filter_compatible
(symmetries, *, structure)[source]¶ -
symmetry_representation.
filter_compatible
(symmetries: collections.abc.Iterable, *, structure) -
symmetry_representation.
filter_compatible
(symmetry: symmetry_representation._sym_op.SymmetryOperation, *, structure) -
symmetry_representation.
filter_compatible
(symmetry_group: symmetry_representation._sym_op.SymmetryGroup, *, structure) Returns the symmetries which are compatible with the given structure.
- Parameters
symmetries (SymmetryGroup, Iterable) – The symmetries which should be checked for compatibility. If a
SymmetryGroup
is given, the result is also given as aSymmetryGroup
.structure (pymatgen.Structure) – The crystal structure.
-
class
symmetry_representation.
Orbital
(*, position, function_string, spin=None)[source]¶ Defines a basis orbital.
-
position
¶ Position of the orbital, in reduced coordinates.
- Type
array
-
classmethod
from_hdf5
(hdf5_handle)¶ Deserializes the object stored in HDF5 format.
-
-
class
symmetry_representation.
Spin
[source]¶ Describes the spin component of an orbital.
-
total
¶ The total spin.
- Type
Fraction
-
z_component
¶ The component of spin in z direction.
- Type
Fraction
-
classmethod
from_hdf5
(hdf5_handle)¶ Deserializes the object stored in HDF5 format.
-
-
symmetry_representation.
get_time_reversal
(*, orbitals, numeric)[source]¶ Create the symmetry operation for time-reversal.
-
symmetry_representation.
get_repr_matrix
(*, orbitals, real_space_operator, rotation_matrix_cartesian, numeric, position_tolerance=0.0001)[source]¶ Create the representation matrix for a unitary operator. If analytic values are used (
numeric=False
), therotation_matrix_cartesian
must be an exact value.- Parameters
orbitals (List(Orbital)) – Basis orbitals with respect to which the representation should be created.
real_space_operator (RealSpaceOperator) – Real-space operator of the symmetry operation.
rotation_matrix_cartesian (np.array or sp.Matrix) – Rotation matrix of the symmetry operation in cartesian coordinates.
numeric (bool) – Flag to determine whether numeric (numpy) or symbolic (sympy) computation should be used.
position_tolerance (float) – Absolute distance between positions (in reciprocal units) for which they are still considered to be the same position.
Command Line Interface¶
symmetry-repr¶
symmetry-repr [OPTIONS] COMMAND [ARGS]...
filter-symmetries¶
Selects symmetries which are compatible with the given lattice.
symmetry-repr filter-symmetries [OPTIONS]
Options
-
-s
,
--symmetries
<symmetries>
¶ File containing the symmetries (in HDF5 format).
-
-l
,
--lattice
<lattice>
¶ File containing the lattice structure.
-
-o
,
--output
<output>
¶ File where the filtered symmetries are written (in HDF5 format).