Opened 5 years ago
Last modified 4 years ago
#19391 needs_work enhancement
Move invariant_generators to libsingular
Reported by: | mmarco | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.10 |
Component: | group theory | Keywords: | |
Cc: | SimonKing, wdj | Merged in: | |
Authors: | Miguel Marco | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | u/mmarco/invariants (Commits) | Commit: | 2fa234ad8ef3fe4a264617ca79ecadc88c134a67 |
Dependencies: | Stopgaps: |
Description
This patch moves the .invariant_generators() method of finite matrix groups to libsingular, which simplifies much the code.
It also adds the possibility of defining the ring in which the result should be:
sage: m1 = matrix(QQ, [[0, -1], [1, 0]]) sage: G = MatrixGroup([m1]) sage: G.invariant_generators() [x0^2 + x1^2, x0^4 + x1^4, x0^3*x1 - x0*x1^3] sage: R.<x,y> = QQ[] sage: G.invariant_generators(R) [x^2 + y^2, x^4 + y^4, x^3*y - x*y^3]
Change History (9)
comment:1 Changed 5 years ago by
- Status changed from new to needs_review
comment:2 Changed 5 years ago by
- Branch set to u/mmarco/invariants
comment:3 Changed 5 years ago by
- Commit set to 24817f2e6d63c25ad45f0628bb7a45ffaa6c724f
comment:4 Changed 5 years ago by
Ok, i read in the header that you moved the computation of the reynolds operator to gap, but i didn't see any call to gap in the code. Now i see it, you mean this part, right?:
ReyName = 't'+singular._next_var_name() singular.eval('matrix %s[%d][%d]'%(ReyName,self.cardinality(),n)) for i in range(1,self.cardinality()+1): M = Matrix(elements[i-1],F) D = [{} for foobar in range(self.degree())] for x,y in M.dict().items(): D[x[0]][x[1]] = y for row in range(self.degree()): for t in D[row].items(): singular.eval('%s[%d,%d]=%s[%d,%d]+(%s)*var(%d)' %(ReyName,i,row+1,ReyName,i,row+1, repr(t[1]),t[0]+1))
What i don't understand is this part:
else: ReyName = 't'+singular._next_var_name() singular.eval('list %s=group_reynolds((%s))'%(ReyName,Lgens)) IRName = 't'+singular._next_var_name() singular.eval('matrix %s = invariant_algebra_reynolds(%s[1])'%(IRName,ReyName))
If i am getting it right, it is supposed to cover the case where there are no elements in the group. In that case we should just return the ring itself.
comment:5 Changed 5 years ago by
- Commit changed from 24817f2e6d63c25ad45f0628bb7a45ffaa6c724f to 6a025ba30f71b0fa6da03d526ab0879a4df6d355
Branch pushed to git repo; I updated commit sha1. New commits:
6a025ba | Compute reynolds operator before passing it to singular
|
comment:6 Changed 5 years ago by
Ok, now it computes the reynolds operator before passing it to singular.
I am now working on the modular case. I having trouble getting the output of invariant_ring from libsingular. The singular command is supposed to return three matrices, but calling it through libsingular only gets the first one:
sage: from sage.libs.singular.function import singular_function sage: import sage.libs.singular.function_factory sage: sage.libs.singular.function_factory.lib('finvar.lib') sage: inring = singular_function('invariant_ring') sage: F=FiniteField(2) sage: R.<x,y> = F[] sage: m1 = matrix(R, 2, [0,1,1,0]) sage: inring(m1) [x + y x*y]
Any clue about how to get around this?
comment:7 Changed 5 years ago by
- Commit changed from 6a025ba30f71b0fa6da03d526ab0879a4df6d355 to 2fa234ad8ef3fe4a264617ca79ecadc88c134a67
Branch pushed to git repo; I updated commit sha1. New commits:
2fa234a | Modular case
|
comment:8 Changed 5 years ago by
Ok, i think it should be ok now. I added the modular case.
I think that this code should be faster than the previous one, since it does the same, but using the faster libsingular interface rather than the string based one. If you have some interesting examples to test, please benchmark them.
The code now is simpler. But there was a reason to have it like that: Singular isn't good at listing the elements of a group (which is needed for the Reynolds operator).
If I recall correctly, there were examples for which the computation of the Reynolds operator in Singular was too slow. Apparently these examples didn't go into the doctests. But perhaps they are available at the trac ticket for the original version of the code?
New commits:
Moved invariant_generators to libsingular, added option to fix the ring