William Hart on Mon, 26 Feb 2007 17:07:58 +0100

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

Re: Variable ordering

I see one potential workaround to the problem I
described in my post above, but it creates another
problem, which leads me to think I am doing things the
incorrect way in the first place. 

The problem seems to be that when doing something like


Pari rearranges this and makes it Mod(u*W,u^2) or
W*Mod(u,u^2) depending on the variable ordering in
Pari. One of these expressions it understands to be a
polynomial in W, the other it understands to be a
PolMod. It will be interpreted differently depending
on the variable order at the time one tries to operate
on the expression.

Originally I had a version of the toEllipticCurve
function (now long gone) which worked fine, but when I
added another function to my program, it stopped
working. The reason was that I had used one of the
variables u or W in that other function. Calling that
function first changed the variable order globally in
Pari and so the toEllipticCurve function stopped

I tried making that variable a local variable in the
other function, but this did nothing. This is also
when I discovered that this sets the value of the
variable to 0, which in some cases is not what you
want. Note in the toEllipticCurve function I am using
these variables as symbolic variables, not variables
containing actual constants.

So I guess what I can do is take the first component
of the Mod which Pari calculates and operate on that
(since Pari no longer sees the expression as a
polynomial in W). But whether I do this or not depends
on the current variable order, which depends on
whether I accidentally use that same variable in
another function in my program which gets called

So the only solution is to use different variables in
every single function, check how Pari has done the
calculation at each point of the computation, then
operate accordingly.

So I guess, given that I now have a potential
workaround, the question becomes, how *should* I have
done this computation in the first place, to prevent
this problem?


Bill Hart.
Warwick Uni.

Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.