Bill Allombert on Wed, 18 Jul 2012 18:17:03 +0200


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

Re: (Mod(1,2)*x*y)^0


On Wed, Jul 18, 2012 at 05:17:12PM +0200, Karim Belabas wrote:
> * Bill Allombert [2012-07-17 14:15]:
> > ? Mod(1,2)^0
> > %1 = Mod(1,2)
> > ? (Mod(1,2)*x)^0
> > %2 = Mod(1,2)
> > ? (Mod(1,2)*x*y)^0
> > %3 = 1
> > 
> > Is it intended ?
> 
> Yes :-(
> 
> The code to determine "the" base ring for a given polynomial [ RgX_type() ]
> was adapted from factor(), and only supports univariate polynomials.
> 
> What ^0 does in principle is to return "1" in this base ring. When that
> ring can't be determined, as here, we just return the integer 1 and hope
> for the best.
> 
> The main reason for this behaviour is to avoid checking that the
> question even makes sense [ as in Pi*x + Mod(1,2), where it doesn't ].
> The code supports all kind of devious constructs involving t_QUAD,
> t_COMPLEX with t_INTMOD coefficients, t_PADICs, etc. Right now, whenever
> factor doesn't understand what's going on, it just aborts:
> 
> (17:06) gp > factor(Mod(1,4)*x+Mod(1,2))
>   ***   at top-level: factor(Mod(1,4)*x+Mo
>   ***                 ^--------------------
>   *** factor: sorry, factor for general polynomials is not yet implemented.
> 
> 
> Trying to compute a "common domain" on the spot from an arbitrary collection
> of unrelated coefficients is really the wrong approach if one wants sensible
> answers in all cases, esp. cases never needed in the PARI library itself.

What I want to fix is 
? E=ellinit([a1,a2,a3,a4,a6]*Mod(1,2));
? elldivpol(E,2)
%4 = 4*x^3+Mod(1,2)*a1^2*x^2+Mod(1,2)*a3^2

(the 4*x^3 is really ugly), so I tried to use E.disc^0 but that did not work.

Cheers,
Bill.