#NEWLINE# def test_inner_product( ) : #NEWLINE# #INDENT# ( i , j , k , l ) = symbols ( 'i,j,k,l' ) #NEWLINE# s1 = BBra ( [ 0 ] ) #NEWLINE# s2 = BKet ( [ 1 ] ) #NEWLINE# assert ( InnerProduct ( s1 , Dagger ( s1 ) ) == 1 ) #NEWLINE# assert ( InnerProduct ( s1 , s2 ) == 0 ) #NEWLINE# s1 = BBra ( [ i , j ] ) #NEWLINE# s2 = BKet ( [ k , l ] ) #NEWLINE# r = InnerProduct ( s1 , s2 ) #NEWLINE# assert ( r == ( KroneckerDelta ( i , k ) * KroneckerDelta ( j , l ) ) )