#NEWLINE# def test_equivalent_internal_lines_VT2conjT2_AT( ) : #NEWLINE# #INDENT# ( i , j , k , l , m , n ) = symbols ( 'i j k l m n' , below_fermi = True , cls = Dummy ) #NEWLINE# ( a , b , c , d , e , f ) = symbols ( 'a b c d e f' , above_fermi = True , cls = Dummy ) #NEWLINE# ( p1 , p2 , p3 , p4 ) = symbols ( 'p1 p2 p3 p4' , above_fermi = True , cls = Dummy ) #NEWLINE# ( h1 , h2 , h3 , h4 ) = symbols ( 'h1 h2 h3 h4' , below_fermi = True , cls = Dummy ) #NEWLINE# from sympy.utilities.iterables import variations #NEWLINE# template = ( ( atv ( p1 , p2 , p3 , p4 ) * att ( p1 , p2 , i , j ) ) * att ( i , j , p3 , p4 ) ) #NEWLINE# permutator = variations ( [ a , b , c , d ] , 4 ) #NEWLINE# base = template . subs ( zip ( [ p1 , p2 , p3 , p4 ] , next ( permutator ) ) ) #NEWLINE# for permut in permutator : #NEWLINE# #INDENT# subslist = zip ( [ p1 , p2 , p3 , p4 ] , permut ) #NEWLINE# expr = template . subs ( subslist ) #NEWLINE# assert ( substitute_dummies ( expr ) == substitute_dummies ( base ) ) #NEWLINE# #UNINDENT# template = ( ( atv ( p1 , p2 , p3 , p4 ) * att ( p1 , p2 , j , i ) ) * att ( j , i , p3 , p4 ) ) #NEWLINE# permutator = variations ( [ a , b , c , d ] , 4 ) #NEWLINE# base = template . subs ( zip ( [ p1 , p2 , p3 , p4 ] , next ( permutator ) ) ) #NEWLINE# for permut in permutator : #NEWLINE# #INDENT# subslist = zip ( [ p1 , p2 , p3 , p4 ] , permut ) #NEWLINE# expr = template . subs ( subslist ) #NEWLINE# assert ( substitute_dummies ( expr ) == substitute_dummies ( base ) ) #NEWLINE# #UNINDENT# template = ( ( atv ( p1 , p2 , p3 , p4 ) * att ( p1 , p2 , i , j ) ) * att ( j , i , p3 , p4 ) ) #NEWLINE# permutator = variations ( [ a , b , c , d ] , 4 ) #NEWLINE# base = template . subs ( zip ( [ p1 , p2 , p3 , p4 ] , next ( permutator ) ) ) #NEWLINE# for permut in permutator : #NEWLINE# #INDENT# subslist = zip ( [ p1 , p2 , p3 , p4 ] , permut ) #NEWLINE# expr = template . subs ( subslist ) #NEWLINE# assert ( substitute_dummies ( expr ) == substitute_dummies ( base ) ) #NEWLINE# #UNINDENT# template = ( ( atv ( p1 , p2 , p3 , p4 ) * att ( p1 , p2 , j , i ) ) * att ( i , j , p3 , p4 ) ) #NEWLINE# permutator = variations ( [ a , b , c , d ] , 4 ) #NEWLINE# base = template . subs ( zip ( [ p1 , p2 , p3 , p4 ] , next ( permutator ) ) ) #NEWLINE# for permut in permutator : #NEWLINE# #INDENT# subslist = zip ( [ p1 , p2 , p3 , p4 ] , permut ) #NEWLINE# expr = template . subs ( subslist ) #NEWLINE# assert ( substitute_dummies ( expr ) == substitute_dummies ( base ) )