#NEWLINE# def test_kronecker_delta_secondquant( ) : #NEWLINE# #INDENT# 'secondquant-specific methods' #NEWLINE# D = KroneckerDelta #NEWLINE# ( i , j , v , w ) = symbols ( 'i j v w' , below_fermi = True , cls = Dummy ) #NEWLINE# ( a , b , t , u ) = symbols ( 'a b t u' , above_fermi = True , cls = Dummy ) #NEWLINE# ( p , q , r , s ) = symbols ( 'p q r s' , cls = Dummy ) #NEWLINE# assert ( D ( i , a ) == 0 ) #NEWLINE# assert ( D ( i , t ) == 0 ) #NEWLINE# assert ( D ( i , j ) . is_above_fermi is False ) #NEWLINE# assert ( D ( a , b ) . is_above_fermi is True ) #NEWLINE# assert ( D ( p , q ) . is_above_fermi is True ) #NEWLINE# assert ( D ( i , q ) . is_above_fermi is False ) #NEWLINE# assert ( D ( q , i ) . is_above_fermi is False ) #NEWLINE# assert ( D ( q , v ) . is_above_fermi is False ) #NEWLINE# assert ( D ( a , q ) . is_above_fermi is True ) #NEWLINE# assert ( D ( i , j ) . is_below_fermi is True ) #NEWLINE# assert ( D ( a , b ) . is_below_fermi is False ) #NEWLINE# assert ( D ( p , q ) . is_below_fermi is True ) #NEWLINE# assert ( D ( p , j ) . is_below_fermi is True ) #NEWLINE# assert ( D ( q , b ) . is_below_fermi is False ) #NEWLINE# assert ( D ( i , j ) . is_only_above_fermi is False ) #NEWLINE# assert ( D ( a , b ) . is_only_above_fermi is True ) #NEWLINE# assert ( D ( p , q ) . is_only_above_fermi is False ) #NEWLINE# assert ( D ( i , q ) . is_only_above_fermi is False ) #NEWLINE# assert ( D ( q , i ) . is_only_above_fermi is False ) #NEWLINE# assert ( D ( a , q ) . is_only_above_fermi is True ) #NEWLINE# assert ( D ( i , j ) . is_only_below_fermi is True ) #NEWLINE# assert ( D ( a , b ) . is_only_below_fermi is False ) #NEWLINE# assert ( D ( p , q ) . is_only_below_fermi is False ) #NEWLINE# assert ( D ( p , j ) . is_only_below_fermi is True ) #NEWLINE# assert ( D ( q , b ) . is_only_below_fermi is False ) #NEWLINE# assert ( not D ( i , q ) . indices_contain_equal_information ) #NEWLINE# assert ( not D ( a , q ) . indices_contain_equal_information ) #NEWLINE# assert D ( p , q ) . indices_contain_equal_information #NEWLINE# assert D ( a , b ) . indices_contain_equal_information #NEWLINE# assert D ( i , j ) . indices_contain_equal_information #NEWLINE# assert ( D ( q , b ) . preferred_index == b ) #NEWLINE# assert ( D ( q , b ) . killable_index == q ) #NEWLINE# assert ( D ( q , t ) . preferred_index == t ) #NEWLINE# assert ( D ( q , t ) . killable_index == q ) #NEWLINE# assert ( D ( q , i ) . preferred_index == i ) #NEWLINE# assert ( D ( q , i ) . killable_index == q ) #NEWLINE# assert ( D ( q , v ) . preferred_index == v ) #NEWLINE# assert ( D ( q , v ) . killable_index == q ) #NEWLINE# assert ( D ( q , p ) . preferred_index == v ) #NEWLINE# assert ( D ( q , p ) . killable_index == q ) #NEWLINE# EV = evaluate_deltas #NEWLINE# assert ( EV ( ( D ( a , q ) * F ( q ) ) ) == F ( a ) ) #NEWLINE# assert ( EV ( ( D ( i , q ) * F ( q ) ) ) == F ( i ) ) #NEWLINE# assert ( EV ( ( D ( a , q ) * F ( a ) ) ) == ( D ( a , q ) * F ( a ) ) ) #NEWLINE# assert ( EV ( ( D ( i , q ) * F ( i ) ) ) == ( D ( i , q ) * F ( i ) ) ) #NEWLINE# assert ( EV ( ( D ( a , b ) * F ( a ) ) ) == F ( b ) ) #NEWLINE# assert ( EV ( ( D ( a , b ) * F ( b ) ) ) == F ( a ) ) #NEWLINE# assert ( EV ( ( D ( i , j ) * F ( i ) ) ) == F ( j ) ) #NEWLINE# assert ( EV ( ( D ( i , j ) * F ( j ) ) ) == F ( i ) ) #NEWLINE# assert ( EV ( ( D ( p , q ) * F ( q ) ) ) == F ( p ) ) #NEWLINE# assert ( EV ( ( D ( p , q ) * F ( p ) ) ) == F ( q ) ) #NEWLINE# assert ( EV ( ( ( D ( p , j ) * D ( p , i ) ) * F ( i ) ) ) == F ( j ) ) #NEWLINE# assert ( EV ( ( ( D ( p , j ) * D ( p , i ) ) * F ( j ) ) ) == F ( i ) ) #NEWLINE# assert ( ( EV ( ( D ( p , q ) * D ( p , i ) ) ) * F ( i ) ) == ( D ( q , i ) * F ( i ) ) )