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
345 stars 126 forks source link

Invariant ring and polynomial ring with complex coefficients #687

Closed StevellM closed 3 years ago

StevellM commented 3 years ago

Hi,

so currently I am trying to compute invariant polynomials under the action of a group. I have an irreducible representation of this action in R^6. So I have created a MatrixGroup from the matrices I had and I looked for its invariant_ring (which I have done over CC and QQ). However, even if in theory I get the invariant rings, I don't have any access to the polynomial ring or the generators of these invariant rings (which are the output that I would at least try to obtain). In particular, I would like to use the method presented in the Documentation presented as basis... How could it may be fixed ?

joschmitt commented 3 years ago

I should mention that the invariant theory in Oscar is currently work in progress, so a lot of things don't work properly (yet!) and the interface (names of functions, what exactly they return etc.) might change. Still, let's try to make it work for you. The function invariant_ring you probably used only produces a "cache" and no actual computations are performed at this step. Let's assume you have a MatrixGroup G and R = invariant_ring(G). Then you can access the polynomial ring on which the group acts by calling polynomial_ring(R). If you want to have generators of the invariant ring, you can do fundamental_invariants(R). It would be best if you could provide us with a short code snippet showing what you tried to do.

StevellM commented 3 years ago

Thanks ! So for the context, I have an element M which is a vector of vectors of vectors, so I needed to create alternative matrices Mii to get the information. Here I show the case where I considered things over QQ.

M11 = matrix(QQ,6,6, [M[1][i][j] for i=1:6, j=1:6]) M22 = matrix(QQ,6,6, [M[2][i][j] for i=1:6, j=1:6]) M33 = matrix(QQ,6,6, [M[3][i][j] for i=1:6, j=1:6]) M44 = matrix(QQ,6,6, [M[4][i][j] for i=1:6, j=1:6]) M55 = matrix(QQ,6,6, [M[5][i][j] for i=1:6, j=1:6]) M66 = matrix(QQ,6,6, [M[6][i][j] for i=1:6, j=1:6]) M77 = matrix(QQ,6,6, [M[7][i][j] for i=1:6, j=1:6]) Gq = matrix_group([M11,M22,M33,M44,M55,M66,M77]) Rq = invariant_ring(Gq)

Once I get this, I obtain this kind of things:

julia> fundamental_invariants(Rq) ERROR: UndefVarError: fundamental_invariants not defined Stacktrace: [1] top-level scope @ REPL[7]:1

fieker commented 3 years ago

On Thu, Sep 16, 2021 at 11:53:43PM -0700, Stevell Muller wrote:

Thanks ! So for the context, I have an element M which is a vector of vectors of vectors, so I needed to create alternative matrices Mii to get the information. Here I show the case where I considered things over QQ.

M11 = matrix(QQ,6,6, [M[1][i][j] for i=1:6, j=1:6]) M22 = matrix(QQ,6,6, [M[2][i][j] for i=1:6, j=1:6]) M33 = matrix(QQ,6,6, [M[3][i][j] for i=1:6, j=1:6]) M44 = matrix(QQ,6,6, [M[4][i][j] for i=1:6, j=1:6]) M55 = matrix(QQ,6,6, [M[5][i][j] for i=1:6, j=1:6]) M66 = matrix(QQ,6,6, [M[6][i][j] for i=1:6, j=1:6]) M77 = matrix(QQ,6,6, [M[7][i][j] for i=1:6, j=1:6])

