Re: [sage-support] Re: Group action

2013-04-22 Thread Johannes
yea, that's nearly what I am looking for. Is it possible to consider a
weighted group action too?
e.g. If \xi is of order n and \xi a n-th root of unity.
g (p_1,\dots, p_n) \to (\xi^a_1 p1 , dots, \xi^a_n p_n)?
s.t. \sum a_i = n?
bg,
Johannes

On 19.04.2013 17:53, Simon King wrote:
> Hi Johannes,
> 
> On 2013-04-18, Johannes  wrote:
>> Hi guys,
>>
>> I have the following setting: Given a finite subgroup G of GL_\C(n) of
>> order k, acting on C[x_1,...,x_n] by multiplication with (potenz of a )
>> k-th root of unity. What is the best way, to translate this setting to sage?
>> In the end I'm interested into the ring of invariants under G and it's
>> representation as quotient.
> 
> Towards an answer:
> 
> Since you want to compute an invariant ring, and since CC is not exactly
> a field (rounding errors), it might make sense to work over a number
> field that contains a k-th root of unity. For example:
> 
> # Create the number field
> sage: F. = NumberField(x^6 + x^5 + x^4 + x^3 + x^2 + x + 1)
> sage: zeta^7 == 1
> True
> # Create a 3x3 matrix that acts by multiplication with zeta
> sage: MS = MatrixSpace(F, 3)
> sage: g = MS(zeta)
> # Create the corresponding matrix group. It has the correct order
> # Note that the method "multiplicative_order" or the matrix fails!
> sage: G = MatrixGroup([g])
> sage: G.order()
> 7
> # Compute a minimal generating set of the invariant ring, as a sub-ring
> sage: G.invariant_generators()
> [x3^7,
>  x2*x3^6,
>  x1*x3^6,
>  x2^2*x3^5,
>  x1*x2*x3^5,
>  x1^2*x3^5,
>  x2^3*x3^4,
>  x1*x2^2*x3^4,
>  x1^2*x2*x3^4,
>  x1^3*x3^4,
>  x2^4*x3^3,
>  x1*x2^3*x3^3,
>  x1^2*x2^2*x3^3,
>  x1^3*x2*x3^3,
>  x1^4*x3^3,
>  x2^5*x3^2,
>  x1*x2^4*x3^2,
>  x1^2*x2^3*x3^2,
>  x1^3*x2^2*x3^2,
>  x1^4*x2*x3^2,
>  x1^5*x3^2,
>  x2^6*x3,
>  x1*x2^5*x3,
>  x1^2*x2^4*x3,
>  x1^3*x2^3*x3,
>  x1^4*x2^2*x3,
>  x1^5*x2*x3,
>  x1^6*x3,
>  x2^7,
>  x1*x2^6,
>  x1^2*x2^5,
>  x1^3*x2^4,
>  x1^4*x2^3,
>  x1^5*x2^2,
>  x1^6*x2,
>  x1^7]
> 
> So, the invariant ring could be represented as a ring with not less than
> 36 generators, modulo algebraic relations. Now, I am afraid I don't know
> an easy way to find algebraic relations of the above sub-algebra
> generators---I am afraid I can't answer how to represent it as a
> quotient ring.
> 
> Best regards,
> Simon
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Group action

2013-04-20 Thread Johannes
thnx,
this looks nice. I'll have a deeper look at it in the next days.

bg,
Johannes

