# $Source: /u/maple/research/lib/algcurves/src/RCS/Weierstrassform,v $ # $Notify: hoeij@sci.kun.nl $ macro( Weierstrassform=`algcurves/Weierstrassform`, find_a_point=`algcurves/find_a_point` ): macro( singularities=`algcurves/singularities`, find_points=`algcurves/find_points`, degree_ext=`algcurves/degree_ext` ): macro( g_conversion1=`algcurves/g_conversion1`, g_conversion2=`algcurves/g_conversion2`, g_normal=`algcurves/g_normal`, g_expand=`algcurves/g_expand`, normal_tcoeff=`algcurves/normal_tcoeff`, g_evala=`algcurves/g_evala`, g_evala_rem=`algcurves/g_evala_rem`, g_zero_of=`algcurves/g_zero_of`, g_factors=`algcurves/g_factors`, rootof=`algcurves/rootof`, g_ext=`algcurves/g_ext`, g_ext_r=`algcurves/g_ext_r`, truncate=`algcurves/truncate` ): Weierstrassform:=proc(F,x,y,x0,y0) global `algcurves/x0`,`algcurves/y0`; local f,p; options remember, `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved.`; readlib(`algcurves/g_expand`): readlib(`algcurves/puiseux`): readlib(`algcurves/integral_basis`): readlib(`algcurves/singularities`): readlib(`algcurves/homogeneous`): readlib(`algcurves/iss94`): readlib(`algcurves/genus1`): readlib(`algcurves/ratpar`): # Make sure that the coefficients are evala normalized: f:=collect(F,{x,y},'distributed',g_normal); if indets([args],radical)<>{} then f:=[args]; f:=procname(op(subs(readlib(`radnormal/radfield`)(f,'p'),f))); RETURN(subs(eval(p),f)) elif not has(f,x) or not has (f,y) then ERROR(`genus is not 1`) elif has(evala(Content(f,x)),y) or has(evala(Content(f,y)),x) then ERROR(f,`is reducible`) fi; if nargs<6 or not type(args[6],list) then p:=find_a_point(f,x,y); if p=`genus is not 1` then ERROR(p) fi else p:=NULL fi; # The reason for using this global `algcurves/x0` is that the # options remember in `algcurves/genus1` will be more effective # this way. subs(`algcurves/x0`=x0,`algcurves/y0`=y0,`algcurves/genus1`( f,x,y,`algcurves/x0`,`algcurves/y0`,p,args[6..nargs])) end: # Find a regular point on the curve # For use only in the procedure Weierstrassform, for taking # a regular point and checking g=1. find_a_point:=proc(F,x,y) local vp,i,ext,f,d,m; global g_conversion1,g_conversion2; option `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved.`; ext:=g_ext(F); f:=subs(g_conversion1,F); vp:=find_points(f,x,y,ext,[`search points on`,{1,2,3}]); d:=degree(f,{x,y}); if (d-1)*(d-2)/2-convert([seq(i[3]*degree_ext(i,f),i=vp)] ,`+`)<>1 then RETURN(`genus is not 1`) fi; # Add a regular point, just in case we found no regular points yet. i:=0; while testeq(discrim(subs(x=i,F),y)) do i:=i+1 od; vp:=vp union {seq([[i,RootOf(d[1],y),1],1,0], d=g_factors(subs(x=i,f),y,g_ext_r(F)))}; d:={}; m:=min(seq(`if`(i[2]=1,degree_ext(i,f),infinity),i=vp)); for i in vp do if degree_ext(i,f)=m and i[2]=1 then d:=d union {i[1]} fi od; # Take the smallest one. m:=min(seq(length(i),i=d)); for i in d do if length(i)=m then RETURN(subs(g_conversion2,i)) fi od; # The following can't happen, d can not be empty because # there should at least be one regular point in there (we # placed it there in the beginning of this procedure. ERROR() end: #savelib ('Weierstrassform','find_a_point','`algcurves/Weierstrassform.m`'):