ncpoly.tst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. nc_setup({k,n,NN,KK},{NN*n-n*NN=NN,KK*k-k*KK=KK},left);
  2. p1 := (n-k+1)*NN - (n+1);
  3. p2 := (k+1)*KK -(n-k);
  4. l_g:=nc_groebner ({p1,p2});
  5. nc_preduce(p1+p2,l_g);
  6. nc_divide (k*p1+p2,p1);
  7. nc_divide (k*p1+p2,2*p1);
  8. nc_divide (2*k*k*p1 + k*p1 + p2,2*p1);
  9. nc_factorize (p1*p2);
  10. nc_setup({k,n,NN,KK},{NN*n-n*NN=NN,KK*k-k*KK=KK},right);
  11. nc_factorize (p1*p2);
  12. % applications to shift operators
  13. nc_setup({n,NN},{NN*n-n*NN=1},left);
  14. n*NN;
  15. nc_factorize(ws);
  16. nc_setup({n,NN},{NN*n-n*NN=1},right);
  17. n*NN;
  18. nc_factorize(ws);
  19. nc_setup({NN,n},{NN*n-n*NN=1},right);
  20. n*NN;
  21. nc_factorize(ws);
  22. nc_setup({NN,n},{NN*n-n*NN=1},left);
  23. n*NN;
  24. nc_factorize(ws);
  25. % Applications to partial differential equations
  26. nc_setup({x,Dx},{Dx*x-x*Dx=1});
  27. p:= 2*Dx^2 + x* Dx^3 + 3*x*Dx + x^2*Dx^2 + 14 + 7*x*Dx;
  28. nc_factorize p;
  29. right_factor(p,1); % no factor of degr 1
  30. right_factor(p,2);
  31. left_factor(p,2);
  32. nc_setup({x,Dx},{Dx*x-x*Dx=1});
  33. q := x**2*dx**2 + 2*x**2*dx + x*dx**3 + 2*x*dx**2
  34. + 8*x*dx + 16*x + 2*dx**2 + 4*dx$
  35. nc_factorize q;
  36. right_factor(q,1);
  37. right_factor(q,1,{x}); % no such right factor
  38. right_factor(q,1,{dx});
  39. % looking for factor with degree bound for an individual variable
  40. q := x**6*dx + x**5*dx**2 + 12*x**5 + 10*x**4*dx + 20*x**3
  41. + x**2*dx**3 - x**2*dx**2 + x*dx**4 - x*dx**3 + 8*x*dx**2
  42. - 8*x*dx + 2*dx**3 - 2*dx**2$
  43. right_factor(q,dx);
  44. right_factor(q,dx^2);
  45. % some coefficient sports
  46. nc_setup({NN,n},{NN*n-n*NN=1},left);
  47. q:=(n*nn)^2;
  48. nc_factorize q;
  49. nc_preduce(q,{c1+c2*n + c3*nn + c4*n*nn});
  50. nc_divide(q,n);
  51. nc_cleanup;
  52. end;