On 19.04.2013 17:53, Simon King wrote:
> Hi Johannes,
> 
> On 2013-04-18, Johannes  wrote:
>> Hi guys,
>>
>> I have the following setting: Given a finite subgroup G of GL_\C(n) of
>> order k, acting on C[x_1,...,x_n] by multiplication with (potenz of a )
>> k-th root of unity. What is the best way, to translate this setting to sage?
>> In the end I'm interested into the ring of invariants under G and it's
>> representation as quotient.
> 
> Towards an answer:
> 
> Since you want to compute an invariant ring, and since CC is not exactly
> a field (rounding errors), it might make sense to work over a number
> field that contains a k-th root of unity. For example:
> 
> # Create the number field
> sage: F. = NumberField(x^6 + x^5 + x^4 + x^3 + x^2 + x + 1)
> sage: zeta^7 == 1
> True
> # Create a 3x3 matrix that acts by multiplication with zeta
> sage: MS = MatrixSpace(F, 3)
> sage: g = MS(zeta)
> # Create the corresponding matrix group. It has the correct order
> # Note that the method "multiplicative_order" or the matrix fails!
> sage: G = MatrixGroup([g])
> sage: G.order()
> 7
> # Compute a minimal generating set of the invariant ring, as a sub-ring
> sage: G.invariant_generators()
> [x3^7,
>  x2*x3^6,
>  x1*x3^6,
>  x2^2*x3^5,
>  x1*x2*x3^5,
>  x1^2*x3^5,
>  x2^3*x3^4,
>  x1*x2^2*x3^4,
>  x1^2*x2*x3^4,
>  x1^3*x3^4,
>  x2^4*x3^3,
>  x1*x2^3*x3^3,
>  x1^2*x2^2*x3^3,
>  x1^3*x2*x3^3,
>  x1^4*x3^3,
>  x2^5*x3^2,
>  x1*x2^4*x3^2,
>  x1^2*x2^3*x3^2,
>  x1^3*x2^2*x3^2,
>  x1^4*x2*x3^2,
>  x1^5*x3^2,
>  x2^6*x3,
>  x1*x2^5*x3,
>  x1^2*x2^4*x3,
>  x1^3*x2^3*x3,
>  x1^4*x2^2*x3,
>  x1^5*x2*x3,
>  x1^6*x3,
>  x2^7,
>  x1*x2^6,
>  x1^2*x2^5,
>  x1^3*x2^4,
>  x1^4*x2^3,
>  x1^5*x2^2,
>  x1^6*x2,
>  x1^7]
> 
> So, the invariant ring could be represented as a ring with not less than
> 36 generators, modulo algebraic relations. Now, I am afraid I don't know
> an easy way to find algebraic relations of the above sub-algebra
> generators---I am afraid I can't answer how to represent it as a
> quotient ring.
> 
> Best regards,
> Simon
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Group action

2012-05-15 Thread Nathann Cohen
> IMHO most of the time is spent on IPC, via pexpect...

Oh, *THAT* is pexpect ? Then I guess I begin to understand why there
was so much fuss about it being slow some time ago ^^;

Nathann

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Group action

2012-05-15 Thread Dima Pasechnik


On Tuesday, 15 May 2012 09:54:15 UTC+2, Nathann Cohen wrote:
>
> > Well, you can call GAP,  e.g. as follows: 
> > 
> > sage: gap("Orbit("+str(ag._gap_())+",[1,2,7],OnSets);") 
> > [ [ 1, 2, 7 ], [ 1, 2, 3 ], [ 1, 6, 9 ], [ 2, 3, 4 ], [ 3, 4, 10 ], 
> >   [ 1, 6, 8 ], [ 3, 4, 8 ], [ 4, 9, 10 ], [ 4, 7, 9 ], [ 5, 8, 10 ], 
> >   [ 2, 5, 7 ], [ 5, 6, 8 ], [ 3, 5, 8 ], [ 4, 6, 9 ], [ 5, 7, 10 ], 
> >   [ 5, 7, 9 ], [ 6, 7, 9 ], [ 3, 6, 8 ], [ 1, 6, 10 ], [ 2, 7, 9 ], 
> >   [ 1, 2, 10 ], [ 2, 3, 8 ], [ 6, 8, 9 ], [ 1, 5, 10 ], [ 2, 3, 7 ], 
> >   [ 1, 4, 10 ], [ 5, 7, 8 ], [ 3, 4, 9 ], [ 4, 5, 10 ], [ 1, 2, 6 ] ] 
>
> THnk you Dima !! I finally got it to work thanks to you 
> Too me some time to find out that Gap would return a totally weird 
> error message if the list you give as an argument is not sorted, and I 
> guess most of the time it takes to run the computation is devoted to 
>

IMHO most of the time is spent on IPC, via pexpect...
 

> translating Gap object to Sage ones afterwards, but It works !! 
> ;- 
>
> (But Gap definitely has the worst syntax ever) 
>
> Nathann 
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Group action

2012-05-15 Thread Nathann Cohen
> Well, you can call GAP,  e.g. as follows:
>
> sage: gap("Orbit("+str(ag._gap_())+",[1,2,7],OnSets);")
> [ [ 1, 2, 7 ], [ 1, 2, 3 ], [ 1, 6, 9 ], [ 2, 3, 4 ], [ 3, 4, 10 ],
>   [ 1, 6, 8 ], [ 3, 4, 8 ], [ 4, 9, 10 ], [ 4, 7, 9 ], [ 5, 8, 10 ],
>   [ 2, 5, 7 ], [ 5, 6, 8 ], [ 3, 5, 8 ], [ 4, 6, 9 ], [ 5, 7, 10 ],
>   [ 5, 7, 9 ], [ 6, 7, 9 ], [ 3, 6, 8 ], [ 1, 6, 10 ], [ 2, 7, 9 ],
>   [ 1, 2, 10 ], [ 2, 3, 8 ], [ 6, 8, 9 ], [ 1, 5, 10 ], [ 2, 3, 7 ],
>   [ 1, 4, 10 ], [ 5, 7, 8 ], [ 3, 4, 9 ], [ 4, 5, 10 ], [ 1, 2, 6 ] ]

