Re: [sage-support] Re: Invariant Polynomes under group action

2011-08-14 Thread Johannes
No, would be nice if there is one, which I just dont know of. There are
algorithmic solution for my problem the other way round (given the group
G, calculate the invariant ring I). But in my eyes the problem looks not
that hard. Most times you see the solution very fast without calcualting
anything.
my main problem lays in the number of generators of I. There are up to
39 in one special case and 902 in total.

greatz
Am 14.08.2011 20:00, schrieb Simon King:
> Hi Johannes,
> 
> On 14 Aug., 19:54, Johannes  wrote:
>> Hi list
>> I have given an Ideal I in the polynomial ring R and I need to know the
>> minimal group G wich acts on I such that I is the Invariant Ring of R
>> under the action of G.
> 
> Just out of curiosity: Do you have  a reference for an algorithmic
> solution of that problem?
> 
> Cheers,
> Simon
> 

-- 
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


[sage-support] Re: Rotate of Bits

2011-08-14 Thread Benjamin Jones


On Aug 13, 3:00 am, Simon King  wrote:
> Hi Santanu, hi Benjamin,
>
> On 13 Aug., 06:23, Benjamin Jones  wrote:
>
> > On Aug 12, 9:38 pm, Santanu Sarkar 
> > See section 5.4.1 of:
>
> >http://docs.python.org/library/stdtypes.html
>
> I doubt that that is answering the question: "I have  64 bit integer
> N. I want to rotate bits of N cyclically 5 bits right and 5 bits left
> to generate two integers N1, N2."

You're right, I didn't mean to leave a complete answer to the
question, just the hint about shifting that I had time to post.

>
> sage: def rotate(I,n):
> :     right_end = I%(2^n)
> :     left_end_shifted = I>>n
> :     return left_end_shifted+(right_end<<(I.nbits()-n))
> :
> sage: I = ZZ(randint(100,500))
> sage: I.binary()
> '11101100'
> sage: rotate(I,3).binary()
> '10011101'
>
> Or do you mean that you consider ALL 64 bits of your integer, even
> leading zeroes? Then I guess you have to replace "I.nbits()-n" by "64-
> n". That was cyclic rotation n bits to the right side, I hope you are
> able to modify the example for cyclic rotation to the left side.
>
> Cheers,
> Simon

This is exactly what I had in mind. Good example.. I didn't realize
that Sage integers had a binary() method.

--
BFJ

-- 
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


[sage-support] Re: Invariant Polynomes under group action

2011-08-14 Thread Simon King
Hi Johannes,

On 14 Aug., 19:54, Johannes  wrote:
> Hi list
> I have given an Ideal I in the polynomial ring R and I need to know the
> minimal group G wich acts on I such that I is the Invariant Ring of R
> under the action of G.

Just out of curiosity: Do you have  a reference for an algorithmic
solution of that problem?

Cheers,
Simon

-- 
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


[sage-support] Invariant Polynomes under group action

2011-08-14 Thread Johannes
Hi list
I have given an Ideal I in the polynomial ring R and I need to know the
minimal group G wich acts on I such that I is the Invariant Ring of R
under the action of G.
for example:
let R =  CC.,
I the ideal generated by


let G \subset SL_3(CC) act by a e_i -> a x_i. If xi is a third primitive
root of unity, then G must be generated by
diagonalmatrix(xi,xi,xi).

Is there a easy way to calculate G from I with Sage?

greatz Johannes

-- 
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] bug in groups.prod?

2011-08-14 Thread Johannes
I got my error, i mixed prod and cartesian_product.


