def is_solution_quad(var, coeff, u, v):
 reps = dict(zip(var, (u, v)))
 eq = Add(*[(j * i.xreplace(reps)) for (i, j) in coeff.items()])
 return (_mexpand(eq) == 0)

def is_solution_quad ( var , coeff , u , v ) : reps = dict ( zip ( var , ( u , v ) ) ) eq = Add ( * [ ( j * i . xreplace ( reps ) ) for ( i , j ) in coeff . items ( ) ] ) return ( _mexpand ( eq ) == 0 )
check whether is solution to the quadratic binary diophantine equation with the variable list var and coefficient dictionary coeff .