THnk you Dima !! I finally got it to work thanks to you
Too me some time to find out that Gap would return a totally weird
error message if the list you give as an argument is not sorted, and I
guess most of the time it takes to run the computation is devoted to
translating Gap object to Sage ones afterwards, but It works !!
;-

(But Gap definitely has the worst syntax ever)

Nathann

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Group action

2012-05-14 Thread Mike Hansen
On Mon, May 14, 2012 at 11:20 PM, Nathann Cohen  wrote:
>> One thing to watch out for is that the generators returned by
>> automorphism_group contain symbols that may not be the actual vertices. I
>> realised this once after several frustrating hours of bizarre results from
>> my program. I'm not sure if this is still the case in recent versions.
>
> Yep. I wasted 30 minutes easily on that one too. Actually the elements
> are always 1...n regardless of the graph's labelling (which often
> starts at 0). That's a shame.

This is because permutation groups used to not support arbitrary
domains.  Since they do now, it should be easy to return an
automorphism group that actually acts on the vertices.

--Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Group action

2012-05-14 Thread Nathann Cohen
> One thing to watch out for is that the generators returned by
> automorphism_group contain symbols that may not be the actual vertices. I
> realised this once after several frustrating hours of bizarre results from
> my program. I'm not sure if this is still the case in recent versions.

Yep. I wasted 30 minutes easily on that one too. Actually the elements
are always 1...n regardless of the graph's labelling (which often
starts at 0). That's a shame.

Nathann

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Group action

2012-05-14 Thread Emil
One thing to watch out for is that the generators returned by 
automorphism_group contain symbols that may not be the actual vertices. I 
realised this once after several frustrating hours of bizarre results from my 
program. I'm not sure if this is still the case in recent versions. 

Emil

On 15 May 2012, at 00:04, Dima Pasechnik  wrote:

> 
> 
> On Tuesday, 15 May 2012 01:02:46 UTC+2, Dima Pasechnik wrote:
> 
> 
> On Monday, 14 May 2012 16:57:40 UTC+2, Nathann Cohen wrote:
> Hellooo everybody !!! 
> 
> I would like to play with groups in Sage but I do not know how. I 
> actually get my groups from a graph in the following way : 
> 
> sage: g = graphs.PetersenGraph() 
> sage: ag = g.automorphism_group() 
> sage: type(ag) 
>  'sage.groups.perm_gps.permgroup.PermutationGroup_generic_with_category'> 
> 
> What I would like to do with this group is to consider it as a group 
> action on my vertices and compute the orbits of some *sets* of 
> vertices. Indeed, the method ag.orbits() would give me the list of all 
> orbits of my vertices, but I would like to compute the orbit of a Set 
> of vertices, that is all sets of the form "gg * my_set for gg in ag". 
> 
> Is there any way to achieve it with Sage ? 
> 
> Well, you can call GAP,  e.g. as follows:
> 
> sage: gap("Orbit("+str(ag._gap_())+",[1,2,7],OnSets);")
> [ [ 1, 2, 7 ], [ 1, 2, 3 ], [ 1, 6, 9 ], [ 2, 3, 4 ], [ 3, 4, 10 ], 
>   [ 1, 6, 8 ], [ 3, 4, 8 ], [ 4, 9, 10 ], [ 4, 7, 9 ], [ 5, 8, 10 ], 
>   [ 2, 5, 7 ], [ 5, 6, 8 ], [ 3, 5, 8 ], [ 4, 6, 9 ], [ 5, 7, 10 ], 
>   [ 5, 7, 9 ], [ 6, 7, 9 ], [ 3, 6, 8 ], [ 1, 6, 10 ], [ 2, 7, 9 ], 
>   [ 1, 2, 10 ], [ 2, 3, 8 ], [ 6, 8, 9 ], [ 1, 5, 10 ], [ 2, 3, 7 ], 
>   [ 1, 4, 10 ], [ 5, 7, 8 ], [ 3, 4, 9 ], [ 4, 5, 10 ], [ 1, 2, 6 ] ]
> sage: 
>  
> PS. it should not be hard to expand the ag.orbit method to incorporate the 
> action type...
> 
>  
> 
> Thaank youu  
> 
> Nathann 
> -- 
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org