--Select a suitable finite field KK = ZZ / 30097; --Set up the 16 components of the Fundamental matrix as --unknowns R = KK[f_(0,0)..f_(3,3)]; F = matrix apply( 4, i-> apply(4, j-> f_(i,j))); --Select random input data x1 = random( R^2, R^9); x2 = random( R^2, R^9); --Select u and v from the input. u1 = x1^{0}; v1 = x1^{1}; u2 = x2^{0}; v2 = x2^{1}; sqvec=(xx)-> fold( (a,b) -> a| b, apply( 9 , i-> xx_{i}*xx_{i} ) ); ff = xx->(oo := matrix { apply(9, i-> 1_R )};2*xx^{0} || 2*xx^{1}||-oo+ sqvec(xx^{0})+ sqvec(xx^{1})||oo+ sqvec(xx^{0})+ sqvec(xx^{1})) xx1 = ff( x1 ) ; xx2 = ff( x2 ) ; linEQ9 = fold( (a,b)->a||b, apply( 9, i-> (transpose xx1_{i})*F*xx2_{i} )) ; Q = matrix{{1_R,0,0,0},{0_R,1,0,0},{0_R,0,1,0},{0_R,0,0,-1}}; tr = A->fold( (a,b)->a+b , apply( 4, i-> det A_{i}^{i} ) ); Ft = transpose F; nonlinEQ = 2*F*Q*Ft*Q*F- tr( F*Q*Ft*Q)*F; rankEQ = matrix apply( subsets(4,3),j->apply( subsets( 4, 3 ) , i-> det F_i^j ) ); symeq = apply( subsets( 8,4) , i->det ( F||Ft)^i ); I = ideal linEQ9 + ideal nonlinEQ + ideal rankEQ + ideal(f_(0,0)-1); --gbTrace = 3; dim I , degree I