oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
338 stars 120 forks source link

Extend invariant computation to permutation groups #1346

Closed fingolfin closed 2 years ago

fingolfin commented 2 years ago

The function invariant_ring currently is implemented for matrix groups (resp. a list of matrix generators).

We should also add a constructor invariant_ring(K::Field, G::PermGroup) (with K defaulting to QQ if it is omitted).

In the first approximation, this could simply create an isomorphic matrix group over K, generated by the corresponding permutation matrices. That will be good enough to get us going.

I think various algorithms could potentially be made faster in this context, too. E.g. at the very bottom level, the action of a permutation (matrix) on a polynomial is cheaper to compute than that of an arbitrary matrix. Alas, we don't want to duplicate everything. My hope would be that we can carefully restructure the code, adding a few key abstraction with differing implementations for matrix vs. permutation groups, and then Julia does the rest for us... Of course that's just a rather high-level naive thought, one needs to look carefully over the code and implementation (and possibly re-implement more Singular code in Julia)

joschmitt commented 2 years ago

Without really looking into it I would say that it should not be too much of a problem to implement a special right_action for elements of permutation groups and let Julia call it if appropriate. And as soon as one can compute bases of a fixed degree component the primary and secondary invariants should "just work".

However, I didn't have time in the past weeks (months?) to really work on the invariant theory and I still have work-in-progress branches for better secondary invariants and algebra syzygies lingering around...

fingolfin commented 2 years ago

Yeah, I also don't think it'll require too much effort, and when I have some spare time, I'll try to tackle it.

As to your work in progress: Feel free to open draft PRs for those WIP branches, then perhaps others can help out.

ThomasBreuer commented 2 years ago

Since I am interested (at least) in the group action part, I have made an experiment. The following works after a few changes.

julia> G = symmetric_group(3); action = gens(G); IR = Oscar.InvRing(QQ, G, action)
Invariant ring of
Sym( [ 1 .. 3 ] )
with generators
PermGroupElem[(1,2,3), (1,2)]

julia> primary_invariants(IR)
3-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
 x[1] + x[2] + x[3]
 x[1]*x[2] + x[1]*x[3] + x[2]*x[3]
 x[1]^3 + x[2]^3 + x[3]^3

julia> secondary_invariants(IR)
1-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
 1

Here is the list of changes:

joschmitt commented 2 years ago

This looks good, thank you! I hope that the action_singular can be completely removed at some point. But so far it is at least needed for the fundamental invariants which still call the Singular implementation. When I implemented right_action it was to have this functionality at all. I think for matrices it makes sense to return a map, because one can do some precomputations. If you have other suggestions, I'm of course open for this. In the end, group actions should probably exist generically anyways? Probably they already do?

ThomasBreuer commented 2 years ago

Concerning the availability of group actions, there is src/Groups/action.jl, which defines for example on_indeterminates(f::Nemo.MPolyElem, s::PermGroupElem) to return the polynomial obtained from f by permuting the indeterminates with s. (The analogous function for the matrix action on multivariate polynomials is not yet there.)