Skip to content
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 some ring / field conformance tests #1707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Contributor

... and fix some issues this revealed. In particular "missing" base_ring methods
which the conformance tests kind of assume, but here in some cases "only" base_field methods were available.

Contains #1706 because of overlap.

Also remove redundant dense_poly_type methods.
... and fix some issues this revealed
@thofma
Copy link
Owner

thofma commented Dec 19, 2024

I probably misunderstood something, but base_ring is not part of the ring interface. How can a missing base_ring method make the conformance tests fail?

@@ -134,6 +132,10 @@ end
#
################################################################################

function base_ring(L::LocalField)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be base_ring(L::LocalField) = base_field(L) instead?
But base_ring was never (intended to be) part of any useful interface, it was just indicating, in recursively defined rings, the previous step. Strictly here, base_ring might even have been the polynomial ring...
base_field, coefficient_ring/field were intended to be more useful

return sum( [r[i]*b[i] for i in 1:n])
end

# TODO/FIXME: implement isapprox so we can get rid of the following HACK:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? From the docs:

Approximation (floating point and ball arithmetic only)

isapprox(f::MyElem, g::MyElem; atol::Real=sqrt(eps()))

so it is not part of the normal ring/field interface I'd say

@fingolfin
Copy link
Contributor Author

No I don't think you missed anything -- the general conformance tests should not require base_ring. So this is a bug in them. It may still makes sense to test it if available (specifically: if base_ring is there, then so should base_ring_type, and they should agree).

We'll fix the conformance test suite, and once that's there, I can adjust this PR (there are still a few valid changes in here, like a missing hash function; and there are also some more rings defined in Hecke for which it would be IMHO useful to run conformance tests)

@@ -1,5 +1,12 @@
@testset "RelFinField" begin

@testset "conformance" begin
F = Native.finite_field(3, 3, cached = false)[1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thofma I thought we'd rather get rid of the RelFinField?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only replaced the ones in the prime decomposition of relative number fields. They might be used somewhere else still.

@thofma
Copy link
Owner

thofma commented Dec 20, 2024

Thanks for the clarification. I am also happy to help with missing methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants