#NEWLINE# def test_multiplication( ) : #NEWLINE# #INDENT# A = MatrixSymbol ( 'A' , n , m ) #NEWLINE# B = MatrixSymbol ( 'B' , m , l ) #NEWLINE# C = MatrixSymbol ( 'C' , n , n ) #NEWLINE# assert ( ( ( 2 * A ) * B ) . shape == ( n , l ) ) #NEWLINE# assert ( ( ( A * 0 ) * B ) == ZeroMatrix ( n , l ) ) #NEWLINE# raises ( ShapeError , ( lambda : ( B * A ) ) ) #NEWLINE# assert ( ( 2 * A ) . shape == A . shape ) #NEWLINE# assert ( ( ( A * ZeroMatrix ( m , m ) ) * B ) == ZeroMatrix ( n , l ) ) #NEWLINE# assert ( ( ( C * Identity ( n ) ) * C . I ) == Identity ( n ) ) #NEWLINE# assert ( ( B / 2 ) == ( S . Half * B ) ) #NEWLINE# raises ( NotImplementedError , ( lambda : ( 2 / B ) ) ) #NEWLINE# A = MatrixSymbol ( 'A' , n , n ) #NEWLINE# B = MatrixSymbol ( 'B' , n , n ) #NEWLINE# assert ( ( Identity ( n ) * ( A + B ) ) == ( A + B ) )