Rename *ll* and *ul* to ll and ul in $defint
[maxima.git] / share / diff_form / cartan_new.lisp
blobe3ef2c0cf4d788882fa46650eaaea85787036175
1 ;;this program is derived from maxima/share/calculus/cartan.lisp
2 ;;I add clifford operator &,&2
3 ;;I add clifford differential operator d_c
6 (defprop $\| %\| verb)
7 (defprop $\| "|" op)
8 (putopr "|" '$\|)
9 (add2lnc (quote "|") $props)
10 (defprop $\| dimension-infix dimension)
11 (defprop $\| (#\Space #\| #\Space) dissym)
12 (defprop $\| 120 lbp)
13 (defprop $\| 180 rbp)
14 (defprop $\| parse-infix led)
15 (defprop $\| msize-infix grind)
16 (defprop %\| dimension-infix dimension)
17 (defprop %\| (#\Space #\| #\Space) dissym)
18 (mdefprop $\| ((lambda) ((mlist) $v $f) ((mprog simp) ((mlist simp)
19 $i $j $ext101 $ext102 $ext103 $ext104) ((msetq simp) $ext103
20 (($expand simp) $f)) ((msetq simp) $ext102 ((mtimes simp)
21 (($v simp array) 1) (($coeff simp) $ext103 (($basis simp array) 1))))
22 ((mdo simp) $i 2 nil nil $dim nil ((mprogn simp) ((msetq simp)
23 $ext101 (($coeff simp) $ext103 (($basis simp array) $i)))
24 ((mcond simp) ((mnotequal simp) $ext101 0) ((msetq simp) $ext101
25 (($substitute simp) (($extsub simp array) $i) $ext101)) t $false)
26 ((msetq simp) $ext102 ((mplus simp) $ext102 ((mtimes simp) $ext101
27 (($v simp array) $i)))))) ((mreturn simp) (($expand simp) $ext102))))
28 mexpr)
29 (add2lnc (quote (($\|) $v $f)) $functions)
30 (defprop %\| $\| noun)
32 (defprop $@ %@ verb)
33 (defprop $@ "@" op)
34 (putopr "@" '$@)
35 (add2lnc (quote "@") $props)
36 (defprop $@ dimension-infix dimension)
37 (defprop $@ (#\Space #\& #\Space) dissym)
38 ;;(defprop $@ 140 lbp)
39 ;;(defprop $@ 180 rbp)
40 (defprop $@ 80 lbp)
41 (defprop $@ 100 rbp)
42 (defprop $@ parse-infix led)
43 (defprop $@ msize-infix grind)
44 (defprop %@ dimension-infix dimension)
45 (defprop %@ (#\Space #\& #\Space) dissym)
46 ;;exterior operator @
47 (mdefprop $@
48 ((lambda)
49 ((mlist) $f $g)
50 ((mprog simp)
51 ((mlist simp) $i $j $ext101 $ext102 $ext103 $ext104 $ext105)
52 ((msetq simp) $ext101 0)
53 ((msetq simp) $ext102 $true)
54 ((msetq simp) $ext103
55 (($expand simp) $f))
56 ((mdo simp) $i $dim -1 nil 1 nil
57 ((mprogn simp)
58 ((msetq simp) $ext104
59 (($expand simp)
60 (($bothcoef simp) $ext103
61 (($basis simp array) $i))))
62 ((msetq simp) $ext105
63 (($first simp) $ext104))
64 ((mcond simp)
65 ((mnotequal simp) $ext105 0)
66 ((mprogn simp)
67 ((msetq simp) $ext103 (($last simp) $ext104))
68 ((msetq simp) $ext101
69 ((mplus simp) $ext101
70 ;;(($@ simp) $ext105
71 ;;move $ext105 later
72 (($@ simp) $ext105
73 ((mtimes simp)
74 (($basis simp array) $i)
75 (($substitute simp)
76 (($extsubb simp array) $i) $g)) )))
77 ((msetq simp) $ext102 $false)) t $false)))
78 ((mcond simp) $ext102
79 ((mreturn simp)
80 (($expand simp) ((mtimes simp) $f $g)))
81 t ((mreturn simp) (($expand simp) $ext101)))))
82 mexpr)
84 (add2lnc (quote (($@) $f $g)) $functions)
85 (defprop %@ $@ noun)
86 ;;start definition with clifford operator
87 (defprop $& %& verb)
88 (defprop $& "&" op)
89 (putopr "&" '$\&)
90 (add2lnc (quote "&") $props)
91 (defprop $& dimension-infix dimension)
92 (defprop $& (#\Space #\& #\Space) dissym)
93 (defprop $& 140 lbp)
94 (defprop $& 180 rbp)
95 (defprop $& parse-infix led)
96 (defprop $& msize-infix grind)
97 (defprop %& dimension-infix dimension)
98 (defprop %& (#\Space #\& #\Space) dissym)
99 ;;clifford operator &
100 (mdefprop $& ((lambda)
101 ((mlist) $f $g)
102 ((mprog simp)
103 ((mlist simp) $i $j $ext101 $ext102 $ext103 $ext104 $ext105)
104 ((msetq simp) $ext101 0)
105 ((msetq simp) $ext102 $true)
106 ((msetq simp) $ext103
107 (($expand simp) $f))
108 ((mdo simp) $i $dim -1 nil 1 nil
109 ((mprogn simp) ((msetq simp) $ext104
110 (($expand simp)
111 (($bothcoef simp) $ext103
112 (($basis simp array) $i))))
113 ((msetq simp) $ext105 (($first simp) $ext104))
114 ((mcond simp) ((mnotequal simp) $ext105 0)
115 ((mprogn simp) ((msetq simp) $ext103 (($last simp) $ext104))
116 ((msetq simp) $ext101 ((mplus simp) $ext101
117 ;;(($& simp) $ext105
118 (($& simp) $ext105
119 ((mtimes simp)
120 (($basis simp array) $i)
121 (($substitute simp)
122 (($extsubb2 simp array) $i) $g))
124 ((msetq simp) $ext102 $false)) t $false)))
125 ((mcond simp) $ext102
126 ((mreturn simp) (($expand simp)
127 ((mtimes simp) $f $g))) t
128 ((mreturn simp) (($expand simp) $ext101))))) mexpr)
130 (add2lnc (quote (($&) $f $g)) $functions)
131 (defprop %& $& noun)
133 ;;exterior differential operator
134 (mdefprop $d ((lambda)
135 ((mlist) $f)
136 (($sum simp)
137 (($@ simp)
138 (($basis simp array) $i)
139 (($diff simp) $f
140 (($coords simp array) $i)))
141 $i 1 $dim)) mexpr)
143 (add2lnc (quote (($d2) $f)) $functions)
145 ;;clifford differential operator
146 (mdefprop $d_c ((lambda)
147 ((mlist) $f)
148 (($sum simp)
149 (($& simp)
150 (($basis simp array) $i)
151 (($diff simp) $f
152 (($coords simp array) $i)))
153 $i 1 $dim)) mexpr)
155 (add2lnc (quote (($d_c) $f)) $functions)
157 ;;another clifford operator with different basis.
158 ;;clifford operator & and exterior operator go with.
159 ;;but we ofen need to calc clifford algebra another basis at the same time.
160 ;;before using &2 operator you must "infix("&2")$ "
161 (defprop $&2 %&2 verb)
162 (defprop $&2 "&2" op)
163 (putopr "&2" '$\&2)
164 (add2lnc (quote "&2") $props)
165 (defprop $&2 dimension-infix dimension)
166 (defprop $&2 (#\Space #\& #\Space) dissym)
167 (defprop $&2 140 lbp)
168 (defprop $&2 180 rbp)
169 (defprop $&2 parse-infix led)
170 (defprop $&2 msize-infix grind)
171 (defprop %&2 dimension-infix dimension)
172 (defprop %&2 (#\Space #\& #\Space) dissym)
173 ;;clifford operator &
174 (mdefprop $&2 ((lambda)
175 ((mlist) $f $g)
176 ((mprog simp)
177 ((mlist simp) $i $j $ext101 $ext102 $ext103 $ext104 $ext105)
178 ((msetq simp) $ext101 0)
179 ((msetq simp) $ext102 $true)
180 ((msetq simp) $ext103
181 (($expand simp) $f))
182 ((mdo simp) $i $n_dim -1 nil 1 nil
183 ((mprogn simp) ((msetq simp) $ext104
184 (($expand simp)
185 (($bothcoef simp) $ext103
186 (($basis2 simp array) $i))))
187 ((msetq simp) $ext105 (($first simp) $ext104))
188 ((mcond simp) ((mnotequal simp) $ext105 0)
189 ((mprogn simp) ((msetq simp) $ext103 (($last simp) $ext104))
190 ((msetq simp) $ext101 ((mplus simp) $ext101
191 (($&2 simp) $ext105 ((mtimes simp)
192 (($basis2 simp array) $i)
193 (($substitute simp)
194 (($extsubb4 simp array) $i) $g)))))
195 ((msetq simp) $ext102 $false)) t $false)))
196 ((mcond simp) $ext102
197 ((mreturn simp) (($expand simp)
198 ((mtimes simp) $f $g))) t
199 ((mreturn simp) (($expand simp) $ext101))))) mexpr)
201 (add2lnc (quote (($&2) $f $g)) $functions)
202 (defprop %&2 $&2 noun)