#NEWLINE# def test_Tensors( ) : #NEWLINE# #INDENT# ( i , j , k , l ) = symbols ( 'i j k l' , below_fermi = True , cls = Dummy ) #NEWLINE# ( a , b , c , d ) = symbols ( 'a b c d' , above_fermi = True , cls = Dummy ) #NEWLINE# ( p , q , r , s ) = symbols ( 'p q r s' ) #NEWLINE# AT = AntiSymmetricTensor #NEWLINE# assert ( AT ( 't' , ( a , b ) , ( i , j ) ) == ( - AT ( 't' , ( b , a ) , ( i , j ) ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , b ) , ( i , j ) ) == AT ( 't' , ( b , a ) , ( j , i ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , b ) , ( i , j ) ) == ( - AT ( 't' , ( a , b ) , ( j , i ) ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , a ) , ( i , j ) ) == 0 ) #NEWLINE# assert ( AT ( 't' , ( a , b ) , ( i , i ) ) == 0 ) #NEWLINE# assert ( AT ( 't' , ( a , b , c ) , ( i , j ) ) == ( - AT ( 't' , ( b , a , c ) , ( i , j ) ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , b , c ) , ( i , j , k ) ) == AT ( 't' , ( b , a , c ) , ( i , k , j ) ) ) #NEWLINE# tabij = AT ( 't' , ( a , b ) , ( i , j ) ) #NEWLINE# assert tabij . has ( a ) #NEWLINE# assert tabij . has ( b ) #NEWLINE# assert tabij . has ( i ) #NEWLINE# assert tabij . has ( j ) #NEWLINE# assert ( tabij . subs ( b , c ) == AT ( 't' , ( a , c ) , ( i , j ) ) ) #NEWLINE# assert ( ( 2 * tabij ) . subs ( i , c ) == ( 2 * AT ( 't' , ( a , b ) , ( c , j ) ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , a ) , ( i , j ) ) . subs ( a , b ) == AT ( 't' , ( b , b ) , ( i , j ) ) ) #NEWLINE# assert ( AT ( 't' , ( a , i ) , ( a , j ) ) . subs ( a , b ) == AT ( 't' , ( b , i ) , ( b , j ) ) )