hikari.symmetry.operations ========================== .. py:module:: hikari.symmetry.operations .. autoapi-nested-parse:: This file contains class and definitions of 3-dimensional symmetry operations. Classes ------- .. autoapisummary:: hikari.symmetry.operations.Operation hikari.symmetry.operations.BoundedOperation hikari.symmetry.operations.PointOperation Module Contents --------------- .. py:class:: Operation(transformation, translation=np.array([0, 0, 0])) Class storing information about symmetry operations, with clear string representation and intuitive syntax for combining / utilising operations: "=" to compare two symmetry operations for logical equivalence, "*" to combine two symmetry operations or transform a vector, "** n" to apply symmetry operation n times, "% n" to restrict symmetry operation to n unit cells. Some of the functions may work incorrectly for rhombohedral unit cells #TODO .. py:class:: Type Bases: :py:obj:`enum.Enum` Enumerator class storing information about type of operation .. py:attribute:: rotoinversion :value: 4 .. py:attribute:: identity :value: 3 .. py:attribute:: reflection :value: 2 .. py:attribute:: rotation :value: 1 .. py:attribute:: inversion :value: 0 .. py:attribute:: rototranslation :value: -1 .. py:attribute:: transflection :value: -2 .. py:attribute:: translation :value: -3 .. py:property:: tf :type: numpy.ndarray .. py:property:: tl :type: numpy.ndarray .. py:method:: __eq__(other) .. py:method:: __mul__(other) .. py:method:: __pow__(power, modulo=None) .. py:method:: __repr__() .. py:method:: __str__() .. py:method:: __hash__() .. py:method:: from_code(code) :classmethod: Create new symmetry operation using symmetry code "x',y',z'" containing transformation of each individual coordinate from x,y,z to x',y',z'. :param code: string representing new coordinates after operation :return: Symmetry operation generated from given coordinate triplet code .. py:method:: from_matrix(matrix) :classmethod: Create new symmetry operation using augmented 4x4 transformation matrix :param matrix: augmented 4x4 matrix :return: Symmetry operation generated based on augmented matrix .. py:method:: from_pair(matrix, vector) :classmethod: Create new symmetry operation using point transformation 3x3 matrix and 3-length translation vector. Alias for standard creation method. :param matrix: 3x3 point transformation matrix :param vector: 3-length translation vector :return: Symmetry operation generated based on matrix - vector pair .. py:method:: _row_to_str(xyz, r) :staticmethod: Convert xyz: 3-el. list and r - number to single element of code triplet :param xyz: 3-element list of coordinates, e.g.: [1,-1,0] :param r: translation applied to the row :return: string representing change of coordinate .. py:method:: _project(vector, onto) :staticmethod: Return projection of np.ndarray "vector" to np.ndarray "onto" .. py:property:: code :type: str .. py:property:: matrix :type: numpy.ndarray Augmented 4 x 4 transformation matrix with float-type values .. py:property:: det :type: int Determinant of 3x3 transformation part of operation's matrix .. py:property:: typ :type: Type Crystallographic type of this symmetry operation (see `Type`) .. py:property:: name :type: str 'm', '3' or '2_1' :type: Short name of symmetry operation, e.g. .. py:property:: fold :type: int Number of times operation must be repeated to become identity, inversion or translation: n for n-fold axes, 2 for reflections, 1 for other (max 6) .. py:property:: order :type: int Number of times operation has to be repeated to become a translation, e.g.: n for all n-fold axes, 2 for other (max 6) .. py:property:: glide :type: numpy.ndarray Part of the translation vector stemming from operations' glide .. py:property:: glide_fold :type: int Number of types glide component of the operation must be repeated in order to contain only integer values, e.g.: 3 for "6_2", 4 for "d" .. py:property:: origin :type: numpy.ndarray Selected point that remains on the symmetry element after operation Loosely based on solving https://math.stackexchange.com/q/1054481/. .. py:property:: reciprocal :type: PointOperation Relevant symmetry operation in its respective reciprocal space .. py:property:: trace :type: int Trace of 3x3 transformation part of operation's matrix .. py:property:: translational :type: bool True if operation has any glide component, False otherwise .. py:property:: invariants :type: list[numpy.ndarray] List of directions not affected by this symmetry operation .. py:property:: orientation :type: Union[numpy.ndarray, None] Direction of symmetry element (if it can be defined) else None .. py:property:: sense :type: str "+" or "-", the "sense" of rotation, as given in ITC A, 11.1.2 .. py:property:: _hm_span .. py:property:: _hm_glide .. py:property:: hm_symbol :type: str .. py:property:: bounded :type: BoundedOperation Instance of self that always collapses down to Coset representative .. py:property:: unbounded :type: Operation Instance of self that can express translations beyond the unit cube .. py:property:: is_bounded :type: bool True if self is a coset representatives i.e. 0 <= tl < 1 element-wise .. py:method:: at(point) Transform operation as little as possible so that its symmetry element contains "point". To be used after "into" if used together. Based on "ITC 5.2.1. Transformations". :param point: Target coordinates of point which should lie in element :return: New symmetry operation which contains "point" in its element .. py:method:: into(direction, hexagonal = False) Rotate operation so that its orientation changes to "direction", while preserving fractional glide. To be used before respective "at" method. Will most likely not work for unimplemented rhombohedral unit cells. :param direction: Target orientation for element of symmetry operation :param hexagonal: True if operation is defined in hexagonal coordinates :return: New symmetry operation whose orientation is "direction" .. py:method:: transform(other) Transform a column containing rows of coordinate points :param other: A vertical numpy array of coordinate triplets kept in rows :return: Same-shaped array of coordinate triplets transformed by self .. py:method:: extincts(hkl) Return boolean array with truth whenever reflection should be extinct :param hkl: An array containing one hkl or multiple hkls in columns :return: array of booleans, where extinct reflections are marked as True .. py:method:: distance_to_point(point) .. py:class:: BoundedOperation(transformation, translation=np.array([0, 0, 0])) Bases: :py:obj:`Operation` A subclass of `Operation` where all three elements of the translation vector are bounded between 0 (inclusive) and 1 (exclusive). This class is suitable for handling coset representatives of space groups, since upon binding operations related by unit translation become equivalent. .. py:property:: tl :type: numpy.ndarray .. py:class:: PointOperation(transformation, translation=np.array([0, 0, 0])) Bases: :py:obj:`BoundedOperation` A subclass of `BoundedOperation`, asserts translation vector = [0,0,0] .. py:property:: tl :type: numpy.ndarray