On Tue, Apr 8, 2014 at 10:20 AM, Kevin Buzzard <[email protected]> wrote: > I am new to sage. I am not scared of reading docs for computer programs. I > cannot work out how to answer basic questions I have from the sage docs > though :-( and it's so easy just to ask for help, so here I am. > > Here's my question. I have a polynomial with coefficients in a cyclotomic > field and I want to know how to compute the product of that polynomial with > all its Galois conjugates (because I want to run newton_slopes on it but the > manual is not, as far as I can see, clear on whether this will work, so I'm > going to build a polynomial for which I know it will work).
The line you want is h = prod(R([sigma(a) for a in f.list()]) for sigma in G.list()); h Here's a complete example: K.<z> = CyclotomicField(5) R.<x> = K[] f = (x-(z^3 + 2*z^2 + z + 2))^2*(x - 5*z) f.newton_slopes(11) # not useful... / wrong? G = K.galois_group() h = prod(R([sigma(a) for a in f.list()]) for sigma in G.list()); h h.newton_slopes(11) William > > Here's my issue: although I would love to work out how to do this myself by > reading the docs, I spent 30 minutes failing and now I have to go and feed > my kids :-/ Here is why I failed. > > 1) I went to http://www.sagemath.org/doc/reference/index.html and typed > cyclotomic fields into the quick search box, in an attempt to find a simple > page about how to access the Galois group of a cyclotomic field. I got 53 > results and none of them seemed to be about cyclotomic fields :-( > > 2) I gave up on this, created a cyclotomic field K, and typed "K.[tab]" and > spotted the answer: K.galois_group() . > > 3) Now I have my group. Let g be an element. I have my polynomial f. How to > hit it with an element of the group? g(f)? No. Probably need to access the > coefficients by hand. How do I turn a polynomial into a list of > coefficients? How do I turn a list of coefficients into a polynomial? I > search the sage docs for "polynomial". Am I being naive here? If I were > searching the python docs for something, I would probably find a page about > that something, containing explanations of how to create the something and > how to manipulate it. The search for polynomial in the sage docs gives me > unusable results. I give up with the docs again. > > 4) f.[tab] tells me that it's f.coefficients() I'm after. > > 5) I manage to hit the list of coefficients with the element of Galois! > > 6) Now I have to turn the new list of coefficients back into a polynomial. > And now I'm in trouble because I can't use the tab trick any more and I > don't understand the docs. Of course I can try and remind myself how python > lists work (from the python manual :-/ ) and then just build the conjugate > by summing the conjugates of the coefficients and multiplying by powers of > x. But surely there is a command which does this and not only do I not know > the command, I don't know how to find it out without simply asking. And to > be honest I am not 100% confident that I will be able to create sum_i a_i > x^i in sage because I am still a bit unsure about x and x^i at this point > (although probably more reading the manual will sort this out for me). > > So the question I actually want to know the answer to is how to compute > prod_{g in G}g(f) in sage, G a Galois group, f a polynomial. But the > question I should really be told the answer to is how I am supposed to be > using the sage manual to answer my questions, because when the tab trick > doesn't work I am lost. > > Kevin > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
