Changeset 6c265b in git
- Timestamp:
- Sep 30, 2010, 8:07:01 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 3576f6fb6a525ec1407b464179ffc8ad1f2c0ea7
- Parents:
- 2433c5682fb607c4eeab2b77ea5d2c54269b493c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/paraplanecurves.lib
r2433c5 r6c265b 10 10 F. Seelisch, seelisch@mathematik.uni-kl.de 11 11 12 OVERVIEW: 12 OVERVIEW: 13 13 14 14 A library for computing rational parametrizations of rational plane curves … … 26 26 and y as algebraic and computes an integral basis in C(x)[y] of the integral 27 27 closure of C[x] in C(x,y) using the normalization algorithm from 28 @ref normal.lib: see @ref int basis.lib. In a future edition of the library,28 @ref normal.lib: see @ref integralbasis.lib. In a future edition of the library, 29 29 also van Hoeij's algorithm for computing the integral basis will be 30 30 available. @* … … 32 32 Alternatively, the algorithm starts with a local analysis of the singular 33 33 locus of C. Then, for each primary component of the singular locus which 34 does not correspond to ordinary multiple points or cusps, the integral 34 does not correspond to ordinary multiple points or cusps, the integral 35 35 basis algorithm is applied separately. The ordinary multiple points and 36 cusps, in turn, are adressed by a straightforward direct algorithm. The 37 adjoint ideal is obtained by intersecting all ideals obtained locally. 36 cusps, in turn, are adressed by a straightforward direct algorithm. The 37 adjoint ideal is obtained by intersecting all ideals obtained locally. 38 38 The local variant of the algorithm is used by default. @* 39 39 The linear system corresponding to the adjoint ideal maps the curve … … 62 62 http://www.math.fsu.edu/~hoeij/papers/comments/jsc1994.html 63 63 64 KEYWORDS: 64 KEYWORDS: 65 65 Curves; Parametrization; Rational curves; Adjoint ideal; Geometric genus 66 66 … … 85 85 paraConic(poly); Compute a rational parametrization of a conic 86 86 testParametrization(poly,ring); Checks whether a given curve is parametrized 87 by a given rational map (defined in the 87 by a given rational map (defined in the 88 88 given ring) 89 testPointConic(poly,ring); Checks whether a given point (defined in the 89 testPointConic(poly,ring); Checks whether a given point (defined in the 90 90 given ring) lies on the given conic. 91 91 "; … … 98 98 LIB "random.lib"; 99 99 LIB "homolog.lib"; 100 LIB "int basis.lib";100 LIB "integralbasis.lib"; 101 101 LIB "normal.lib"; 102 102 … … 111 111 not define a birational map. 112 112 RETURN: ring, the coordinate ring of P, with an ideal 113 named J and an ideal named psi. 114 @format The ideal J defines the image of phi.@* 113 named J and an ideal named psi. 114 @format The ideal J defines the image of phi.@* 115 115 The ideal psi gives the inverse of phi.@* 116 116 Note that the entries of psi should be considered as representatives … … 127 127 def Roriginal = basering; 128 128 int n = nvars(Roriginal); 129 int m = size(phi); 129 int m = size(phi); 130 130 /*phi: P^(n-1) --> P^(m-1)*/ 131 131 list rl = ringlist(Roriginal); … … 133 133 for(k = 1; k <= n; k++) 134 134 { 135 rl[2][k] = "x("+string(k)+")"; 136 } 135 rl[2][k] = "x("+string(k)+")"; 136 } 137 137 for(k = 1; k <= m; k++) 138 138 { 139 rl[2][k+n] = "y("+string(k)+")"; 140 } 139 rl[2][k+n] = "y("+string(k)+")"; 140 } 141 141 rl[3]= list(list("dp",1:(n+m)),list("C",0)); 142 142 /*Use Hilbert driven Buchberger*/ … … 153 153 intvec Hgraph = hilb(graph,1); 154 154 setring Roriginal; 155 rl[3]= list(list("dp",1:n),list("dp",1:m),list("C",0)); 155 rl[3]= list(list("dp",1:n),list("dp",1:m),list("C",0)); 156 156 def Rbig = ring(rl); 157 157 setring Rbig; 158 158 ideal graph = imap(Rbig0,graph); 159 graph = std(graph,Hgraph); 159 graph = std(graph,Hgraph); 160 160 ideal xv = imap(Rbig0,xv); 161 161 /*The ideal J defines the image of phi*/ … … 163 163 for(k = 1; k <= n; k++) 164 164 { 165 J = subst(J,xv[k],0); 166 } 165 J = subst(J,xv[k],0); 166 } 167 167 J = compress(J); 168 168 /*now we start inverting phi to psi*/ … … 170 170 for(k = 1; k <= n; k++) 171 171 { 172 relpsi = subst(relpsi,xv[k],0); 173 } 172 relpsi = subst(relpsi,xv[k],0); 173 } 174 174 relpsi = compress(relpsi); 175 175 list rl = ringlist(Rbig); … … 210 210 "USAGE: checkAssumptions(f); f poly 211 211 RETURN: 1 if assumptions are satisfied, 0 otherwise.@* 212 Assumptions checked are: basering is polynomial ring in 3 variables 212 Assumptions checked are: basering is polynomial ring in 3 variables 213 213 with coefficients in Q, f is homogeneous and absolutely irreducible 214 214 " … … 216 216 def Roriginal = basering; 217 217 list rl = ringlist(Roriginal); 218 rl[3] = list(list("dp",1:3),list("C",0)); 218 rl[3] = list(list("dp",1:3),list("C",0)); 219 219 if(size(rl[1])>1){ERROR("ground field is not Q");} 220 220 if(rl[1]!=0){ERROR("ground field is not Q");} … … 224 224 { ERROR("not a projective plane curve: polynomial is not homogeneous"); } 225 225 def RP2 = ring(rl); 226 setring RP2; 226 setring RP2; 227 227 poly f = fetch(Roriginal,f); 228 if(isIrreducible(f)==0){ERROR("curve is not absolutely irreducible");} 228 if(isIrreducible(f)==0){ERROR("curve is not absolutely irreducible");} 229 229 setring Roriginal; 230 230 } … … 233 233 proc paraPlaneCurve(poly f, list #) 234 234 "USAGE: paraPlaneCurve(f [,c]); f poly , c optional integer@* 235 optional integer c can be: @* 235 optional integer c can be: @* 236 236 1: compute integral basis via normalization. @* 237 237 2: make local analysis of singularities first and apply normalization … … 258 258 Alternatively, the algorithm starts with a local analysis of the singular 259 259 locus of C. Then, for each primary component of the singular locus which 260 does not correspond to ordinary multiple points or cusps, the integral 260 does not correspond to ordinary multiple points or cusps, the integral 261 261 basis algorithm is applied separately. The ordinary multiple points and 262 cusps, in turn, are adressed by a straightforward direct algorithm. The 263 adjoint ideal is obtained by intersecting all ideals obtained locally. 262 cusps, in turn, are adressed by a straightforward direct algorithm. The 263 adjoint ideal is obtained by intersecting all ideals obtained locally. 264 264 The local variant of the algorithm is used by default. @* 265 265 The linear system corresponding to the adjoint ideal maps the curve … … 275 275 EXAMPLE: example paraPlaneCurve; shows an example 276 276 " 277 { 278 if(size(#)==0) {int choice = 2;} else {int choice = #[1];} 279 def Roriginal = basering; 277 { 278 if(size(#)==0) {int choice = 2;} else {int choice = #[1];} 279 def Roriginal = basering; 280 280 /*checking assumptions and handling the conic case*/ 281 281 checkAssumptions(f); … … 284 284 rl[3] = list(list("dp",1:3),list("C",0)); 285 285 def RP2 = ring(rl); 286 setring RP2; 286 setring RP2; 287 287 poly f = fetch(Roriginal,f); 288 288 int d = deg(f); … … 298 298 "// setring RP1; PARA;"; 299 299 return(RP1); 300 } 300 } 301 301 int k; 302 /*the adjoint ideal*/ 303 ideal AI = adjointIdeal(f,list(choice,"rattestyes/firstchecksdone")); 302 /*the adjoint ideal*/ 303 ideal AI = adjointIdeal(f,list(choice,"rattestyes/firstchecksdone")); 304 304 /*rattestyes -> causes error message if curve is not rational*/ 305 305 /*firstchecksdone -> prevents that check of assumptions will be done again*/ … … 320 320 for(k = 1; k <= m; k++) 321 321 { 322 PROJ = subst(PROJ,var(k),AI[k]); 322 PROJ = subst(PROJ,var(k),AI[k]); 323 323 } 324 324 setring RP2; … … 339 339 "// setring RP1; PARA;"; 340 340 return(RP1); 341 } 341 } 342 342 /*the even dimensional case*/ 343 343 /*mapping the rational normal curve to a CONIC in P^2* creating PHI*/ 344 344 def RP2conic = rncItProjEven(RNC); // exports PHI, returns ring 345 345 // containing CONIC 346 setring RP2conic; 346 setring RP2conic; 347 347 /*mapping the conic to P^1 via pencil defined by Ipoint*/ 348 348 def RP2conicNew = projConic(CONIC); // ring containing ideal Ipoint … … 356 356 for(k = 1; k <= 3; k++) 357 357 { 358 PROJ = subst(PROJ,var(k),PHI[k]); 359 } 358 PROJ = subst(PROJ,var(k),PHI[k]); 359 } 360 360 ideal AI = fetch(RP2,AI); 361 361 for(k = 1; k <= m; k++) 362 362 { 363 PROJ = subst(PROJ,var(k+3),AI[k]); 363 PROJ = subst(PROJ,var(k+3),AI[k]); 364 364 } 365 365 setring RP2conicNew; … … 367 367 ideal PROJ = imap(Rbig,PROJ); 368 368 /*inverting the composed map to psi*/ 369 def rp1 = invertBirMap(PROJ,If); // (ring, (J,psi)) 369 def rp1 = invertBirMap(PROJ,If); // (ring, (J,psi)) 370 370 setring rp1; 371 371 list rl1 = ringlist(rp1); … … 394 394 def Rp2 = paraPlaneCurve(f2); 395 395 setring Rp2; 396 PARA; 396 PARA; 397 397 } 398 398 … … 402 402 ASSUME: The polynomial f is homogeneous in three variables, JAC is 403 403 the Jacobi ideal of f. 404 RETURN: intvec, say a,b,c. After the coordinate change 404 RETURN: intvec, say a,b,c. After the coordinate change 405 405 var(3) --> a*var(1)+b*var(2)+c*var(3), the curve {f=0} 406 406 has no singularities at infinity {var(3)=0}. … … 421 421 Jfinfty = JAC,a*var(1)+b*var(2)+c*var(3); 422 422 if(dim(std(Jfinfty)) == 0) 423 { 423 { 424 424 return(a,b,c); 425 425 } … … 429 429 } 430 430 h = h+1; 431 } 431 } 432 432 } 433 433 … … 459 459 Alternatively, the algorithm starts with a local analysis of the singular 460 460 locus of C. Then, for each primary component of the singular locus which 461 does not correspond to ordinary multiple points or cusps, the integral 461 does not correspond to ordinary multiple points or cusps, the integral 462 462 basis algorithm is applied separately. The ordinary multiple points and 463 cusps, in turn, are adressed by a straightforward direct algorithm. The 464 adjoint ideal is obtained by intersecting all ideals obtained locally. 463 cusps, in turn, are adressed by a straightforward direct algorithm. The 464 adjoint ideal is obtained by intersecting all ideals obtained locally. 465 465 The local variant of the algorithm is used by default. @* 466 466 KEYWORDS: integral basis; normalization. 467 467 EXAMPLE: example adjointIdeal; shows an example 468 468 " 469 { 469 { 470 470 list choices = #; 471 471 if(size(#)==0) … … 491 491 choices = list(2, choices[1]); 492 492 } 493 } 494 } 493 } 494 } 495 495 if(size(#) == 2) 496 { 496 { 497 497 if(not(find(choices[2],"firstchecksdone"))) 498 498 { 499 499 checkAssumptions(f); 500 } 500 } 501 501 } 502 502 ideal JAC = diff(maxideal(1),ideal(f)); … … 507 507 { 508 508 bb1 = 1; 509 int a,b,c = findCoordChange(f,JAC); 510 f = subst(f,var(3),var(3)-a/c*var(1)-b/c*var(2)); 509 int a,b,c = findCoordChange(f,JAC); 510 f = subst(f,var(3),var(3)-a/c*var(1)-b/c*var(2)); 511 511 } 512 512 /*applying a change of coordinates if the point (0:1:0) lies on the curve*/ … … 514 514 int bb2 = ((size(co)-1) != deg(f)); 515 515 if(bb2) 516 { 516 { 517 517 co = coeffs(f,var(1)); 518 518 int bb2x = ((size(co)-1) == deg(f)); 519 if(bb2x) 519 if(bb2x) 520 520 { 521 521 map perm = basering, var(2), var(1), var(3); … … 524 524 else 525 525 { 526 f = subst(f,var(1),var(1)+var(2)); 527 } 526 f = subst(f,var(1),var(1)+var(2)); 527 } 528 528 } 529 529 co = coeffs(f,var(2)); … … 534 534 if(bb2) 535 535 { 536 if(bb2x) 536 if(bb2x) 537 537 { 538 538 map perm = basering, var(2), var(1), var(3); … … 541 541 else 542 542 { 543 AI = mstd(substitute(AI,var(1),var(1)-var(2)))[2]; 544 } 545 543 AI = mstd(substitute(AI,var(1),var(1)-var(2)))[2]; 544 } 545 546 546 } 547 547 if(bb1==1) … … 567 567 2: make local analysis of singularities first and apply normalization 568 568 separately. @* 569 The default is 2. @* 569 The default is 2. @* 570 570 string may contain substring: @* 571 571 - rattestyes -> causes error message if curve is not rational. @* … … 576 576 as a polynomial in the second variable (that is, C does not contain 577 577 the point (0:1:0)).@* 578 The curve C is not allowed to have singularities 578 The curve C is not allowed to have singularities 579 579 at infinity (z = 0). @* 580 580 RETURN: ideal, the adjoint ideal of the curve defined by f. 581 581 " 582 { 583 def Roriginal = basering; 582 { 583 def Roriginal = basering; 584 584 list rl = ringlist(Roriginal); 585 585 rl[3] = list(list("dp",1:nvars(Roriginal)),list("C",0)); 586 def RP2 = ring(rl); 586 def RP2 = ring(rl); 587 587 setring RP2; 588 588 poly f = imap(Roriginal,f); … … 648 648 A(OMP[k][1]) = intersect(A(OMP[k][1]), OMP[k][2]); 649 649 } 650 int i = ub; 650 int i = ub; 651 651 setring RP2; 652 652 B = maxideal(n-i); … … 655 655 setring Rdummy; 656 656 B = imap(RP2,B); 657 ideal A; 657 ideal A; 658 658 while(i>=lb) 659 { 659 { 660 660 A = A(i)**(i-1); 661 661 B = intersect(B,A); … … 685 685 } 686 686 } 687 list PD = primdecGTZ(SL); // could be made faster -- see minAssGTZ 687 list PD = primdecGTZ(SL); // could be made faster -- see minAssGTZ 688 688 // in deltaLocMod -- only one PD needed 689 689 int pd = size(PD); 690 690 setring RP2; 691 691 B = imap(Rdummy,B); 692 list PD = imap(Rdummy,PD); 692 list PD = imap(Rdummy,PD); 693 693 ideal AI = 1; 694 694 for(k=1;k<=pd;k++) 695 { 695 { 696 696 AI = intersect(AI,adjointIdealIB(f,insert(choices,PD[k][1], 697 697 size(choices)))); … … 707 707 /////////////////////////////////////////////////////////////////////////////// 708 708 static proc adjointIdealIB(poly f, list choices) 709 "USAGE: adjointIdealIB(f, choices); f polynomial in three variables, choices 709 "USAGE: adjointIdealIB(f, choices); f polynomial in three variables, choices 710 710 list consisting of one integer followed by one string followed by one 711 711 ideal. @* … … 719 719 with coefficients in Q. @* 720 720 The polynomial f must be homogeneous and absolutely irreducible.@* 721 Its dehomogenization with respect to the third variable must be monic 722 as a polynomial in the second variable (that is, C does not contain 721 Its dehomogenization with respect to the third variable must be monic 722 as a polynomial in the second variable (that is, C does not contain 723 723 the point (0:1:0)).@* 724 The curve C is not allowed to have singularities 724 The curve C is not allowed to have singularities 725 725 at infinity (z = 0). @* 726 726 RETURN: ideal containing the adjoint ideal of the curve defined by f. @* 727 727 " 728 { 728 { 729 729 poly dhf = subst(f,var(3),1); 730 730 def Roriginal = basering; … … 743 743 def Rred = ring(rl); // make var(2) > var(1) 744 744 rl = ringlist(Rdummy); 745 rl[1] = list(0,list(var(1)),list(list("dp",1)),ideal(0)); 745 rl[1] = list(0,list(var(1)),list(list("dp",1)),ideal(0)); 746 746 rl[2] = list(var(2)); 747 747 rl[3] = list(list("dp",1),list("C",0)); … … 751 751 { 752 752 LIntB = integralBasis(f, 2, list(list("inputC", DATA[3]),"isIrred")); 753 } 753 } 754 754 else // use van Hoeij's algorithm 755 { 755 { 756 756 LIntB = integralBasisVH(f,DATA[3],2); // van Hoeij in future version 757 757 } … … 760 760 setring Roriginal; 761 761 int gg = geomGenusIB(f,imap(Rdummy, LIntB)); 762 if(gg!=0){ERROR("not a rational curve");} 762 if(gg!=0){ERROR("not a rational curve");} 763 763 setring Rdummy; 764 764 } … … 776 776 poly d = imap(Rdummy,d); 777 777 M=1/d*M; 778 list LUM = ludecomp(M); 779 list LS; 778 list LUM = ludecomp(M); 779 list LS; 780 780 matrix dummyvector[sL][1]; 781 781 matrix Gij[sL][sL]; … … 788 788 { 789 789 for(j = i; j <= sL; j++) 790 { 790 { 791 791 setring Rred; 792 Gij = 0; 793 eiej = IB[i]*IB[j]; 792 Gij = 0; 793 eiej = IB[i]*IB[j]; 794 794 Iij=empty; 795 795 for(k = 1; k <= sL; k++) 796 796 { 797 797 Iij[k] = reduce(eiej*IB[k],fred); 798 } 799 Gij = coeffs(ideal(Iij[1..sL]),var(1)); 798 } 799 Gij = coeffs(ideal(Iij[1..sL]),var(1)); 800 800 setring QF; 801 Gij = imap (Rred, Gij); 802 for(k = 1; k <= sL; k++) 801 Gij = imap (Rred, Gij); 802 for(k = 1; k <= sL; k++) 803 803 { 804 804 dummyvector = Gij[1..sL,k]; 805 LS = lusolve(LUM[1], LUM[2], LUM[3], dummyvector); 805 LS = lusolve(LUM[1], LUM[2], LUM[3], dummyvector); 806 806 Tr[i,j] = Tr[i,j] + 1/d^3*LS[2][k,1]; 807 } 807 } 808 808 } 809 809 } … … 811 811 { 812 812 for(j = 1; j < i; j++) 813 { 813 { 814 814 Tr[i,j] = Tr[j,i]; 815 } 816 } 817 LUM = ludecomp(Tr); 815 } 816 } 817 LUM = ludecomp(Tr); 818 818 setring Rred; 819 819 poly d2f = imap(Rdummy,d2f); … … 840 840 EXAMPLE: example mapToRatNormCurve; shows an example 841 841 " 842 { 842 { 843 843 int n = size(AI); 844 844 int k; … … 846 846 def Roriginal = basering; 847 847 ideal IC = f; 848 list rl = ringlist(Roriginal); 848 list rl = ringlist(Roriginal); 849 849 /* begin workaround elimination*/ 850 850 for(k = 1; k <= 3; k++) 851 851 { 852 rl[2][k] = "x("+string(k)+")"; 853 } 852 rl[2][k] = "x("+string(k)+")"; 853 } 854 854 for(k = 1; k <= n; k++) 855 855 { 856 rl[2][k+3] = "y("+string(k)+")"; 857 } 856 rl[2][k+3] = "y("+string(k)+")"; 857 } 858 858 rl[3]= list(list("dp",1:(3+n)),list("C",0)); 859 859 def Relim = ring(rl); … … 861 861 ideal IC = fetch(Roriginal,IC); 862 862 ideal AI = fetch(Roriginal,AI); 863 ideal J; 863 ideal J; 864 864 J = IC; 865 865 for(k=1;k<=n;k++) … … 899 899 /////////////////////////////////////////////////////////////////////////////// 900 900 proc rncAntiCanonicalMap(ideal I) 901 "USAGE: rncAntiCanonicalMap(I); I ideal 901 "USAGE: rncAntiCanonicalMap(I); I ideal 902 902 ASSUME: I is a homogeneous ideal in the basering 903 903 defining a rational normal curve C in PP^n. 904 NOTE: The procedure will fail or give a wrong output if I is not the 904 NOTE: The procedure will fail or give a wrong output if I is not the 905 905 ideal of a rational normal curve. 906 906 RETURN: ideal defining the anticanonical map C --> PP^(n-2). @* 907 Note that the entries of the ideal should be considered as 907 Note that the entries of the ideal should be considered as 908 908 representatives of elements in R/I, where R is the basering. 909 THEORY: The anti-canonical map of a rational normal curve 909 THEORY: The anti-canonical map of a rational normal curve 910 910 maps C isomorpically to a rational normal curve in PP^(n-2). 911 911 KEYWORDS: rational normal curve, projection. 912 912 EXAMPLE: example rncAntiCanonicalMap; shows an example 913 913 " 914 { 914 { 915 915 def Roriginal = basering; 916 916 list rl = ringlist(Roriginal); 917 917 rl[3] = list(list("dp",1:nvars(Roriginal)),list("C",0)); 918 def RoriginalDP = ring(rl); 918 def RoriginalDP = ring(rl); 919 919 setring RoriginalDP; 920 920 ideal I = imap(Roriginal,I); … … 943 943 /////////////////////////////////////////////////////////////////////////////// 944 944 proc rncItProjOdd(ideal I) 945 "USAGE: rncItProjOdd(I); I ideal 945 "USAGE: rncItProjOdd(I); I ideal 946 946 ASSUME: I is a homogeneous ideal in the basering 947 947 with n+1 variables defining a rational normal curve C in PP^n with n … … 950 950 ideal of a rational normal curve. It will test whether n is odd. 951 951 RETURN: ideal PHI defining an isomorphic projection of C to PP^1.@* 952 Note that the entries of PHI should be considered as 952 Note that the entries of PHI should be considered as 953 953 representatives of elements in R/I, where R is the basering. 954 954 THEORY: We iterate the procedure @ref rncAntiCanonicalMap to obtain PHI. … … 957 957 EXAMPLE: example rncItProjOdd; shows an example 958 958 " 959 { 959 { 960 960 int n = nvars(basering); 961 961 if((n mod 2) == 1){ERROR("Pn has even dimension");} 962 def Roriginal = basering; 962 def Roriginal = basering; 963 963 list rlo = ringlist(Roriginal); 964 964 rlo[3]= list(list("dp",1:n),list("C",0)); … … 966 966 for(k = 1; k <= n; k++) 967 967 { 968 rlo[2][k] = "z("+string(k)+")"; 969 } 968 rlo[2][k] = "z("+string(k)+")"; 969 } 970 970 def RoriginalCopy = ring(rlo); 971 971 for(k = 1; k <= n; k++) 972 972 { 973 rlo[2][k] = "y("+string(k)+")"; 974 } 973 rlo[2][k] = "y("+string(k)+")"; 974 } 975 975 def Rold = ring(rlo); 976 976 setring RoriginalCopy; … … 984 984 intvec HJJ; 985 985 while(n>2) 986 { 986 { 987 987 ideal PR = rncAntiCanonicalMap(J); 988 988 list rl = ringlist(Rold); … … 993 993 for(k = 1; k <= n; k++) 994 994 { 995 dummy = subst(dummy,var(k),PHI[k]); 996 } 995 dummy = subst(dummy,var(k),PHI[k]); 996 } 997 997 setring RoriginalCopy; 998 998 PHI = imap(Rbig,dummy); … … 1001 1001 for(k = 1; k <= n; k++) 1002 1002 { 1003 rl[2][k] = "x("+string(k)+")"; 1004 } 1003 rl[2][k] = "x("+string(k)+")"; 1004 } 1005 1005 for(k = 1; k <= n-2; k++) 1006 1006 { 1007 rl[2][k+n] = "y("+string(k)+")"; 1008 } 1007 rl[2][k+n] = "y("+string(k)+")"; 1008 } 1009 1009 rl[3]= list(list("dp",1:(2*n-2)),list("C",0)); 1010 1010 Relim = ring(rl); … … 1016 1016 for(k = 1; k <= n; k++) 1017 1017 { 1018 pvar = pvar*var(k); 1019 } 1018 pvar = pvar*var(k); 1019 } 1020 1020 for(k=1;k<=n-2;k++) 1021 1021 { … … 1058 1058 /////////////////////////////////////////////////////////////////////////////// 1059 1059 proc rncItProjEven(ideal I) 1060 "USAGE: rncItProjEven(I); I ideal 1060 "USAGE: rncItProjEven(I); I ideal 1061 1061 ASSUME: I is a homogeneous ideal in the basering 1062 1062 with n+1 variables defining a rational normal curve C in PP^n with n 1063 1063 even. 1064 NOTE: The procedure will fail or give a wrong output if I is not the 1064 NOTE: The procedure will fail or give a wrong output if I is not the 1065 1065 ideal of a rational normal curve. It will test whether n is odd. 1066 1066 RETURN: ring with an ideal CONIC defining a conic C2 in PP^2. In addition, 1067 1067 an ideal PHI in the basering defining an isomorphic projection 1068 1068 of C to C2 will be exported.@* 1069 Note that the entries of PHI should be considered as 1069 Note that the entries of PHI should be considered as 1070 1070 representatives of elements in R/I, where R is the basering. 1071 1071 THEORY: We iterate the procedure @ref rncAntiCanonicalMap to obtain PHI. … … 1074 1074 EXAMPLE: example rncItProjEven; shows an example 1075 1075 " 1076 { 1076 { 1077 1077 int n = nvars(basering); 1078 1078 if((n mod 2) == 0){ERROR("Pn has odd dimension");} 1079 def Roriginal = basering; 1079 def Roriginal = basering; 1080 1080 list rlo = ringlist(Roriginal); 1081 1081 rlo[3]= list(list("dp",1:n),list("C",0)); … … 1083 1083 for(k = 1; k <= n; k++) 1084 1084 { 1085 rlo[2][k] = "z("+string(k)+")"; 1086 } 1085 rlo[2][k] = "z("+string(k)+")"; 1086 } 1087 1087 def RoriginalCopy = ring(rlo); 1088 1088 for(k = 1; k <= n; k++) 1089 1089 { 1090 rlo[2][k] = "y("+string(k)+")"; 1091 } 1090 rlo[2][k] = "y("+string(k)+")"; 1091 } 1092 1092 def Rold = ring(rlo); 1093 1093 setring RoriginalCopy; … … 1101 1101 intvec HJJ; 1102 1102 while(n>3) 1103 { 1103 { 1104 1104 ideal PR = rncAntiCanonicalMap(J); 1105 1105 list rl = ringlist(Rold); … … 1110 1110 for(k = 1; k <= n; k++) 1111 1111 { 1112 dummy = subst(dummy,var(k),PHI[k]); 1113 } 1112 dummy = subst(dummy,var(k),PHI[k]); 1113 } 1114 1114 setring RoriginalCopy; 1115 1115 PHI = imap(Rbig,dummy); … … 1118 1118 for(k = 1; k <= n; k++) 1119 1119 { 1120 rl[2][k] = "x("+string(k)+")"; 1121 } 1120 rl[2][k] = "x("+string(k)+")"; 1121 } 1122 1122 for(k = 1; k <= n-2; k++) 1123 1123 { 1124 rl[2][k+n] = "y("+string(k)+")"; 1125 } 1124 rl[2][k+n] = "y("+string(k)+")"; 1125 } 1126 1126 rl[3]= list(list("dp",1:(2*n-2)),list("C",0)); 1127 1127 Relim = ring(rl); … … 1133 1133 for(k = 1; k <= n; k++) 1134 1134 { 1135 pvar = pvar*var(k); 1136 } 1135 pvar = pvar*var(k); 1136 } 1137 1137 for(k=1;k<=n-2;k++) 1138 1138 { … … 1152 1152 Rold = Rnew; 1153 1153 setring Rold; 1154 n = n-2; 1154 n = n-2; 1155 1155 } 1156 1156 poly CONIC = J[1]; … … 1183 1183 with coefficients in Q. @* 1184 1184 The polynomial f must be homogeneous and absolutely irreducible.@* 1185 Its dehomogenization with respect to the third variable must be monic 1185 Its dehomogenization with respect to the third variable must be monic 1186 1186 as a polynomial in the second variable (that is, the curve C = {f = 0} 1187 1187 does not contain the point (0:1:0)).@* 1188 The curve C is not allowed to have singularities 1188 The curve C is not allowed to have singularities 1189 1189 at infinity (z = 0). @* 1190 1190 NOTE: The last two conditions can be met by a suitable change of coordinates in PGL(3) … … 1197 1197 SEE ALSO: genus. 1198 1198 " 1199 { 1199 { 1200 1200 int bb = size(#); 1201 1201 poly dhf = subst(f,var(3),1); … … 1210 1210 if(bb == 0) 1211 1211 { 1212 LIntB = integralBasis(f,2,"isIrred"); 1212 LIntB = integralBasis(f,2,"isIrred"); 1213 1213 } 1214 1214 else … … 1224 1224 for(k = 1; k <= sL; k++) 1225 1225 { 1226 gg = gg + deg(gcd(d,IB[k])); 1226 gg = gg + deg(gcd(d,IB[k])); 1227 1227 } 1228 1228 setring Roriginal; … … 1257 1257 SEE ALSO: genus 1258 1258 " 1259 { 1259 { 1260 1260 int w = printlevel-voice+2; // w=printlevel (default: w=0) 1261 1261 int d = deg(F); … … 1268 1268 int delt,deltaloc,deltainf,tau,tauinf,cusps,iloc,iglob,l,nsing, 1269 1269 tauloc,tausing,k,rat,nbranchinf,nbranch,nodes,cuspsinf,nodesinf; 1270 list inv; 1270 list inv; 1271 1271 execute("ring newR=("+charstr(R)+"),(x,y),dp;"); 1272 1272 //the singularities at the affine part … … 1274 1274 ideal I=sigma(F); 1275 1275 1276 list OMPButNodes; 1277 int sizeOMPButNodes; 1278 int NotOnlyOMPPlusCusps; 1276 list OMPButNodes; 1277 int sizeOMPButNodes; 1278 int NotOnlyOMPPlusCusps; 1279 1279 1280 1280 ideal I1=jacob(I); … … 1315 1315 1316 1316 ideal NodesPlusCusps = radical(sat(I+I1, radIDsing)[1]); 1317 1317 1318 1318 nsing=nsing+cusps; 1319 1319 … … 1348 1348 delt=delt+nodes+cusps; 1349 1349 if((w>=1)&&(inv[2]==0)){"smooth at (0,0,1)";} 1350 if(inv[4]!=0) 1350 if(inv[4]!=0) 1351 1351 { 1352 1352 OMPButNodes = insert(OMPButNodes,list(inv[4],maxideal(1)), … … 1356 1356 else 1357 1357 { 1358 NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 1358 NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 1359 1359 } 1360 1360 } … … 1372 1372 tausing=tausing+inv[2]; 1373 1373 nbranch=nbranch+inv[3]; 1374 if(inv[4]!=0) 1374 if(inv[4]!=0) 1375 1375 { 1376 1376 OMPButNodes = insert(OMPButNodes,list(inv[4],pr[k]), 1377 1377 sizeOMPButNodes); 1378 sizeOMPButNodes = size(OMPButNodes); 1378 sizeOMPButNodes = size(OMPButNodes); 1379 1379 } 1380 1380 else 1381 1381 { 1382 NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 1382 NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 1383 1383 } 1384 1384 } … … 1408 1408 } 1409 1409 setring R; 1410 if(sizeOMPButNodes>0) 1410 if(sizeOMPButNodes>0) 1411 1411 { 1412 list OMPButNodes = fetch(newR,OMPButNodes); 1412 list OMPButNodes = fetch(newR,OMPButNodes); 1413 1413 } 1414 1414 return(list(genus,NotOnlyOMPPlusCusps,OMPButNodes, … … 1529 1529 } 1530 1530 } 1531 int intMult = deg(lead(f)); 1532 poly fdummy = f; 1533 poly gdummy = lead(f); 1534 int ivr = 1; 1535 while(ivr) 1531 int intMult = deg(lead(f)); 1532 poly fdummy = f; 1533 poly gdummy = lead(f); 1534 int ivr = 1; 1535 while(ivr) 1536 1536 { 1537 1537 fdummy = fdummy - lead(fdummy); 1538 1538 if((fdummy ==0) || (deg(lead(fdummy))>intMult)){break;} 1539 gdummy = gdummy + lead(fdummy); 1539 gdummy = gdummy + lead(fdummy); 1540 1540 } 1541 ideal SQRpart = sqrfree(gdummy); 1541 ideal SQRpart = sqrfree(gdummy); 1542 1542 int IntForRet; ///neu 1543 if(deg(SQRpart[1])==intMult) 1543 if(deg(SQRpart[1])==intMult) 1544 1544 { 1545 IntForRet = intMult; 1545 IntForRet = intMult; 1546 1546 } 1547 1547 option(noredSB); … … 1664 1664 proc paraConic(poly q) 1665 1665 "USAGE: paraConic(q); q poly 1666 ASSUME: The basering must be a polynomial ring in three variables with 1666 ASSUME: The basering must be a polynomial ring in three variables with 1667 1667 coefficients in Q. @* 1668 1668 The polynomial q must be homogeneous of degree 2 and absolutely … … 1688 1688 EXAMPLE: example paraConic; shows an example 1689 1689 " 1690 { 1690 { 1691 1691 def Roriginal = basering; 1692 1692 def RP2 = projConic(q); // ring with ideal Ipoint … … 1699 1699 def RP1 = ring(rl); 1700 1700 setring RP1; 1701 ideal PARACONIC = fetch(rp1,psi); 1701 ideal PARACONIC = fetch(rp1,psi); 1702 1702 export(PARACONIC); 1703 1703 "// 'paraConic' created a ring together with an ideal RNC."; … … 1727 1727 static proc projConic(poly q) 1728 1728 "USAGE: projConic(q); q poly 1729 ASSUME: The basering must be a polynomial ring in three variables with 1729 ASSUME: The basering must be a polynomial ring in three variables with 1730 1730 coefficients in Q. @* 1731 1731 The polynomial q must be homogeneous of degree 2 and absolutely … … 1740 1740 SEE ALSO: rationalPointConic. 1741 1741 " 1742 { 1742 { 1743 1743 def Roriginal = basering; 1744 1744 list rl = ringlist(Roriginal); … … 1751 1751 // possibly defined over algebraic number 1752 1752 // field 1753 setring RP21; 1753 setring RP21; 1754 1754 list rl1 = ringlist(RP21); 1755 rl1[2] = list("u","v","w"); 1755 rl1[2] = list("u","v","w"); 1756 1756 rl1[3] = list(list("dp",1:3),list("C",0)); 1757 def RP2 = ring(rl1); 1757 def RP2 = ring(rl1); 1758 1758 setring RP2; 1759 1759 ideal point = fetch(RP21,point); … … 2189 2189 if ((b mod a) == 0) { l = a, 1, 0; if (a < 0) { l = -a, -1, 0; }; } 2190 2190 if (size(l) > 1) { return (l); } 2191 2191 2192 2192 temp = a mod b; 2193 2193 l = extendedEuclid(b, temp); … … 2535 2535 } 2536 2536 /////////////////////////////////////////////////////////////////////////////// 2537 proc testParametrization(poly f, def rTT) 2537 proc testParametrization(poly f, def rTT) 2538 2538 "USAGE: testParametrization(f,rTT); f poly, rTT ring 2539 ASSUME: The assumptions on the basering and the polynomial f are as required 2540 by @ref paraPlaneCurve. The ring rTT has two variables and contains 2539 ASSUME: The assumptions on the basering and the polynomial f are as required 2540 by @ref paraPlaneCurve. The ring rTT has two variables and contains 2541 2541 an ideal PARA (such as the ring obtained by applying 2542 @ref paraPlaneCurve to f). 2543 RETURN: int which is 1 if PARA defines a parametrization of the curve 2542 @ref paraPlaneCurve to f). 2543 RETURN: int which is 1 if PARA defines a parametrization of the curve 2544 2544 {f=0} and 0, otherwise. 2545 2545 THEORY: We compute the image of PARA and compare it with f. … … 2558 2558 setring Relim; 2559 2559 ideal PARA = fetch(rTT,PARA); 2560 ideal JJ; 2560 ideal JJ; 2561 2561 for(k=1;k<=3;k++) 2562 2562 { … … 2578 2578 g = reduce(ftest[1],std(ideal(f))); 2579 2579 if(g!=0){return(0)}; 2580 return (1); 2580 return (1); 2581 2581 } 2582 2582 … … 2735 2735 adjointIdeal(f,2); 2736 2736 def RP1 = paraPlaneCurve(f); // time 0 2737 testParametrization(f,RP1); 2737 testParametrization(f,RP1); 2738 2738 setring RP1; PARA; 2739 2739 kill RR;kill RP1; … … 2797 2797 // ------------------------------------------------------- 2798 2798 ring SS = 0, (u,v,z), dp; 2799 poly f = 2799 poly f = 2800 2800 2*u^7+u^6*v+3*u^5*v^2+u^4*v^3+2*u^3*v^4+u^2*v^5+2*u*v^6+v^7 2801 2801 -7780247/995328*u^6*z-78641/9216*u^5*v*z-10892131/995328*u^4*v^2*z … … 2836 2836 adjointIdeal(f,2); 2837 2837 def RP1 = paraPlaneCurve(f); // time 72 2838 testParametrization(f,RP1); 2838 testParametrization(f,RP1); 2839 2839 setring RP1; PARA; 2840 2840 kill SS;kill RP1;
Note: See TracChangeset
for help on using the changeset viewer.