Am 14.08.2011 16:50, schrieb Johannes:
> Hi list,
> i tried to compute the product of two matrix groups and run in a gap
> parsing error.
> Miniexample:
> g1 = MatrixGroup([Matrix(CC,[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0],
> [0, 0, 0, 1]])])
> g2 = MatrixGroup([Matrix(CC,[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0],
> [0, 0, 0, I]])])
> g1.prod(g2)
> 
> this leads to the following output:
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (146, 0))
> 
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (396, 0))
> 
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (29, 0))
> 
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (5, 0))
> 
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (29, 0))
> 
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (5, 0))
> 
> ---
> TypeError Traceback (most recent call last)
> 
> /home/j_schn14/studium/diplarbeit/tex/ in ()
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/categories/monoids.pyc
> in prod(self, args)
> 145 'ab'
> 146 """
> --> 147 return prod(args, self.one())
> 148
> 149 def _test_prod(self, **options):
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/misc/cachefunc.pyc
> in __call__(self, *args, **kwds)
> 553 return self.cache[k]
> 554 except KeyError:
> --> 555 w =
> self._cachedmethod._instance_call(self._instance, *args, **kwds)
> 556 self.cache[k] = w
> 557 return w
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/misc/cachefunc.pyc
> in _instance_call(self, inst, *args, **kwds)
> 776
> 777 """
> --> 778 return self._cachedfunc.f(inst, *args, **kwds)
> 779
> 780 def _get_instance_cache(self, inst):
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/categories/monoids.pyc
> in one(self)
>  81 ''
>  82 """
> ---> 83 return self(1)
>  84
>  85 def one_element(self):
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/groups/matrix_gps/matrix_group.pyc
> in __call__(self, x)
> 249 M = self.matrix_space()(x)
> 250 g = self.element_class(M, self)
> --> 251 if not gap(g) in gap(self):
> 252 raise TypeError, "no way to coerce element to self."
> 253 return g
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> in __call__(self, x, name)
>1099 return cls(self, x, name=name)
>1100 try:
> -> 1101 return self._coerce_from_special_method(x)
>1102 except TypeError:
>1103 raise
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> in _coerce_from_special_method(self, x)
>1123 s = '_gp_'
>1124 try:
> -> 1125 return (x.__getattribute__(s))(self)
>1126 except AttributeError:
>1127 return self(x._interface_init_())
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/structure/sage_object.so
> in sage.structure.sage_object.SageObject._gap_
> (sage/structure/sage_object.c:3909)()
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/structure/sage_object.so
> in sage.structure.sage_object.SageObject._interface_
> (sage/structure/sage_object.c:3428)()
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/groups/matrix_gps/matrix_group_element.py
> in _gap_init_(self)
> 166 true
> 167 """
> --> 168 return self.__mat._gap_init_()
> 169
> 170 def _gap_latex_(self):
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/matrix/matrix1.so
> in sage.matrix.matrix1.Matrix._gap_init_ (sage/matrix/matrix1.c:2277)()
> 
> /opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> in __call__(self, x, name)
>1099 return cls(self, x, name=name)
>1100 try:
> -> 1101 return self._coerce_from_special_method(x)
>1102 except TypeError:
>1103 raise
> 
> /opt/sa

[sage-support] bug in groups.prod?

2011-08-14 Thread Johannes
Hi list,
i tried to compute the product of two matrix groups and run in a gap
parsing error.
Miniexample:
g1 = MatrixGroup([Matrix(CC,[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0],
[0, 0, 0, 1]])])
g2 = MatrixGroup([Matrix(CC,[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0],
[0, 0, 0, I]])])
g1.prod(g2)

