Changeset 57fbc7 in git
- Timestamp:
- Apr 18, 2020, 1:47:15 AM (4 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- e645dbb37f4b69d6e6c541745eaba9b6e9450b23
- Parents:
- e76b60978f54fdb548ace9a18c2b26e3124c9b5f
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/dmodapp.lib
re76b609 r57fbc7 140 140 - changed charVariety: no homogenization is needed 141 141 - changed inForm: code is much simpler using jet 142 143 06.04.20 by VL: 144 - engine updated with 2 more modular choices 142 145 143 146 */ … … 153 156 LIB "qhmoduli.lib"; // for Max 154 157 LIB "sing.lib"; // for slocus 158 LIB "ncModslimgb.lib"; // for modular noncomm GB 155 159 156 160 … … 263 267 264 268 proc engine(def I, int i) 269 "USAGE: engine(I,i); I ideal/module/matrix, i an int 270 RETURN: the same type as I 271 PURPOSE: compute the Groebner basis of I with the algorithm, chosen via i 272 NOTE: By default and if i=0, slimgb is used; 273 if i=1, std does the job; 274 if i=2, modular slimgb is run without final exactness check; 275 if i=3, modular slimgb is run with final exactness check. 276 EXAMPLE: example engine; shows examples 277 " 278 { 279 /* std - slimgb mix */ 280 def J; 281 // ideal J; 282 if ((i<=0) || (i>=4)) 283 { 284 i = 0; 285 J = slimgb(I); 286 } 287 if (i==1) 288 { 289 // without options -> strange! (ringlist?) 290 intvec v = option(get); 291 option(redSB); 292 option(redTail); 293 J = std(I); 294 option(set, v); 295 } 296 if (i==2) 297 { 298 // modular slimgb without final exactness check 299 J = ncmodslimgb(I,0); 300 } 301 if (i==3) 302 { 303 // modular slimgb with final exactness check 304 J = ncmodslimgb(I,1); 305 } 306 return(J); 307 } 308 example 309 { 310 "EXAMPLE:"; echo = 2; 311 ring r = 0,(x,y),Dp; 312 ideal I = y*(x3-y2),x*(x3-y2); 313 engine(I,0); // uses slimgb 314 engine(I,1); // uses std 315 engine(I,2); // uses modular slimgb without exactness check 316 engine(I,3); // uses modular slimgb with exactness check 317 } 318 319 /* 320 proc engine(def I, int i) 265 321 "USAGE: engine(I,i); I ideal/module/matrix, i an int 266 322 RETURN: the same type as I … … 295 351 engine(I,0); // uses slimgb 296 352 engine(I,1); // uses std 297 } 353 } 354 */ 298 355 299 356 proc poly2list (poly f) -
Singular/LIB/freegb.lib
re76b609 r57fbc7 457 457 "EXAMPLE:"; echo = 2; 458 458 ring r = 0,(x,y),dp; 459 def R = freeAlgebra(r, 4); // R with letterplace structure 460 setring R; 459 ring R = freeAlgebra(r, 4); 461 460 poly a = x*y; poly b = y; 462 461 lieBracket(a,b); … … 490 489 "EXAMPLE:"; echo = 2; 491 490 ring r = (0,a,b,g),(x,y),Dp; 492 def R = freeAlgebra(r, 4); // constructs a Letterplace ring 493 setring R; // downup algebra A 491 ring R = freeAlgebra(r, 4); // downup algebra A 494 492 ideal J = x*x*y-a*x*y*x - b*y*x*x - g*x, 495 493 x*y*y-a*y*x*y - b*y*y*x - g*y; … … 981 979 "EXAMPLE:"; echo = 2; 982 980 ring r = 0,(x,y,z),dp; 983 defR = freeAlgebra(r, 7);981 ring R = freeAlgebra(r, 7); 984 982 lpVarBlockSize(R); 985 983 } … … 1003 1001 ring r = 0,(x,y,z),dp; 1004 1002 isFreeAlgebra(r); 1005 defR = freeAlgebra(r, 7);1003 ring R = freeAlgebra(r, 7); 1006 1004 isFreeAlgebra(R); 1007 1005 } … … 1020 1018 "EXAMPLE:"; echo = 2; 1021 1019 ring r = 0,(x,y,z),dp; 1022 def R = freeAlgebra(r, 7, 10);1023 lpNcgenCount(R); // should be 101020 ring R = freeAlgebra(r, 7, 3); 1021 lpNcgenCount(R); // should be 3 1024 1022 } 1025 1023 … … 2850 2848 "EXAMPLE:"; echo = 2; 2851 2849 ring r = 0,(x,y,z),dp; 2852 int d =5; // degree 2853 def R = freeAlgebra(r, d); 2854 setring R; 2850 int d = 5; // degree 2851 ring R = freeAlgebra(r, d); 2855 2852 ideal I = y*x*y - z*y*z, x*y*x - z*x*y, z*x*z - y*z*x, x*x*x + y*y*y + z*z*z + x*y*z; 2856 2853 ideal J = letplaceGBasis(I); // compute a Letterplace Groebner basis … … 2868 2865 RETURN: list L 2869 2866 NOTE: - L[1] is NF(p,I) 2870 - L[2] is the list of expressions [i,l_(ij),r_(ij)] with \sum_(i,j) l_(ij) g_i r_(ij) = p - NF(p,I) 2867 - L[2] is the list of expressions [i,l_(ij),r_(ij)] with \sum_(i,j) l_(ij) g_i r_(ij) = p - NF(p,I) 2871 2868 - procedure lpGBPres2Poly, applied to L, reconstructs p 2872 2869 EXAMPLE: example lpDivision; shows examples … … 2940 2937 "EXAMPLE:"; echo = 2; 2941 2938 ring r = 0,(x,y),dp; 2942 def R = freeAlgebra(r, 4); setring R;2939 ring R = freeAlgebra(r, 4); 2943 2940 ideal I = x*x + y*y - 1; // 2D sphere 2944 ideal J = letplaceGBasis(I); // compute a LetterplaceGroebner basis2941 ideal J = twostd(I); // compute a two-sided Groebner basis 2945 2942 J; // it is finite and nice 2946 2943 poly h = x*x*y-y*x*x+x*y; 2947 l pDivision(h,J); // what means that the NF of h wrt J is x*y2944 list L = lpDivision(h,J); L; // what means that the NF of h wrt J is x*y 2948 2945 h - lpNF(h,J); // and this poly has the folowing two-sided Groebner presentation: 2949 2946 -y*J[1] + J[1]*y; 2947 lpGBPres2Poly(L,J); // reconstructs the above automatically 2950 2948 } 2951 2949 … … 2969 2967 "EXAMPLE:"; echo = 2; 2970 2968 ring r = 0,(x,y),dp; 2971 def R = freeAlgebra(r, 4); setring R;2969 ring R = freeAlgebra(r, 4); 2972 2970 ideal I = x*x + y*y - 1; // 2D sphere 2973 ideal J = letplaceGBasis(I); // compute a LetterplaceGroebner basis2971 ideal J = twostd(I); // compute a two-sided Groebner basis 2974 2972 J; // it is finite and nice 2975 2973 poly h = x*x*y-y*x*x+x*y; 2976 list L = lpDivision(h,J); // what means that the NF of h wrt J is x*y 2974 list L = lpDivision(h,J); 2975 L[1]; // what means that the normal form (or the remainder) of h wrt J is x*y 2977 2976 lpGBPres2Poly(L,J); // we see, that it is equal to h from above 2978 2977 } 2979 2980 2981 2978 2982 2979 … … 3782 3779 poly q = y*y*x*x; 3783 3780 poly w = z*y*x*z; 3784 // p, q,w are some polynomials we want to transform into their3781 // p, q, w are some polynomials we want to transform into their 3785 3782 // intvec representation 3786 3783 ideal G = p,q,w; … … 3788 3785 } 3789 3786 3790 proc testLift(ideal M, matrix T) { 3787 proc testLift(ideal M, matrix T) 3788 "USAGE: testLift(M,T); module M, matrix T 3789 RETURN: module 3790 PURPOSE: assembles the result of the lift procedure 3791 ASSUME: T is the lift matrix of a submodule of M 3792 NOTE: the inverse of the lift procedure 3793 EXAMPLE: example testLift; shows examples 3794 " 3795 { 3791 3796 ideal R; 3792 3797 if (ncols(M) != nrows(T)) { ERROR("cols(M) != rows(T)") } … … 3799 3804 return(R); 3800 3805 } 3801 3802 proc testSyz(ideal M, module S) { 3806 example 3807 { 3808 "EXAMPLE:"; echo = 2; 3809 LIB "freegb.lib"; 3810 ring r = 0,(x,y),(c,Dp); 3811 ring R = freeAlgebra(r, 7, 2); 3812 ideal I = std(x*y*x + 1); 3813 print(matrix(I)); // finite two-sided Groebner basis 3814 ideal SI = x*I[1]*y + y*x*I[2], I[1]*y*x + I[2]*y; 3815 matrix T = lift(I, SI); // T is the lifting matrix of SI wrt I 3816 print(T); // 3817 print(matrix(SI)); // the original generators of SI as a matrix 3818 print(matrix(testLift(I,T))); // and the result of testLift 3819 } 3820 3821 proc testSyz(ideal M, module S) 3822 "USAGE: testSyz(M,S); module M, S 3823 RETURN: module 3824 PURPOSE: tests the result of the syz procedure 3825 ASSUME: S is the syzygy bimodule of M 3826 EXAMPLE: example testSyz; shows examples 3827 " 3828 { 3803 3829 ideal R; 3804 3830 if (ncols(M) != nrows(S)) { ERROR("cols(M) != rows(T)") } … … 3811 3837 return(R); 3812 3838 } 3839 example 3840 { 3841 "EXAMPLE:"; echo = 2; 3842 LIB "freegb.lib"; 3843 ring r = 0,(x,y),(c,Dp); 3844 ring R = freeAlgebra(r, 7, 2); 3845 ideal I = twostd(x*y*x + 1); 3846 print(matrix(I)); 3847 module S = syz(I); 3848 print(S); 3849 testSyz(I,S); // returns zero 3850 } 3813 3851 3814 3852 static proc mod_init()
Note: See TracChangeset
for help on using the changeset viewer.