1 coords: read("Input new coordinate")$
3 dim:extdim:length(coords)$
4 basis:VR:extsub[1]:extsubb[1]:[]$
6 (basis:endcons(concat(D,coords[i]),basis))$
9 extsub[i+1]:cons(basis[i]=-basis[i],extsub[i]),
10 extsubb[i]:cons(basis[i]=0,extsub[i]),
11 ci:concat(v,i),VR:endcons(ci,VR))$
13 cliffordtype:read("please input metric type,for example [1,1,1],if E3");
14 /*cliffordtype:[1,1,1]$*/
15 translist:read("represent the standard coordinates with new one");
16 /*translist:[r*sin(phi)*cos(th),r*sin(phi)*sin(th),r*cos(phi)]$ */
17 /*calculation norms */
21 for i:1 thru dim do (_l:map(lambda([x],diff(x,coords[i])),translist),
22 _l:map(lambda([x],x^2),_l),_p:ratsimp(trigsimp(apply("+",_l))),
23 norm_table:endcons(cliffordtype[i]/_p,norm_table))$
26 ( extsubb2[i]:cons(basis[i]=norm_table[i]/basis[i],extsub[i])
29 ( a_:solve(x_^2-1/norm_table[i],[x_]),
30 scale_factor:cons(rhs(a_[2]),scale_factor)
32 scale_factor:reverse(scale_factor)$
35 nest2(_f,_x):=block([_a:[_x],i],if listp(_f) then (
36 _f:reverse(_f),for i:1 thru length(_f) do(_a:map(_f[i],_a)))
37 else (_a:map(_f,_a)),_a[1])$
38 nest3(_f,_x,_n):=block([_a,i],_a:[_x],for i:1 thru _n do(_a:map(_f,_a)),_a)$
40 aa_:solve(x_^2-apply("*",norm_table),[x_])$
43 matrix_element_mult:lambda([x,y],x@y)$