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

Turn zzModRing & ZZModRing into ResidueRing subtypes #1819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Since the element types of these ring types are subtypes of ResElem, the
rings should be subtypes of ResidueRing. Otherwise some generic code
gets confused (notably check_parent for ResElem).

This lead to a wrong error in the OSCAR book's introduction notebook.

@joschmitt
Copy link
Collaborator

I'm sorry! Obviously, I didn't check this carefully enough yesterday evening.

Since the element types of these ring types are subtypes of ResElem, the
rings should be subtypes of ResidueRing. Otherwise some generic code
gets confused (notably check_parent for ResElem).

This lead to a wrong error in the OSCAR book's introduction notebook.
@fingolfin
Copy link
Member Author

Hrm, this changes messes up the rand delegation, which already is a mess in itself... sigh.

@@ -410,7 +410,7 @@ The ring $\mathbb Z/n\mathbb Z$ for some $n$. See [`residue_ring`](@ref).
Implementation for the modulus being a machine integer [`Int`](@ref).
For the modulus being a [`ZZRingElem`](@ref) see [`ZZModRing`](@ref).
"""
@attributes mutable struct zzModRing <: Ring
@attributes mutable struct zzModRing <: ResidueRing{UInt}
Copy link
Member

Choose a reason for hiding this comment

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

I would argue that this should also be ResidueRing{ZZRingElem}?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well we have

julia> supertypes(zzModRingElem)
(zzModRingElem, ResElem{UInt64}, RingElem, NCRingElem, SetElem, Any)

and these should match, I think?

Copy link
Member

@thofma thofma Jul 8, 2024

Choose a reason for hiding this comment

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

makes sense, unfortunately

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