Bill Hale on Thu, 8 May 2003 10:05:06 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Priority of variables


At 11:27 AM +0100 5/8/03, Cherry Kearton wrote:
> Unfortunately reorder() does not seem to work for the purposes
> of rnfinit, as the following session shows:
>
> ? reorder([y,x])
> %1 = [y, x]
> ? reorder()
> %2 = [y, x]
> ? A=nfinit(x^5 - 495635);
> ? B=rnfinit(A,y^3 + 5*y + 5)
>   ***   main variable must be of higher priority in rnfinitalg.
> ?
>
> Is there anything one can do about this?

I think reorder([y,x]) only affects the external display of
things. It does not affect the internal order. Thus, to the
function rnfinit, y is not of higher priority than x
internally. See my comment at the very end on how
reorder([..]) can affect the output display format.

My suggestion is not to use reorder([...]) at all, except
for reorder() to see the current order of variables. I have
just begun using Pari, and I do not understand the details.
As I said before, I have run into other problesm after
having done a "reorder" on the variables.

Here is parts of the code that I am using to compute
the Lagrange resolvents for the 7th root of unity.
I give comments below.

\\==============================
r;w;
f = (w^7-1)/(w-1);
E = nfinit(f);
w = Mod(w,f);
g = (r^3-1)/(r-1);
E = rnfinit(E,g);
r = Mod(r,g);
res = w + r*w^2 + r^2*w^4;
res
lift(res)
lift(lift(res))
\\==============================

Note I declare "r;w;" to get the priority right, even though
I use w first.

Note that I declare "w=Mod(w,f)" so that I can use w as
an element of the field E, rather than as the variable
of the polynomial f. I am not completely sure that this
is sound, but I have not run into any trouble doing this.

Note that I reuse the variable E to extend the field to
include the cubic root of 1. You may not like that
approach, but I didn't want to have a proliferation of
fields.

Note that I declare "r=Mod(r,g)" just like I did for w.

Note that I use "lift(lift(res))" to get a better display
of the field element res. It is unfortunate that I need
to apply lift as many times as I extended the base field Q.

If you now do "reorder([w,r]);lift(lift(res))", you get
the output to be:

     (-r - 1)*w^4 + r*w^2 + w

rather than

    (-w^4 + w^2)*r + (-w^4 + w).

That is, I have switched the basis elements from r to w. This
is when I started experimenting with "reorder([w,r])". Here,
it did what I wanted, but I ran into other problems when
I tried to do other calculations in the field E.

Instead of using "reorder" to change the basis of the output
display, I had to write my own function to pickoff the
coefficients so that I could display field elements in the
basis 1, w, w^2, w^3, w^4, w^5, w^6 rather than the basis
1, r.

-- Bill Hale