xideal.tst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. % Test file for XIDEAL package (Groebner bases for exterior algebra)
  2. % Declare EXCALC variables
  3. pform {x,y,z,t}=0,f(i)=1,{u,u(i),u(i,j)}=0;
  4. % Reductions with xmodideal (all should be zero)
  5. d x^d y xmodideal {d x - d y};
  6. d x^d y^d z xmodideal {d x^d y - d z^d t};
  7. d x^d z^d t xmodideal {d x^d y - d z^d t};
  8. f(2)^d x^d y xmodideal {d t^f(1) - f(2)^f(3),
  9. f(3)^f(1) - d x^d y};
  10. d t^f(1)^d z xmodideal {d t^f(1) - f(2)^f(3),
  11. f(1)^d z - d x^d y,
  12. d t^d y - d x^f(2)};
  13. f(3)^f(4)^f(5)^f(6)
  14. xmodideal {f(1)^f(2) + f(3)^f(4) + f(5)^f(6)};
  15. f(1)^f(4)^f(5)^f(6)
  16. xmodideal {f(1)^f(2) + f(2)^f(3) + f(3)^f(4)
  17. + f(4)^f(5) + f(5)^f(6)};
  18. d x^d y^d z xmodideal {x**2+y**2+z**2-1,x*d x+y*d y+z*d z};
  19. % Changing the division between exterior variables and parameters
  20. xideal {a*d x+y*d y};
  21. xvars {a};
  22. xideal {a*d x+y*d y};
  23. xideal({a*d x+y*d y},{a,y});
  24. xvars {}; % all 0-forms are coefficients
  25. excoeffs(d u - (a*p - q)*d y);
  26. exvars(d u - (a*p - q)*d y);
  27. xvars {p,q}; % p,q are no longer coefficients
  28. excoeffs(d u - (a*p - q)*d y);
  29. exvars(d u - (a*p - q)*d y);
  30. xvars nil;
  31. % Exterior system for heat equation on 1st jet bundle
  32. S := {d u - u(-t)*d t - u(-x)*d x,
  33. d u(-t)^d t + d u(-x)^d x,
  34. d u(-x)^d t - u(-t)*d x^d t};
  35. % Check that it's closed.
  36. dS := d S xmodideal S;
  37. % Exterior system for a Monge-Ampere equation
  38. korder d u(-y,-y),d u(-x,-y),d u(-x,-x),d u(-y),d u(-x),d u;
  39. M := {u(-x,-x)*u(-y,-y) - u(-x,-y)**2,
  40. d u - u(-x)*d x - u(-y)*d y,
  41. d u(-x) - u(-x,-x)*d x - u(-x,-y)*d y,
  42. d u(-y) - u(-x,-y)*d x - u(-y,-y)*d y}$
  43. % Get the full Groebner basis
  44. gbdeg := xideal M;
  45. % Changing the term ordering can be dramatic
  46. xorder gradlex;
  47. gbgrad := xideal M;
  48. % But the bases are equivalent
  49. gbdeg xmod gbgrad;
  50. xorder deglex;
  51. gbgrad xmod gbdeg;
  52. % Some Groebner bases
  53. gb := xideal {f(1)^f(2) + f(3)^f(4)};
  54. gb := xideal {f(1)^f(2), f(1)^f(3)+f(2)^f(4)+f(5)^f(6)};
  55. % Non-graded ideals
  56. % Left and right ideals are not the same
  57. d t^(d z+d x^d y) xmodideal {d z+d x^d y};
  58. (d z+d x^d y)^d t xmodideal {d z+d x^d y};
  59. % Higher order forms can now reduce lower order ones
  60. d x xmodideal {d y^d z + d x,d x^d y + d z};
  61. % Anything whose even part is a parameter generates the trivial ideal!!
  62. gb := xideal({x + d y},{});
  63. gb := xideal {1 + f(1) + f(1)^f(2) + f(2)^f(3)^f(4) + f(3)^f(4)^f(5)^f(6)};
  64. xvars nil;
  65. % Tracing Groebner basis calculations
  66. on trxideal;
  67. gb := xideal {x-y+y*d x-x*d y};
  68. off trxideal;
  69. % Same thing in lexicographic order, without full reduction
  70. xorder lex;
  71. off xfullreduce;
  72. gblex := xideal {x-y+y*d x-x*d y};
  73. % Manual autoreduction
  74. gblex := xauto gblex;
  75. % Tracing reduction
  76. on trxmod;
  77. first gb xmod gblex;
  78. % Restore defaults
  79. on xfullreduce;
  80. off trxideal,trxmod;
  81. xvars nil;
  82. xorder deglex;
  83. end;