# $Source: /u/maple/research/lib/algcurves/src/RCS/parametrization,v $ # $Notify: mvanhoei@daisy.uwaterloo.ca $ macro( RAD={radical,nonreal}, parametrization=`algcurves/parametrization`, find_rat_point=`algcurves/find_rat_point` ): # Input: an irreducible algebraic curve f in x and y with genus 0. # Output: a parametrization [X(s),Y(s)]. Here X(s) and Y(s) are rational # functions in s, giving a bijective morphims from the projective line to # the algebraic curve f. parametrization:=proc(F,x,y,s) local f,t,p; options remember, `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; # Make sure that the coefficients are evala normalized: Normalizer:=`if`(has([args],RootOf),`evala/Normal`,normal); f:=collect(F,{x,y},'distributed',Normalizer); if indets([args],RAD)<>{} then f:=[args]; p := radfield(indets(f,RAD)); return eval(subs(p[2],procname(op(eval(subs(p[1],f)))))) elif not has(f,{x,y}) then error "Input should be a polynomial in",x,y elif ((not has(f,x) or not has(f,y)) and degree(f,{x,y})>1) or (has(evala(Content(f,x)),y) and has(f,x)) or (has(evala(Content(f,y)),x) and has(f,y)) then error "%1 is reducible",f fi; if degree(f,{x,y})<4 or degree(f,x)<2 or degree(f,y)<2 then # there is special code for these cases in the file ratpar p:=`algcurves/ratpar`(f,x,y,s,t,`parametrize by line`) else p:=find_rat_point(f,x,y); if p="genus is not 0" then error p fi; # by giving an extra argument one can choose for the second method if p<>'failed' and nargs=4 then # when given a rational regular point, the method in # ISSAC'94, is usually faster, so: userinfo(1,'algcurves',`Using the rational point`,p); p:=`algcurves/iss94`(f,x,y,s,p) else # In the cases where this heuristic find_rat_point can not # find a rational regular point ratpar is usually quicker. p:=`algcurves/ratpar`(f,x,y,s,t,`parametrize by line`) fi fi; # verifying correctness... t:=12345; while testeq(subs(s=t,denom(p[1])*denom(p[2]))) do t:=t+1 od; if not testeq(subs(x=p[1],y=p[2],s=t,f)) then error "found wrong answer" fi; userinfo(1,'algcurves',`verified correctness OK.`); p # See also http://www-math.sci.kun.nl/math/compalg/IntBasis/ # for papers, more documentation and examples. end: # Try to find a regular point on the curve # For use only in the procedure parametrization, for deciding # which method to take. find_rat_point:=proc(F,x,y) local vp,i,ext,f,d; global `algcurves/g_conversion1`,`algcurves/g_conversion2`; option `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; ext:=`algcurves/g_ext`(F); f:=subs(`algcurves/g_conversion1`,F); vp:=`algcurves/find_points`(f,x,y,ext,[`search points on`,{1}]); d:=degree(f,{x,y}); if (d-1)*(d-2)/2 <> add(i[3]*`algcurves/degree_ext`(i,f),i=vp) then return "genus is not 0" fi; d:={}; for i in vp do if `algcurves/degree_ext`(i,f)=1 and i[2]=1 then d:=d union {i[1]} fi od; if d<>{} then # Take the smallest one, that gives a nicer parametrization vp:=min(seq(length(i),i=d)); for i in d do if length(i)=vp then return subs(`algcurves/g_conversion2`,i) fi od fi; 'failed' end: #savelib ('parametrization','find_rat_point'):