-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conformance tests for is_unit
and is_nilpotent
#1941
Comments
I propose testing also minus one:
And perhaps also along similar lines:
|
After talking to @fingolfin here is a simple function for generating a nilpotent element: it can be very slow (since it factorizes) and works only if the modulus is a single value.
Bother: it does not work for |
Regarding Regarding generating nilpotent elements and units for testing purposes: my idea was to have a pair of methods complementing function test_elem_nilpotent(R::Ring)
return zero(R)
end
function test_elem_nilpotent(R::ResidueRing)
error("TODO: factor modulus")
end
function test_elem_nilpotent(R::PolyRing)
S = coefficient_ring(R)
t = gen(R)
return sum(test_elem_nilpotent(S)*t^i for i in 0:3)
end
function test_elem_nilpotent(R::MPolyRing)
S = coefficient_ring(R)
t = gen(R,1)
# TODO: use all variables / generate random exponent vectors instead
return sum(test_elem_nilpotent(S)*t^i for i in 0:3)
end
#
function test_elem_unit(R::Ring)
if applicable(base_ring, R)
S = base_ring(R)
return R(test_elem_unit(S)) + test_elem_nilpotent(R)
end
return one(R) + test_elem_nilpotent(R)
end BTW the function names are not great -- but I wanted something that riffs on |
Once more regarding
|
Some ideas (assuming we exclude zero rings at the start):
For a random element
x
:Then we have of course tests of polynomials rings over a ring -- those could also have some tests for specific polynomials, i.e. if the indeterminate is
t
thenis_unit(1+t) == false
, etc.The text was updated successfully, but these errors were encountered: