#NEWLINE# def test_representing_matrices( ) : #NEWLINE# #INDENT# ( R , x , y ) = ring ( 'x,y' , QQ , grlex ) #NEWLINE# basis = [ ( 0 , 0 ) , ( 0 , 1 ) , ( 1 , 0 ) , ( 1 , 1 ) ] #NEWLINE# F = [ ( ( ( ( x ** 2 ) - x ) - ( 3 * y ) ) + 1 ) , ( ( ( ( ( - 2 ) * x ) + ( y ** 2 ) ) + y ) - 1 ) ] #NEWLINE# assert ( _representing_matrices ( basis , F , x ) == [ [ [ QQ ( 0 , 1 ) , QQ ( 0 , 1 ) , ( - QQ ( 1 , 1 ) ) , QQ ( 3 , 1 ) ] , [ QQ ( 0 , 1 ) , QQ ( 0 , 1 ) , QQ ( 3 , 1 ) , ( - QQ ( 4 , 1 ) ) ] , [ QQ ( 1 , 1 ) , QQ ( 0 , 1 ) , QQ ( 1 , 1 ) , QQ ( 6 , 1 ) ] , [ QQ ( 0 , 1 ) , QQ ( 1 , 1 ) , QQ ( 0 , 1 ) , QQ ( 1 , 1 ) ] ] , [ [ QQ ( 0 , 1 ) , QQ ( 1 , 1 ) , QQ ( 0 , 1 ) , ( - QQ ( 2 , 1 ) ) ] , [ QQ ( 1 , 1 ) , ( - QQ ( 1 , 1 ) ) , QQ ( 0 , 1 ) , QQ ( 6 , 1 ) ] , [ QQ ( 0 , 1 ) , QQ ( 2 , 1 ) , QQ ( 0 , 1 ) , QQ ( 3 , 1 ) ] , [ QQ ( 0 , 1 ) , QQ ( 0 , 1 ) , QQ ( 1 , 1 ) , ( - QQ ( 1 , 1 ) ) ] ] ] )