-
Notifications
You must be signed in to change notification settings - Fork 68
Expand the common code for ideal implementations #2108
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
base: master
Are you sure you want to change the base?
Conversation
This includes the addition of a `DefaultIdealSet` struct type which can be used with zero overhead, and hopefully can simply be used as parent type for all ideal implementations (in Hecke, Oscar or wherever) down the road. Also semi-documented the interfaces to be implemented (the list is surely incomplete but better than nothing).
I have mainly questions about
|
All good questions, I've been pondering them as well, and I thought I should make this PR precisely so that we have a somewhat better base for discussing them. Let's start with the non-commutative situation, I'll reply regarding Right now as far as I can tell this is completely open and unspecified, and we should at least have a rough plan before proceeding. Do we have any serious non-commutative rings with ideals in any of our packages? I realize there is some GB code for free associative algebras both here in AA (due to @julien-schanz @Sequenzer ) and in Oscar (based on Singular code). But the code in AA does not seem to even try to define an ideal type (and worse, it does not even seem to specify what kind of GB it computes: two-sided or one-sided...). The code in Oscar defines a type Do we have any other existing code for non-commutative ideals? Anyway, we now have some options how to proceed;
Regardless of which option we go, we need to agree on APIs if we want to support all kinds of ideals. Probably a good idea to also look at e.g. Sage and Magma for inspiration, which I have not yet done; just some general thoughts
I think to answer this well, we need actual applications involving one-sided ideals... Personally I think that option 1. is the way to go:
BTW, do we know someone who currently has an actual usecase for one-sided ideals? Who would be interested in discussing an implementing a design for them together with us? That'd be great! |
Regarding
While I understand that there is some loathing for But it seems OK for "toy" ideals over Z, fields, polynomial rings over fields? Or am I missing something? BTW if we go with a version of option 1, then I can also replace |
return ideal(parent(x), x; kw...) | ||
function *(I::Ideal{T}, p::T) where T <: RingElement | ||
iszero(p) && return similar(I, T[]) | ||
return similar(I, [v*p for v in gens(I)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so here, if we assume Ideal
means "two sided", and also "there is one (two-sided) ideal type per ring", and also ideal(R, xs)
produces that ideal type, then we can write here
return similar(I, [v*p for v in gens(I)]) | |
return ideal(base_ring(I), [v*p for v in gens(I)]) |
and indeed that's what I did before the second commit in this PR, and I'd be happy to back to it if we can agree on this scheme.
BTW a primary motivation is that I looked at ideal implementation in Oscar.jl and found
So I actually started with a partial PR for Oscar, then decided to shelf that for now, and instead work on the fundamental in AA. Once we have agreed on something here, I plan to proceed to make PRs for Hecke and Oscar to adjust things to it. |
|
||
function Base.:*(I::T, J::T) where {T <: Ideal} | ||
check_base_ring(I, J) | ||
return similar(I, [x*y for x in gens(I) for y in gens(J)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong for two-sided ideals of noncommutative rings.
I personally would remove anything related to non-commutative things from the "generic"/"fallback" stuff. I think the |
I think we can remove
|
I'd be fine with restricting all the work in here to the commutative setting, no problem. I wasn't really aware of the non-commutative ideals in Hecke, cool, I'll have a look eventually. But for now I am mainly concerned about having the commutative ideals suck less in terms of consistent user experience. I can also look into removing |
This includes the addition of a
DefaultIdealSet
struct type which can be used with zero overhead, and hopefully can simply be used as parent type for all ideal implementations (in Hecke, Oscar or wherever) down the road.Also semi-documented the interfaces to be implemented (the list is surely incomplete but better than nothing).