Changeset 640e4c in git
- Timestamp:
- Apr 8, 2011, 5:40:29 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 6dce0a2f79407a50343791008290059180184804
- Parents:
- 0b301eb684d2361d4bbb42f05cd0cca8ee0ea520
- Files:
-
- 9 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ncfactor.lib
r0b301e r640e4c 20 20 21 21 PROCEDURES: 22 facFirstWeyl(h); factorization in the first Weyl algebra 23 testNCfac(l[,h]); tests factorizations from a given list for correctness 24 facSubWeyl(h,X,D); factorization in the first Weyl algebra as a subalgebra 25 facFirstShift(h); factorization in the first shift algebra 22 facFirstWeyl(h); factorization in the first Weyl algebra 23 testNCfac(l[,h[,1]]); tests factorizations from a given list for correctness 24 facSubWeyl(h,X,D); factorization in the first Weyl algebra as a subalgebra 25 facFirstShift(h); factorization in the first shift algebra 26 homogfacFirstQWeyl(h); [-1,1]-homogeneous factorization in the first Q-Weyl algebra 27 homogfacFirstQWeyl_all(h); [-1,1] homogeneous factorization(complete) in the first Q-Weyl algebra 26 28 "; 27 29 … … 30 32 LIB "involut.lib"; 31 33 LIB "freegb.lib"; // for isVar 34 35 proc tst_ncfactor() 36 { 37 example facFirstWeyl; 38 example facFirstShift; 39 example facSubWeyl; 40 example testNCfac; 41 example homogfacFirstQWeyl; 42 example homogfacFirstQWeyl_all; 43 } 32 44 33 45 ///////////////////////////////////////////////////// … … 945 957 PURPOSE: compute all factorizations of a polynomial in the first Weyl algebra 946 958 THEORY: Implements the new algorithm by A. Heinle and V. Levandovskyy, see the thesis of A. Heinle 947 ASSUME: basering i nthe first Weyl algebra959 ASSUME: basering is the first Weyl algebra 948 960 NOTE: Every entry of the output list is a list with factors for one possible factorization. 949 961 The first factor is always a constant (1, if no nontrivial constant could be excluded). … … 1059 1071 if(homogwithorder(h,ivm11)) 1060 1072 { 1061 dbprint(p,"==> Given polynomial is -1,1 homogeneous. Start inghomog. fac. and ret. its result");1073 dbprint(p,"==> Given polynomial is -1,1 homogeneous. Start homog. fac. and ret. its result"); 1062 1074 return(homogfacFirstWeyl_all(h)); 1063 1075 } … … 1097 1109 {//We have one factorization 1098 1110 result = result + list(M[i]); 1111 dbprint(p,"Result list updated:"); 1112 dbprint(p,result); 1099 1113 M = delete(M,i); 1100 1114 continue; … … 1209 1223 { 1210 1224 result = result + list(M[i]); 1225 dbprint(p,"Result list updated:"); 1226 dbprint(p,result); 1211 1227 M = delete(M,i); 1212 1228 continue; … … 1591 1607 PURPOSE: compute all factorizations of a polynomial in the first shift algebra 1592 1608 THEORY: Implements the new algorithm by A. Heinle and V. Levandovskyy, see the thesis of A. Heinle 1593 ASSUME: basering i nthe first shift algebra1609 ASSUME: basering is the first shift algebra 1594 1610 NOTE: Every entry of the output list is a list with factors for one possible factorization. 1595 1611 EXAMPLE: example facFirstShift; shows examples … … 1751 1767 {//We have one factorization 1752 1768 result = result + list(M[i]); 1769 dbprint(p,"Result list updated:"); 1770 dbprint(p,result); 1753 1771 M = delete(M,i); 1754 1772 continue; … … 1870 1888 { 1871 1889 result = result + list(M[i]); 1890 dbprint(p,"Result list updated:"); 1891 dbprint(p,result); 1872 1892 M = delete(M,i); 1873 1893 continue; … … 1890 1910 result = list(list(1,h)); 1891 1911 }//only the trivial factorization could be found 1912 dbprint(p,"==> done"); 1892 1913 return(result); 1893 1914 }//proc facshift … … 1972 1993 //================================================== 1973 1994 //A function to get the i'th triangular number 1974 proc triangNum(int n)1995 static proc triangNum(int n) 1975 1996 { 1976 1977 1978 1979 1980 1997 if (n == 0) 1998 { 1999 return(0); 2000 } 2001 return (n*(n+1)/2); 1981 2002 } 1982 2003 … … 1995 2016 variable. If k is positive, the last k entries will be x. The other 1996 2017 entries will be irreducible polynomials of degree zero or 1 resp. -1. 1997 SEE ALSO: homogfacFirstWeyl 2018 SEE ALSO: homogfacFirstWeyl, homogfacFirstQWeyl_all 1998 2019 "{//proc homogfacFirstQWeyl 1999 2020 int p = printlevel-voice+2;//for dbprint … … 2047 2068 dbprint(p,"==> Done"); 2048 2069 dbprint(p,"==> Mapping this monomials to K(q)[theta]"); 2049 def characteristic = ringlist(r)[1][1]; 2050 def qparameter = ringlist(r)[1][2][1]; 2051 ring tempRing = (characteristic,q),(x,y,theta),dp; //TODO: How to map a parameter? 2070 //Now, map to the commutative ring with theta: 2071 list tempRingList = ringlist(r); 2072 tempRingList[2] = insert(tempRingList[2],"theta",2); //New variable theta = x*d 2073 tempRingList = delete(tempRingList,5); 2074 tempRingList = delete(tempRingList,5); //The ring should now be commutative 2075 def tempRing = ring(tempRingList); 2052 2076 setring tempRing; 2053 map thetamap = r, x,y;2077 map thetamap = r,var(1),var(2); 2054 2078 list mons = thetamap(mons); 2055 2079 poly entry; … … 2057 2081 for (i = 1; i<=size(mons);i++) 2058 2082 {//transforming the monomials as monomials in theta 2059 entry = 1;//leadcoef(mons[i]) * q^(-triangNum(leadexp(mons[i])[2]-1));2083 entry = 1;//leadcoef(mons[i]) * q^(-triangNum(leadexp(mons[i])[2]-1)); 2060 2084 for (j = 0; j<leadexp(mons[i])[2];j++) 2061 2085 { 2062 //"j:";j;2063 tempSummand = (q^j-1)/(q-1);2064 entry = entry * theta-tempSummand*entry;2065 }2066 //~;2067 mons[i] = entry*leadcoef(mons[i]) * q^(-triangNum(leadexp(mons[i])[2]-1));2086 tempSummand = (par(1)^j-1)/(par(1)-1); 2087 entry = entry * theta-tempSummand*entry; 2088 } 2089 //entry; 2090 //leadcoef(mons[i]) * q^(-triangNum(leadexp(mons[i])[2]-1)); 2091 mons[i] = entry*leadcoef(mons[i]) * par(1)^(-triangNum(leadexp(mons[i])[2]-1)); 2068 2092 }//transforming the monomials as monomials in theta 2069 2093 dbprint(p,"==> Done"); … … 2102 2126 //Correction of the result in the special q-Case: 2103 2127 for (j = 2 ; j<= size(result);j++) 2104 {//Div idethe whole Term by the leading coefficient and multiply it to the first entry in result[i]2105 2106 2107 }//Div idethe whole Term by the leading coefficient and multiply it to the first entry in result[i]2128 {//Div the whole Term by the leading coefficient and multiply it to the first entry in result[i] 2129 result[1] = result[1] * leadcoef(result[j]); 2130 result[j] = 1/leadcoef(result[j]) * result[j]; 2131 }//Div the whole Term by the leading coefficient and multiply it to the first entry in result[i] 2108 2132 return(result); 2109 2133 }//proc homogfacFirstQWeyl 2134 example 2135 { 2136 "EXAMPLE:";echo=2; 2137 ring R = (0,q),(x,d),dp; 2138 def r = nc_algebra (q,1); 2139 setring(r); 2140 poly h = q^25*x^10*d^10+q^16*(q^4+q^3+q^2+q+1)^2*x^9*d^9+ 2141 q^9*(q^13+3*q^12+7*q^11+13*q^10+20*q^9+26*q^8+30*q^7+ 2142 31*q^6+26*q^5+20*q^4+13*q^3+7*q^2+3*q+1)*x^8*d^8+ 2143 q^4*(q^9+2*q^8+4*q^7+6*q^6+7*q^5+8*q^4+6*q^3+ 2144 4*q^2+2q+1)*(q^4+q^3+q^2+q+1)*(q^2+q+1)*x^7*d^7+ 2145 q*(q^2+q+1)*(q^5+2*q^4+2*q^3+3*q^2+2*q+1)*(q^4+q^3+q^2+q+1)*(q^2+1)*(q+1)*x^6*d^6+ 2146 (q^10+5*q^9+12*q^8+21*q^7+29*q^6+33*q^5+31*q^4+24*q^3+15*q^2+7*q+12)*x^5*d^5+ 2147 6*x^3*d^3+24; 2148 homogfacFirstQWeyl(h); 2149 } 2110 2150 2111 2151 … … 2114 2154 //Computes all possible homogeneous factorizations for an element in the first Q-Weyl Algebra 2115 2155 proc homogfacFirstQWeyl_all(poly h) 2116 "USAGE: homogfacFirst WWeyl_all(h); h is a homogeneous polynomial in the first q-Weyl algebra2156 "USAGE: homogfacFirstQWeyl_all(h); h is a homogeneous polynomial in the first q-Weyl algebra 2117 2157 with respect to the weight vector [-1,1] 2118 2158 RETURN: list … … 2125 2165 the first q-Weyl algebra, the permutations of this element with the other 2126 2166 entries will also be computed. 2127 SEE ALSO: homogfacFirst Weyl2167 SEE ALSO: homogfacFirstQWeyl 2128 2168 "{//proc HomogfacFirstQWeylAll 2129 2169 int p=printlevel-voice+2;//for dbprint … … 2182 2222 {//list_not_azero is not empty 2183 2223 list_not_azero = 2184 2224 one_hom_fac[(size(one_hom_fac)-absValue(deg(h,ivm11))+1)..size(one_hom_fac)]; 2185 2225 is_list_not_azero_empty = 0; 2186 2226 }//list_not_azero is not empty 2187 2227 //Map list_azero in K[theta] 2188 2228 dbprint(p,"==> Map list_azero to K[theta]"); 2189 def characteristic = ringlist(r)[1][1]; 2190 def qparameter = ringlist(r)[1][2][1]; 2191 ring tempRing = (characteristic,q),(x,y,theta),dp; //TODO: How to map a parameter? 2229 //Now, map to the commutative ring with theta: 2230 list tempRingList = ringlist(r); 2231 tempRingList[2] = insert(tempRingList[2],"theta",2); //New variable theta = x*d 2232 tempRingList = delete(tempRingList,5); 2233 tempRingList = delete(tempRingList,5); //The ring should now be commutative 2234 def tempRing = ring(tempRingList); 2192 2235 setring(tempRing); 2193 2236 poly entry; 2194 map thetamap = r, x,y;2237 map thetamap = r,var(1),var(2); 2195 2238 if(!is_list_not_azero_empty) 2196 2239 {//Mapping in Singular is only possible, if the list before … … 2217 2260 for (j = 1 ; j<=size(tempmons);j++) 2218 2261 { 2219 2220 entry = leadcoef(tempmons[j]) * q^(-triangNum(leadexp(tempmons[j])[2]-1));2262 //entry = leadcoef(tempmons[j]); 2263 entry = leadcoef(tempmons[j]) * par(1)^(-triangNum(leadexp(tempmons[j])[2]-1)); 2221 2264 for (k = 0; k < leadexp(tempmons[j])[2];k++) 2222 2265 { 2223 entry = entry*(theta-(q^k-1)/(q-1));2266 entry = entry*(theta-(par(1)^k-1)/(par(1)-1)); 2224 2267 } 2225 2268 tempmons[j] = entry; … … 2257 2300 else 2258 2301 { 2259 if (shift < 0) 2260 {//We have two distict formulas for x and y. In this case use formula for y 2261 if (shift == -1) 2262 { 2263 result[i][j] = subst(result[i][j],theta,1/q*(theta - 1)); 2264 } 2265 else 2266 { 2267 result[i][j] = subst(result[i][j],theta,1/q*((theta - 1)/q^(absValue(shift)-1) - (q^(shift +2)-q)/(1-q))); 2268 } 2269 }//We have two distict formulas for x and y. In this case use formula for y 2270 if (shift > 0) 2271 {//We have two distict formulas for x and y. In this case use formula for x 2272 if (shift == 1) 2273 { 2274 result[i][j] = subst(result[i][j],theta,q*theta + 1); 2275 } 2276 else 2277 { 2278 result[i][j] = subst(result[i][j],theta,q^shift*theta+(q^shift-1)/(q-1)); 2279 } 2280 }//We have two distict formulas for x and y. In this case use formula for x 2302 if (shift < 0) 2303 {//We have two distict formulas for x and y. In this case use formula for y 2304 if (shift == -1) 2305 { 2306 result[i][j] = subst(result[i][j],theta,1/par(1)*(theta - 1)); 2307 } 2308 else 2309 { 2310 result[i][j] = 2311 subst(result[i][j], 2312 theta, 2313 1/par(1)*((theta - 1)/par(1)^(absValue(shift)-1) 2314 - (par(1)^(shift +2)-par(1))/(1-par(1)))); 2315 } 2316 }//We have two distict formulas for x and y. In this case use formula for y 2317 if (shift > 0) 2318 {//We have two distict formulas for x and y. In this case use formula for x 2319 if (shift == 1) 2320 { 2321 result[i][j] = subst(result[i][j],theta,par(1)*theta + 1); 2322 } 2323 else 2324 { 2325 result[i][j] = 2326 subst(result[i][j], 2327 theta,par(1)^shift*theta+(par(1)^shift-1)/(par(1)-1)); 2328 } 2329 }//We have two distict formulas for x and y. In this case use formula for x 2281 2330 } 2282 2331 } … … 2316 2365 break; 2317 2366 }//the jth entry is theta and can be written as x*y 2318 if(result[i][j] == q*theta +1)2367 if(result[i][j] == par(1)*theta +1) 2319 2368 { 2320 2369 thetapos = j; … … 2359 2408 if (shift_sign<0) 2360 2409 { 2361 leftpart[j] = subst(leftpart[j-1],theta, 1/q*(theta +shift_sign));2410 leftpart[j] = subst(leftpart[j-1],theta, 1/par(1)*(theta +shift_sign)); 2362 2411 } 2363 2412 if (shift_sign>0) 2364 2413 { 2365 leftpart[j] = subst(leftpart[j-1],theta, q*theta + shift_sign);2414 leftpart[j] = subst(leftpart[j-1],theta, par(1)*theta + shift_sign); 2366 2415 } 2367 2416 leftpart[j-1] = shiftvar; … … 2392 2441 if (shift_sign<0) 2393 2442 { 2394 rightpart[j] = subst(rightpart[j+1], theta, q*theta - shift_sign);2443 rightpart[j] = subst(rightpart[j+1], theta, par(1)*theta - shift_sign); 2395 2444 } 2396 2445 if (shift_sign>0) 2397 2446 { 2398 rightpart[j] = subst(rightpart[j+1], theta, 1/q*(theta - shift_sign));2447 rightpart[j] = subst(rightpart[j+1], theta, 1/par(1)*(theta - shift_sign)); 2399 2448 } 2400 2449 rightpart[j+1] = shiftvar; … … 2431 2480 return(result); 2432 2481 }//proc HomogfacFirstQWeylAll 2482 example 2483 { 2484 "EXAMPLE:";echo=2; 2485 ring R = (0,q),(x,d),dp; 2486 def r = nc_algebra (q,1); 2487 setring(r); 2488 poly h = q^25*x^10*d^10+q^16*(q^4+q^3+q^2+q+1)^2*x^9*d^9+ 2489 q^9*(q^13+3*q^12+7*q^11+13*q^10+20*q^9+26*q^8+30*q^7+ 2490 31*q^6+26*q^5+20*q^4+13*q^3+7*q^2+3*q+1)*x^8*d^8+ 2491 q^4*(q^9+2*q^8+4*q^7+6*q^6+7*q^5+8*q^4+6*q^3+ 2492 4*q^2+2q+1)*(q^4+q^3+q^2+q+1)*(q^2+q+1)*x^7*d^7+ 2493 q*(q^2+q+1)*(q^5+2*q^4+2*q^3+3*q^2+2*q+1)*(q^4+q^3+q^2+q+1)*(q^2+1)*(q+1)*x^6*d^6+ 2494 (q^10+5*q^9+12*q^8+21*q^7+29*q^6+33*q^5+31*q^4+24*q^3+15*q^2+7*q+12)*x^5*d^5+ 2495 6*x^3*d^3+24; 2496 homogfacFirstQWeyl_all(h); 2497 } 2433 2498 2434 2499 //TODO: FirstQWeyl check the parameters... … … 2452 2517 def l= facFirstWeyl (a); l; 2453 2518 kill l; 2454 poly b = -5328z8x5-5328z7x6+720z9x2+720z8x3-16976z7x4-38880z6x5-5184z7x3-5184z6x4-3774z5x5+2080z8x+5760z7x2-6144z6x3-59616z5x4+3108z3x6-4098z6x2-25704z5x3-21186z4x4+8640z6x-17916z4x3+22680z2x5+2040z5x-4848z4x2-9792z3x3+3024z2x4-10704z3x2-3519z2x3+34776zx4+12096zx3+2898x4-5040z2x+8064x3+6048x2; //Abgebrochen nach 1.5 Stunden; seems to be very complicated 2519 poly b = -5328z8x5-5328z7x6+720z9x2+720z8x3-16976z7x4-38880z6x5 2520 -5184z7x3-5184z6x4-3774z5x5+2080z8x+5760z7x2-6144z6x3-59616z5x4 2521 +3108z3x6-4098z6x2-25704z5x3-21186z4x4+8640z6x-17916z4x3+22680z2x5 2522 +2040z5x-4848z4x2-9792z3x3+3024z2x4-10704z3x2-3519z2x3+34776zx4 2523 +12096zx3+2898x4-5040z2x+8064x3+6048x2; //Abgebrochen nach 1.5 Stunden;seems to be very complicated 2455 2524 def l= facFirstWeyl (b); l; 2456 2525 -
Tst/Long/ok_l.lst
r0b301e r640e4c 39 39 mre 40 40 mre_nonhom 41 ncfactor_tsai_l 41 42 paraplan 42 43 pAdd0L_l -
Tst/Short/ok_s.lst
r0b301e r640e4c 171 171 ; mpsr_s 172 172 mres_s 173 ncfactor_example_all_procedures_s 174 ncfactor_inhomog_s 173 175 normal 174 176 paraplan_s
Note: See TracChangeset
for help on using the changeset viewer.