MM = [matrix(QQ, x) for x = M] Gq = matrix_group(MM) should have a chance of working...(well, this won't affect the missing invariant ring, but simplifies the top bit)

Gq = matrix_group([M11,M22,M33,M44,M55,M66,M77]) Rq = invariant_ring(Gq)

Once I get this, I obtain this kind of things:

julia> fundamental_invariants(Rq) ERROR: UndefVarError: fundamental_invariants not defined Stacktrace: [1] top-level scope @ REPL[7]:1

and even, if I try to look at the methods that I can apply to my Rq, I read this:

julia> methods(Rq) 0 methods:

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/oscar-system/Oscar.jl/issues/687#issuecomment-921545590

wdecker commented 3 years ago

Can you please send all of the code so that we can run the example here. Is your group finite?

joschmitt commented 3 years ago

Once I get this, I obtain this kind of things:

julia> fundamental_invariants(Rq) ERROR: UndefVarError: fundamental_invariants not defined Stacktrace: [1] top-level scope @ REPL[7]:1

Sorry, my mistake. fundamental_invariants was only added last week I think, so it's not yet in the release version of Oscar you probably use. There should be primary_invariants and irreducible_secondary_invariants which together also form a generating system for the invariant ring (however in general not a minimal one). Maybe you have to call those with Oscar. in front.

StevellM commented 3 years ago

Can you please send all of the code so that we can run the example here. Is your group finite? (@wdecker )

M = [ [ [ -1, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, -1, 0 ], [ 0, 0, 0, 0, 0, -1 ], [ 0, 0, 0, 1, 0, 0 ], [ 0, -1, 0, 0, 0, 0 ], [ 0, 0, -1, 0, 0, 0 ] ], [ [ 0, 0, 0, 0, 0, 1 ], [ 0, 0, 0, -1, 0, 0 ], [ 1, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 1, 0 ], [ 0, -1, 0, 0, 0, 0 ], [ 0, 0, 1, 0, 0, 0 ] ], [ [ -1, 0, 0, 0, 0, 0 ], [ 0, -1, 0, 0, 0, 0 ], [ 0, 0, -1, 0, 0, 0 ], [ 0, 0, 0, -1, 0, 0 ], [ 0, 0, 0, 0, 1, 0 ], [ 0, 0, 0, 0, 0, 1 ] ], [ [ -1, 0, 0, 0, 0, 0 ], [ 0, 1, 0, 0, 0, 0 ], [ 0, 0, 1, 0, 0, 0 ], [ 0, 0, 0, -1, 0, 0 ], [ 0, 0, 0, 0, -1, 0 ], [ 0, 0, 0, 0, 0, -1 ] ], [ [ 0, 0, 0, 1, 0, 0 ], [ 0, -1, 0, 0, 0, 0 ], [ 0, 0, -1, 0, 0, 0 ], [ 1, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, -1 ], [ 0, 0, 0, 0, -1, 0 ] ], [ [ 0, 0, 0, -1, 0, 0 ], [ 0, 0, -1, 0, 0, 0 ], [ 0, -1, 0, 0, 0, 0 ], [ -1, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, -1, 0 ], [ 0, 0, 0, 0, 0, -1 ] ], [ [ 1, 0, 0, 0, 0, 0 ], [ 0, 1, 0, 0, 0, 0 ], [ 0, 0, 1, 0, 0, 0 ], [ 0, 0, 0, 1, 0, 0 ], [ 0, 0, 0, 0, 1, 0 ], [ 0, 0, 0, 0, 0, 1 ] ] ] MM = [matrix(QQ, x) for x = M] Gq = matrix_group(MM) Rq = invariant_ring(Gq)

(Following the suggestion above of @fieker )

My group is finite yes, I took a description of it from all_small_groups with id (192,1493). M is an irreducible representation in R^6.

@joschmitt Great, I have tried it, it is running now so I will see how it goes!

StevellM commented 3 years ago

Everything seems to work, I have been able to compute invariants. I will just make a little note: in my code, if I decide to replace QQ by CC = ComplexField(64) everything works: But then, if I apply Oscar.primary_invariants to the new invariant ring, I am literally ejected from Julia, and I am brought back to the shell with this line.

signal (11): Speicherzugriffsfehler in expression starting at REPL[18]:1 unknown function (ip: (nil)) Allocations: 53676186 (Pool: 53637113; Big: 39073); GC: 29 Speicherzugriffsfehler

Thanks again otherwise for the help on the problem!

thofma commented 3 years ago

You cannot compute compute invariant rings over the complex numbers. They cannot be represented exactly. The error could be more helpful though. You can do matrix groups over finite fields, Q, or extensions of Q.

Usually one can get away by computing the invariant ring over some finite extension of Q.

joschmitt commented 3 years ago

For what it's worth: in Singular you can "compute" invariant rings over the complex numbers. But you get a lot of nice prints telling you that the computations cannot be trusted due to rounding errors.

Julia probably crashes here because we so far don't convert acb-complex numbers to Singular ones.

StevellM commented 3 years ago

Oh yes I see, I will try to manage with what I got over Q then. And otherwise I will look as you mentioned @thofma for finite extensions.

wdecker commented 3 years ago

Let's be precise here: Your matrix group is defined over QQ, so the Reynolds operator applied to monomials of a specific degree will return invariants defined over QQ as well. Similarly, if your group is defined over some extension field of QQ, you will get results defined over that extension field. So the primary and secondary invariants you will compute over one of these ground fields will also be primary and secondary invariants for the invariant ring over CC: There is no need to extend the given ground field.

StevellM commented 3 years ago

Since I was looking for homogeneous polynomials of a certain degree, I was trying to take the "biggest" field possible in case I don't have any good results over Q. Lucky me, it works as I wanted over Q so I won't have to do any such extensions. But thanks for the precision, I tend to forget this point.