1 /* SF bug report #926: "sign errors in cartan package" */
3 (if get ('cartan, 'version) = false
9 init_cartan([x1,x2,x11,x21]));
10 [dx1, dx2, dx11, dx21];
15 - dx1*dx21 - dx2*dx11;
17 /* verify ordering of operands */
18 subst ("*" = ".", foo);
19 - dx1.dx21 - dx2.dx11;
22 init_cartan([x1,x2,x3,x4]));
30 subst ("*" = ".", foo);
34 init_cartan([y,x,z]));
52 subst ("*" = ".", foo);
58 subst ("*" = ".", foo);
64 subst ("*" = ".", foo);
67 /* example from the mailing list circa 2021-05-20: "Can't Take Exterior Derivative with diff_form" */
70 init_cartan ([x, y]));
73 omega: -y * dx + x * dy;
76 subst ("*" = ".", omega);
79 foo: ext_diff (omega);
82 subst ("*" = ".", foo);
86 init_cartan ([x, y, z]));
92 subst ("*" = ".", foo);
98 subst ("*" = ".", foo);
101 /* continuing with basis [dx, dy, dz], these are additional examples
102 * from "Differential Forms 02.wxmx" by Jeffrey Rolland
105 eta1: x*dy~dz +y*dz~dx +z*dx~dy;
106 x*dy*dz-y*dx*dz+z*dx*dy;
108 subst ("*" = ".", eta1);
109 x.dy.dz-y.dx.dz+z.dx.dy;
114 subst ("*" = ".", foo);
117 eta2: x*dy~dz +y*dx~dz +z*dx~dy;
118 x*dy*dz+y*dx*dz+z*dx*dy;
120 subst ("*" = ".", eta2);
121 x.dy.dz+y.dx.dz+z.dx.dy;
126 subst ("*" = ".", foo);