Пример #1
0
 def test_similarity_transform( self ):
     matrix_a = np.array( [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] )
     matrix_b = np.array( [ [ 1, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ] ] )
     matrix_c = np.linalg.inv( matrix_a )
     so_a = SymmetryOperation( matrix_a )
     so_b = SymmetryOperation( matrix_b )
     np.testing.assert_array_equal( so_a.similarity_transform( so_b ).matrix, matrix_c )
Пример #2
0
 def test_similarity_transform(self):
     matrix_a = np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]])
     matrix_b = np.array([[1, 0, 0], [0, 0, 1], [0, 1, 0]])
     matrix_c = np.linalg.inv(matrix_a)
     so_a = SymmetryOperation(matrix_a)
     so_b = SymmetryOperation(matrix_b)
     np.testing.assert_array_equal(
         so_a.similarity_transform(so_b).matrix, matrix_c)
Пример #3
0
 def test_similarity_transform_with_label( self ):
     matrix_a = np.array( [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] )
     matrix_b = np.array( [ [ 1, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ] ] )
     matrix_c = np.linalg.inv( matrix_a )
     so_a = SymmetryOperation( matrix_a )
     so_b = SymmetryOperation( matrix_b )
     label = 'foo'
     np.testing.assert_array_equal( so_a.similarity_transform( so_b, label=label ).label, label )
Пример #4
0
 def test_similarity_transform_with_label(self):
     matrix_a = np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]])
     matrix_b = np.array([[1, 0, 0], [0, 0, 1], [0, 1, 0]])
     matrix_c = np.linalg.inv(matrix_a)
     so_a = SymmetryOperation(matrix_a)
     so_b = SymmetryOperation(matrix_b)
     label = 'foo'
     np.testing.assert_array_equal(
         so_a.similarity_transform(so_b, label=label).label, label)