this leads to the following output:
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (146, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (396, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (29, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (5, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (29, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (5, 0))

---
TypeError Traceback (most recent call last)

/home/j_schn14/studium/diplarbeit/tex/ in ()

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/categories/monoids.pyc
in prod(self, args)
145 'ab'
146 """
--> 147 return prod(args, self.one())
148
149 def _test_prod(self, **options):

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/misc/cachefunc.pyc
in __call__(self, *args, **kwds)
553 return self.cache[k]
554 except KeyError:
--> 555 w =
self._cachedmethod._instance_call(self._instance, *args, **kwds)
556 self.cache[k] = w
557 return w

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/misc/cachefunc.pyc
in _instance_call(self, inst, *args, **kwds)
776
777 """
--> 778 return self._cachedfunc.f(inst, *args, **kwds)
779
780 def _get_instance_cache(self, inst):

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/categories/monoids.pyc
in one(self)
 81 ''
 82 """
---> 83 return self(1)
 84
 85 def one_element(self):

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/groups/matrix_gps/matrix_group.pyc
in __call__(self, x)
249 M = self.matrix_space()(x)
250 g = self.element_class(M, self)
--> 251 if not gap(g) in gap(self):
252 raise TypeError, "no way to coerce element to self."
253 return g

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
in __call__(self, x, name)
   1099 return cls(self, x, name=name)
   1100 try:
-> 1101 return self._coerce_from_special_method(x)
   1102 except TypeError:
   1103 raise

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
in _coerce_from_special_method(self, x)
   1123 s = '_gp_'
   1124 try:
-> 1125 return (x.__getattribute__(s))(self)
   1126 except AttributeError:
   1127 return self(x._interface_init_())

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._gap_
(sage/structure/sage_object.c:3909)()

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._interface_
(sage/structure/sage_object.c:3428)()

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/groups/matrix_gps/matrix_group_element.py
in _gap_init_(self)
166 true
167 """
--> 168 return self.__mat._gap_init_()
169
170 def _gap_latex_(self):

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/matrix/matrix1.so
in sage.matrix.matrix1.Matrix._gap_init_ (sage/matrix/matrix1.c:2277)()

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
in __call__(self, x, name)
   1099 return cls(self, x, name=name)
   1100 try:
-> 1101 return self._coerce_from_special_method(x)
   1102 except TypeError:
   1103 raise

/opt/sage-4.6/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
in _coerce_from_special_method(self, x)
   1123 s = '_gp_'
   1124 try:
-> 1125 return (x.__getattribute__(s))(self)
   1126 except AttributeError:
   1127 return self(x._interface_init_())

/opt/sage-4.6/local/lib/python2.

[sage-support] Re: unit roots

2011-08-14 Thread Simon King
Hi Johannes,

On 14 Aug., 15:09, Johannes  wrote:
> I have to deal with unit roots for some calculations.

I suppose you mean primitive roots of unity in CC?

> And for simplicity
> I want to give the n-th unit root a name (lets say xi) instead of
> dealing with numeric values.
> Up to know I solved this by definig xi to be the solution of
> $x^n -1 == 0$ for a given $n$ but how can I name a solution of this
> equation?

Perhaps you want in fact compute in a cyclotomic field:

sage: K. = CyclotomicField(8)
sage: xi^8 == 1
True
sage: xi^4 == 1
False

Hence, xi is a primitive 8-th root of unity.

K has a default embedding into CC, but K is not identified with a
subring of CC, and also xi is not identified with its numerical
evaluation:

sage: CC(xi)
0.707106781186548 + 0.707106781186547*I
sage: CC.is_subring(K)
False
sage: xi
xi

Also, you can easily obtain a list of all possible embeddings of K
into CC:
sage: K.embeddings(CC)
[
Ring morphism:
  From: Cyclotomic Field of order 8 and degree 4
  To:   Complex Field with 53 bits of precision
  Defn: xi |--> -0.707106781186548 - 0.707106781186548*I,
Ring morphism:
  From: Cyclotomic Field of order 8 and degree 4
  To:   Complex Field with 53 bits of precision
  Defn: xi |--> -0.707106781186548 + 0.707106781186548*I,
Ring morphism:
  From: Cyclotomic Field of order 8 and degree 4
  To:   Complex Field with 53 bits of precision
  Defn: xi |--> 0.707106781186548 - 0.707106781186548*I,
Ring morphism:
  From: Cyclotomic Field of order 8 and degree 4
  To:   Complex Field with 53 bits of precision
  Defn: xi |--> 0.707106781186548 + 0.707106781186548*I
]

Best regards,
Simon

-- 
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


[sage-support] unit roots

2011-08-14 Thread Johannes
Hi list,
I have to deal with unit roots for some calculations. And for simplicity
I want to give the n-th unit root a name (lets say xi) instead of
dealing with numeric values.
Up to know I solved this by definig xi to be the solution of
$x^n -1 == 0$ for a given $n$ but how can I name a solution of this
equation?
Or whatz the best way to handle unit roots in sage?
Even father, if I dont specify $n$ and try this:

x,n = var('x,n')
assume(n,'integer')
assume(x != 1)
solve(x**n -1,x)

I just get [] as solution.

greatz Johannes

-- 
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