Exemplo n.º 1
0
 def point_group(self):
     """
     :return: get the point group in :math:`O(3)` of a 3D lattice, in :math:`O(2)` of a 2D lattice
     :rtype: :py:class:`MatrixGroup <structrans.crystallography.MatrixGroup>`
     :raises AttributeError: Point groups for other than 2D and 3D lattices are not implemented yet.
     """
     if not self.dimension() in [2, 3]:
         raise AttributeError(
             'Point groups for other than 2D and 3D lattices are not implemented yet.'
         )
     if self.__pointGroup is None and self.__N == 3:
         lg = np.array(self.Laue_group().matrices())
         self.__pointGroup = MatrixGroup(np.append(lg, -lg, axis=0))
     elif self.__pointGroup is None and self.__N == 2:
         self.__pointGroup = MatrixGroup(
             np.array([
                 Q for Q in SQUARE_EXT_GROUP.matrices()
                 if self.inpointgroup(Q)
             ]))
         if self.__pointGroup.order() == 4:
             hexGroup = MatrixGroup(
                 np.array([
                     Q for Q in HEX2D_EXT_GROUP.matrices()
                     if self.inpointgroup(Q)
                 ]))
             if hexGroup.order() > self.__pointGroup.order():
                 self.__pointGroup = hexGroup
     return self.__pointGroup
Exemplo n.º 2
0
 def Laue_group(self):
     '''
     :return: get the Laue group in :math:`SO(3)` of a 3D lattice, in :math:`SO(2)` of a 2D lattice.
     :rtype: :py:class:`MatrixGroup <structrans.crystallography.MatrixGroup>`
     :raises AttributeError: Laue groups for other than 2D and 3D lattices are not implemented yet.
     '''
     if not self.dimension() in [2, 3]:
         raise AttributeError(
             'Laue groups for other than 2D and 3D lattices are not implemented yet.'
         )
     if self.__LaueGroup is None and self.dimension() == 3:
         self.__LaueGroup = MatrixGroup(
             np.array([
                 Q for Q in CUBIC_LAUE_GROUP.matrices()
                 if self.inpointgroup(Q)
             ]))
         if self.__LaueGroup.order() == 4:
             hexgroup = MatrixGroup(
                 np.array([
                     Q for Q in HEX_LAUE_GROUP.matrices()
                     if self.inpointgroup(Q)
                 ]))
             if hexgroup.order() > self.__LaueGroup.order():
                 self.__LaueGroup = hexgroup
     if self.__LaueGroup is None and self.dimension() == 2:
         self.__LaueGroup = MatrixGroup(
             np.array([
                 Q for Q in SQUARE_GROUP.matrices() if self.inpointgroup(Q)
             ]))
         if self.__LaueGroup.order() == 2:
             hexGroup = MatrixGroup(
                 np.array([
                     Q for Q in HEX2D_GROUP.matrices()
                     if self.inpointgroup(Q)
                 ]))
             if hexGroup.order() > self.__LaueGroup.order():
                 self.__LaueGroup = hexGroup
     return self.__LaueGroup
Exemplo n.º 3
0
 def lattice_group(self):
     """
     :return: get the lattice group in :math:`GL(3, \mathbb Z)` of a 3D lattice
     :rtype: :py:class:`MatrixGroup <structrans.crystallography.MatrixGroup>`
     :raises AttributeError: Lattice groups for other than 2D and 3D lattices are not implemented yet.
     """
     if not self.dimension() in [2, 3]:
         raise AttributeError(
             'Lattice groups for other than 2D and 3D lattices are not implemented yet.'
         )
     if self.__specLatticeGroup is None:
         E = self.__E
         Einv = la.inv(E)
         mats = np.array([
             np.rint(Einv.dot(Q.dot(E)))
             for Q in self.point_group().matrices()
         ],
                         dtype='int')
         return MatrixGroup(mats)