covariant-derivative.scm 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. #| -*-Scheme-*-
  2. Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
  3. 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
  4. 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
  5. Institute of Technology
  6. This file is part of MIT/GNU Scheme.
  7. MIT/GNU Scheme is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11. MIT/GNU Scheme is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with MIT/GNU Scheme; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
  18. USA.
  19. |#
  20. ;;;; nabla_X V = covariant derivative of V wrt X
  21. ;;; V is a vector field, X is a vector field
  22. ;;; More complete covariant derivative procedure
  23. (define* (covariant-derivative Cartan #:optional map)
  24. (cond ((default-object? map)
  25. (covariant-derivative-ordinary Cartan))
  26. (else
  27. (covariant-derivative-ordinary
  28. (Cartan->Cartan-over-map Cartan map)))))
  29. (define (covariant-derivative-ordinary Cartan)
  30. ;;; FBE move after define
  31. ;;(assert (Cartan? Cartan))
  32. (define (nabla X)
  33. (define (nabla_X V)
  34. (cond ((vector-field? V)
  35. (((covariant-derivative-vector Cartan) X) V))
  36. ((form-field? V)
  37. (((covariant-derivative-form Cartan) X) V))
  38. ((has-argument-types? V)
  39. (((covariant-derivative-argument-types Cartan) X) V))
  40. ((function? V)
  41. (((covariant-derivative-function Cartan) X) V))
  42. ((structure? V)
  43. (s:map/r nabla_X V))
  44. (else
  45. (error "Bad input -- covariant-derivative"))))
  46. (make-operator nabla_X `(nabla ,(diffop-name X))))
  47. (assert (Cartan? Cartan))
  48. nabla)
  49. (define* ((covariant-derivative-function Cartan) X)
  50. (lambda (f)
  51. (lambda args
  52. (let ((types
  53. (map (lambda (arg)
  54. (cond ((vector-field? arg) vector-field?)
  55. ((1form-field? arg) 1form-field?)
  56. ((manifold-point? arg) manifold-point?)
  57. (else #f)))
  58. args)))
  59. (cond ((and (fix:= (length types) 1)
  60. (eq? (car types) manifold-point?))
  61. (declare-argument-types! f types)
  62. ((X f) (car args)))
  63. ((any (lambda (type)
  64. (not (or (eq? type vector-field?)
  65. (eq? type 1form-field?))))
  66. types)
  67. (error "Bad function or arguments to covariant derivative"))
  68. (else
  69. (declare-argument-types! f types)
  70. (apply (((covariant-derivative-argument-types Cartan) X) f)
  71. args)))))))
  72. (define (covariant-derivative-vector Cartan)
  73. (let ((basis (Cartan->basis Cartan))
  74. (Cartan-forms (Cartan->forms Cartan)))
  75. (let ((vector-basis (basis->vector-basis basis))
  76. (1form-basis (basis->1form-basis basis)))
  77. (lambda (V)
  78. (let ((CV (Cartan-forms V)))
  79. (lambda (U)
  80. (let ((u-components (1form-basis U)))
  81. (let ((deriv-components
  82. (+ (V u-components)
  83. (* CV u-components))))
  84. (define (the-derivative f)
  85. (* (vector-basis f) deriv-components))
  86. (procedure->vector-field the-derivative
  87. `((nabla ,(diffop-name V))
  88. ,(diffop-name U)))))))))))
  89. (define* ((covariant-derivative-form Cartan) V)
  90. (lambda (tau)
  91. (let ((k (get-rank tau))
  92. (nabla_V ((covariant-derivative-vector Cartan) V)))
  93. (procedure->nform-field
  94. (lambda vectors
  95. (assert (= k (length vectors)))
  96. (- (V (apply tau vectors))
  97. (sigma (lambda (i)
  98. (apply tau
  99. (list-with-substituted-coord vectors i
  100. (nabla_V (list-ref vectors i)))))
  101. 0 (- k 1))))
  102. k
  103. `((nabla ,(diffop-name V)) ,(diffop-name tau))))))
  104. (define (covariant-derivative-argument-types Cartan)
  105. (let* ((basis (Cartan->basis Cartan))
  106. (vector-basis (basis->vector-basis basis))
  107. (1form-basis (basis->1form-basis basis))
  108. (Cartan-forms (Cartan->forms Cartan)))
  109. (lambda (V)
  110. (let ((CV (Cartan-forms V)))
  111. (lambda (T)
  112. (let ((arg-types (argument-types T)))
  113. (define (the-derivative . args)
  114. (assert (fix:= (length args) (length arg-types)))
  115. (let ((VT
  116. (let lp ((types arg-types) (args args) (targs '()) (factors '()))
  117. (if (null? types)
  118. (g:* (V (apply T (reverse targs)))
  119. (g:*:n factors))
  120. (contract
  121. (lambda (e w)
  122. (cond ((eq? (car types) vector-field?)
  123. (assert (vector-field? (car args)))
  124. (lp (cdr types)
  125. (cdr args)
  126. (cons e targs)
  127. (cons (w (car args)) factors)))
  128. ((eq? (car types) 1form-field?)
  129. (assert (1form-field? (car args)))
  130. (lp (cdr types)
  131. (cdr args)
  132. (cons w targs)
  133. (cons ((car args) e) factors)))
  134. (else (error "Bad arg types"))))
  135. basis))))
  136. (corrections
  137. (g:+:n
  138. (map (lambda (type i)
  139. (cond ((eq? type 1form-field?) ;positive
  140. (g:*
  141. (g:* (s:map/r (lambda (e)
  142. ((list-ref args i) e))
  143. vector-basis)
  144. CV)
  145. (s:map/r
  146. (lambda (w)
  147. (apply T (list-with-substituted-coord args i w)))
  148. 1form-basis)))
  149. ((eq? type vector-field?) ;negative
  150. (g:negate
  151. (g:*
  152. (s:map/r
  153. (lambda (e)
  154. (apply T (list-with-substituted-coord args i e)))
  155. vector-basis)
  156. (g:* CV
  157. (s:map/r (lambda (w)
  158. (w (list-ref args i)))
  159. 1form-basis)))))))
  160. arg-types (iota (length arg-types))))))
  161. (g:+ VT corrections)))
  162. (declare-argument-types! the-derivative arg-types)
  163. the-derivative))))))
  164. #|
  165. ;;; Structured objects, such as tensors, take vector fields and 1form
  166. ;;; fields as arguments.
  167. ;;; 1form fields can act as (0,1) tensor fields if arguments are declared:
  168. (let ((omega (literal-1form-field 'omega R4-rect)))
  169. (declare-argument-types! omega (list vector-field?))
  170. (let ((m (typical-point R4-rect))
  171. (X (literal-vector-field 'X R4-rect))
  172. (Tomega (indexed->typed
  173. (typed->indexed omega
  174. (coordinate-system->basis R4-rect))
  175. (coordinate-system->basis R4-rect)))
  176. (V (literal-vector-field 'V R4-rect))
  177. (C (literal-Cartan 'G R4-rect)))
  178. (- (((((covariant-derivative C) X) omega) V) m)
  179. (((((covariant-derivative C) X) Tomega) V) m))))
  180. #| 0 |#
  181. ;;; So to test the operation on a vector field we must construct a
  182. ;;; (1,0) tensor field that behaves like a vector field, but acts on
  183. ;;; 1form fields rather than manifold functions.
  184. (let ((basis (coordinate-system->basis R4-rect))
  185. (V (literal-vector-field 'V R4-rect)))
  186. (let ((TV (lambda (1form) (1form V))))
  187. (declare-argument-types! TV (list 1form-field?))
  188. (let ((m (typical-point R4-rect))
  189. (X (literal-vector-field 'X R4-rect))
  190. (omega (literal-1form-field 'omega R4-rect))
  191. (C (literal-Cartan 'G R4-rect)))
  192. (- ((omega V) m) ((TV omega) m)))))
  193. #| 0 |#
  194. ;;; So TV is the tensor field that acts as the vector field V.
  195. (let ((basis (coordinate-system->basis R4-rect))
  196. (V (literal-vector-field 'V R4-rect)))
  197. (let ((TV (lambda (1form) (1form V))))
  198. (declare-argument-types! TV (list 1form-field?))
  199. (let ((m (typical-point R4-rect))
  200. (X (literal-vector-field 'X R4-rect))
  201. (omega (literal-1form-field 'omega R4-rect))
  202. (C (literal-Cartan 'G R4-rect)))
  203. (- ((omega (((covariant-derivative C) X) V)) m)
  204. (((((covariant-derivative C) X) TV) omega) m)))))
  205. #| 0 |#
  206. (let* ((g S2-metric)
  207. (G (metric->Christoffel-2 g (coordinate-system->basis S2-spherical)))
  208. (C (Christoffel->Cartan G))
  209. (V (literal-vector-field 'V S2-spherical))
  210. (X (literal-vector-field 'X S2-spherical))
  211. (Y (literal-vector-field 'Y S2-spherical))
  212. (m ((point S2-spherical) (up 'theta 'phi))))
  213. (declare-argument-types! g (list vector-field? vector-field?))
  214. (((((covariant-derivative C) V) g) X Y) m))
  215. #|
  216. 0
  217. |#
  218. |#
  219. ;;; also nabla V (X), where nabla V is covariant differential
  220. ;;; nabla V(X)
  221. (define* ((covariant-differential Cartan) V)
  222. (lambda (X)
  223. (((covariant-derivative Cartan) X) V)))
  224. (define (Cartan->Christoffel Cartan)
  225. (assert (Cartan? Cartan))
  226. (let ((basis (Cartan->basis Cartan))
  227. (Cartan-forms (Cartan->forms Cartan)))
  228. (make-Christoffel
  229. (s:map/r Cartan-forms
  230. (basis->vector-basis basis))
  231. basis)))
  232. (define (Christoffel->Cartan Christoffel)
  233. (assert (Christoffel? Christoffel))
  234. (let ((basis (Christoffel->basis Christoffel))
  235. (Christoffel-symbols
  236. (Christoffel->symbols Christoffel)))
  237. (make-Cartan
  238. (* Christoffel-symbols (basis->1form-basis basis))
  239. basis)))
  240. ;;; Constructors and Selectors
  241. (define (Cartan-transform cartan basis-prime)
  242. (let ((basis (Cartan->basis cartan)) ;; tuple of basis vectors
  243. (forms (Cartan->forms cartan))
  244. (prime-dual-basis (basis->1form-basis basis-prime))
  245. (prime-vector-basis (basis->vector-basis basis-prime)))
  246. (let ((vector-basis (basis->vector-basis basis))
  247. (1form-basis (basis->1form-basis basis)))
  248. (let ((J-inv (s:map/r 1form-basis prime-vector-basis))
  249. (J (s:map/r prime-dual-basis vector-basis)))
  250. (let ((omega-prime-forms
  251. (procedure->1form-field
  252. (lambda (u)
  253. (+ (* J (u J-inv))
  254. (* J (* (forms u) J-inv)))))))
  255. (make-Cartan omega-prime-forms basis-prime))))))
  256. (define (symmetrize-Christoffel G)
  257. (let ((s (Christoffel->symbols G)))
  258. (make-Christoffel
  259. (* 1/2 (+ s (s:transpose-outer s)))
  260. (Christoffel->basis G))))
  261. (define (symmetrize-Cartan Cartan)
  262. (Christoffel->Cartan
  263. (symmetrize-Christoffel
  264. (Cartan->Christoffel Cartan))))
  265. (define (make-Cartan forms basis)
  266. (list '*Cartan* forms basis))
  267. (define (Cartan? thing)
  268. (and (pair? thing)
  269. (eq? (car thing) '*Cartan*)))
  270. (define (Cartan->forms thing) (cadr thing))
  271. (define (Cartan->basis thing) (caddr thing))
  272. (define (make-Christoffel symbols basis)
  273. (list '*Christoffel* symbols basis))
  274. (define (Christoffel? thing)
  275. (and (pair? thing)
  276. (eq? (car thing) '*Christoffel*)))
  277. (define (Christoffel->symbols thing) (cadr thing))
  278. (define (Christoffel->basis thing) (caddr thing))
  279. #|
  280. ;;; Fun with Christoffel symbols.
  281. (install-coordinates R2-rect (up 'x 'y))
  282. (define R2-rect-basis
  283. (coordinate-system->basis R2-rect))
  284. (define R2-rect-point
  285. ((R2-rect '->point) (up 'x0 'y0)))
  286. (define (Gijk i j k)
  287. (literal-manifold-function
  288. (string->symbol
  289. (string-append "G^"
  290. (number->string i)
  291. "_"
  292. (number->string j)
  293. (number->string k)))
  294. R2-rect))
  295. (define G
  296. (down (down (up (Gijk 0 0 0)
  297. (Gijk 1 0 0))
  298. (up (Gijk 0 1 0)
  299. (Gijk 1 1 0)))
  300. (down (up (Gijk 0 0 1)
  301. (Gijk 1 0 1))
  302. (up (Gijk 0 1 1)
  303. (Gijk 1 1 1)))))
  304. (clear-arguments)
  305. (suppress-arguments '((up x0 y0)))
  306. (pec (G R2-rect-point))
  307. #| Result:
  308. (down (down (up G^0_00 G^1_00) (up G^0_10 G^1_10))
  309. (down (up G^0_01 G^1_01) (up G^0_11 G^1_11)))
  310. |#
  311. (define CG (make-Christoffel G R2-rect-basis))
  312. (define CF (Christoffel->Cartan CG))
  313. (pec (((Cartan->forms CF) (literal-vector-field 'X R2-rect))
  314. R2-rect-point))
  315. #| Result:
  316. (down (up (+ (* G^0_01 X^1) (* G^0_00 X^0))
  317. (+ (* G^1_01 X^1) (* G^1_00 X^0)))
  318. (up (+ (* G^0_11 X^1) (* G^0_10 X^0))
  319. (+ (* G^1_11 X^1) (* G^1_10 X^0))))
  320. |#
  321. (pec ((Christoffel->symbols
  322. (Cartan->Christoffel (Christoffel->Cartan CG)))
  323. R2-rect-point))
  324. #| Result:
  325. (down (down (up G^0_00 G^1_00) (up G^0_10 G^1_10))
  326. (down (up G^0_01 G^1_01) (up G^0_11 G^1_11)))
  327. |#
  328. ;; Transformation of Cartan to polar leaves covariant derivative
  329. ;; invariant.
  330. (pec (((((- (covariant-derivative CF)
  331. (covariant-derivative
  332. (Cartan-transform CF (R2-polar 'coordinate-basis))))
  333. (literal-vector-field 'A R2-rect))
  334. (literal-vector-field 'B R2-polar))
  335. (literal-scalar-field 'f R2-polar))
  336. R2-rect-point))
  337. #| Result:
  338. 0
  339. |#
  340. ;; Example from the text:
  341. (define-coordinates (up x y) R2-rect)
  342. (define-coordinates (up r theta) R2-polar)
  343. (define v (literal-vector-field 'v R2-rect))
  344. (define w (literal-vector-field 'w R2-rect))
  345. (define f (literal-manifold-function 'f R2-rect))
  346. (define R2-rect-basis (coordinate-system->basis R2-rect))
  347. (define R2-polar-basis (coordinate-system->basis R2-polar))
  348. (define R2-rect-Christoffel
  349. (make-Christoffel
  350. (let ((zero (lambda (m) 0)))
  351. (down (down (up zero zero)
  352. (up zero zero))
  353. (down (up zero zero)
  354. (up zero zero))))
  355. R2-rect-basis))
  356. (define R2-rect-Cartan
  357. (Christoffel->Cartan R2-rect-Christoffel))
  358. (define R2-polar-Christoffel
  359. (make-Christoffel
  360. (let ((zero (lambda (m) 0)))
  361. (down (down (up zero zero)
  362. (up zero (/ 1 r)))
  363. (down (up zero (/ 1 r))
  364. (up (* -1 r) zero))))
  365. R2-polar-basis))
  366. (define R2-polar-Cartan
  367. (Christoffel->Cartan R2-polar-Christoffel))
  368. (pec
  369. (((((- (covariant-derivative R2-rect-Cartan)
  370. (covariant-derivative R2-polar-Cartan))
  371. v)
  372. w)
  373. f)
  374. (typical-point R2-rect)))
  375. #| Result:
  376. 0
  377. |#
  378. (pec
  379. (((((- (covariant-derivative R2-polar-Cartan)
  380. (covariant-derivative
  381. (Cartan-transform R2-polar-Cartan R2-rect-basis)))
  382. v)
  383. w)
  384. f)
  385. R2-rect-point))
  386. #| Result:
  387. 0
  388. |#
  389. (define X (literal-vector-field 'X R2-rect))
  390. (define V (literal-vector-field 'V R2-rect))
  391. (pec (((((covariant-derivative CF) X) V)
  392. (literal-manifold-function 'F R2-rect))
  393. R2-rect-point))
  394. #| Result:
  395. (+ (* G^0_00 V^0 ((partial 0) F) X^0)
  396. (* G^1_00 V^0 ((partial 1) F) X^0)
  397. (* G^0_10 ((partial 0) F) V^1 X^0)
  398. (* G^1_10 ((partial 1) F) V^1 X^0)
  399. (* G^0_01 V^0 ((partial 0) F) X^1)
  400. (* G^1_01 V^0 ((partial 1) F) X^1)
  401. (* G^0_11 ((partial 0) F) V^1 X^1)
  402. (* G^1_11 ((partial 1) F) V^1 X^1)
  403. (* ((partial 0) F) ((partial 0) V^0) X^0)
  404. (* ((partial 0) F) ((partial 1) V^0) X^1)
  405. (* ((partial 1) F) ((partial 0) V^1) X^0)
  406. (* ((partial 1) F) ((partial 1) V^1) X^1))
  407. |#
  408. |#
  409. #|
  410. (define-coordinates (up x y) R2-rect)
  411. (define rect-basis (coordinate-system->basis R2-rect))
  412. (define-coordinates (up r theta) R2-polar)
  413. (define polar-basis (coordinate-system->basis R2-polar))
  414. (define rect-chi (R2-rect '->coords))
  415. (define rect-chi-inverse (R2-rect '->point))
  416. (define polar-chi (R2-polar '->coords))
  417. (define polar-chi-inverse (R2-polar '->point))
  418. (define m2 (rect-chi-inverse (up 'x0 'y0)))
  419. (define rect-Christoffel
  420. (make-Christoffel
  421. (let ((zero (lambda (m) 0)))
  422. (down (down (up zero zero)
  423. (up zero zero))
  424. (down (up zero zero)
  425. (up zero zero))))
  426. rect-basis))
  427. (define polar-Christoffel
  428. (make-Christoffel
  429. (let ((zero (lambda (m) 0)))
  430. (down (down (up zero zero)
  431. (up zero (/ 1 r)))
  432. (down (up zero (/ 1 r))
  433. (up (* -1 r) zero))))
  434. polar-basis))
  435. (define rect-Cartan
  436. (Christoffel->Cartan rect-Christoffel))
  437. (define polar-Cartan
  438. (Christoffel->Cartan polar-Christoffel))
  439. (define J (- (* x d/dy) (* y d/dx)))
  440. (define f (literal-scalar-field 'f R2-rect))
  441. (pec
  442. (((((covariant-derivative rect-Cartan)
  443. d/dx)
  444. J)
  445. f)
  446. m2))
  447. #| Result:
  448. ((partial 1) f)
  449. |#
  450. ;;; Note: arg-suppressor is in force from above.
  451. (pec
  452. (((((covariant-derivative polar-Cartan)
  453. d/dx)
  454. J)
  455. f)
  456. m2))
  457. #| Result:
  458. ((partial 1) f)
  459. |#
  460. |#
  461. #|
  462. ;;; More generally, can show independence here
  463. (define v (literal-vector-field 'v R2-rect))
  464. (define w (literal-vector-field 'w R2-rect))
  465. (pec
  466. (((((- (covariant-derivative rect-Cartan)
  467. (covariant-derivative polar-Cartan))
  468. v)
  469. w)
  470. f)
  471. m2))
  472. #| Result:
  473. 0
  474. |#
  475. (define v (literal-vector-field 'v R2-polar))
  476. (define w (literal-vector-field 'w R2-polar))
  477. (pec
  478. (((((- (covariant-derivative rect-Cartan)
  479. (covariant-derivative polar-Cartan))
  480. v)
  481. w)
  482. f)
  483. m2))
  484. #| Result:
  485. 0
  486. |#
  487. |#
  488. ;;; Over a map
  489. (define (Cartan->Cartan-over-map Cartan map)
  490. (let ((basis (basis->basis-over-map map (Cartan->basis Cartan)))
  491. (Cartan-forms
  492. (s:map/r (form-field->form-field-over-map map)
  493. (Cartan->forms Cartan))))
  494. (make-Cartan (compose Cartan-forms (differential map)) basis)))
  495. #|
  496. (define M (make-manifold S^2-type 2 3))
  497. (define spherical
  498. (coordinate-system-at 'spherical 'north-pole M))
  499. (define-coordinates (up theta phi) spherical)
  500. (define-coordinates t the-real-line)
  501. (define spherical-basis (coordinate-system->basis spherical))
  502. (define G-S2-1
  503. (make-Christoffel
  504. (let ((zero (lambda (point) 0)))
  505. (down (down (up zero zero)
  506. (up zero (/ 1 (tan theta))))
  507. (down (up zero (/ 1 (tan theta)))
  508. (up (- (* (sin theta) (cos theta))) zero))))
  509. spherical-basis))
  510. (define gamma:N->M
  511. (compose (spherical '->point)
  512. (up (literal-function 'alpha)
  513. (literal-function 'beta))
  514. (the-real-line '->coords)))
  515. (define basis-over-gamma
  516. (basis->basis-over-map gamma:N->M spherical-basis))
  517. (define w
  518. (basis-components->vector-field
  519. (up (compose (literal-function 'w0)
  520. (the-real-line '->coords))
  521. (compose (literal-function 'w1)
  522. (the-real-line '->coords)))
  523. (basis->vector-basis basis-over-gamma)))
  524. (define sphere-Cartan (Christoffel->Cartan G-S2-1))
  525. (pec
  526. (s:map/r
  527. (lambda (omega)
  528. ((omega
  529. (((covariant-derivative sphere-Cartan gamma:N->M)
  530. d/dt)
  531. w))
  532. ((the-real-line '->point) 'tau)))
  533. (basis->1form-basis basis-over-gamma)))
  534. #| Result:
  535. (up
  536. (+ (* -1 (sin (alpha tau)) ((D beta) tau) (w1 tau) (cos (alpha tau)))
  537. ((D w0) tau))
  538. (+ (/ (* (w0 tau) ((D beta) tau) (cos (alpha tau))) (sin (alpha tau)))
  539. (/ (* (w1 tau) ((D alpha) tau) (cos (alpha tau))) (sin (alpha tau)))
  540. ((D w1) tau)))
  541. |#
  542. ;;; Geodesic equation
  543. (pec
  544. (s:map/r
  545. (lambda (omega)
  546. ((omega
  547. (((covariant-derivative sphere-Cartan gamma:N->M)
  548. d/dt)
  549. ((differential gamma:N->M) d/dt)))
  550. ((the-real-line '->point) 't)))
  551. (basis->1form-basis basis-over-gamma)))
  552. #| Result:
  553. (up
  554. (+ (* -1 (sin (alpha t)) (expt ((D beta) t) 2) (cos (alpha t)))
  555. (((expt D 2) alpha) t))
  556. (+ (/ (* 2 ((D beta) t) (cos (alpha t)) ((D alpha) t)) (sin (alpha t)))
  557. (((expt D 2) beta) t)))
  558. |#
  559. |#
  560. #|
  561. ;;; Geodesic equation
  562. (define-coordinates (up x y) R2-rect)
  563. (define (Gijk i j k)
  564. (literal-manifold-function
  565. (string->symbol
  566. (string-append "G^"
  567. (number->string i)
  568. "_"
  569. (number->string j)
  570. (number->string k)))
  571. R2-rect))
  572. (define G
  573. (down (down (up (Gijk 0 0 0)
  574. (Gijk 1 0 0))
  575. (up (Gijk 0 1 0)
  576. (Gijk 1 1 0)))
  577. (down (up (Gijk 0 0 1)
  578. (Gijk 1 0 1))
  579. (up (Gijk 0 1 1)
  580. (Gijk 1 1 1)))))
  581. (define CG
  582. (make-Christoffel G (coordinate-system->basis R2-rect)))
  583. (define gamma:N->M
  584. (compose (R2-rect '->point)
  585. (up (literal-function 'alpha)
  586. (literal-function 'beta))
  587. (the-real-line '->coords)))
  588. (define basis-over-gamma
  589. (basis->basis-over-map gamma:N->M
  590. (coordinate-system->basis R2-rect)))
  591. (define u
  592. (basis-components->vector-field
  593. (up (compose (literal-function 'u0)
  594. (the-real-line '->coords))
  595. (compose (literal-function 'u1)
  596. (the-real-line '->coords)))
  597. (basis->vector-basis basis-over-gamma)))
  598. (pec
  599. (s:map/r
  600. (lambda (omega)
  601. ((omega
  602. (((covariant-derivative (Christoffel->Cartan CG) gamma:N->M)
  603. d/dt)
  604. u))
  605. ((the-real-line '->point) 't)))
  606. (basis->1form-basis basis-over-gamma)))
  607. #| Result:
  608. (up
  609. (+ (* ((D alpha) t) (u0 t) (G^0_00 (up (alpha t) (beta t))))
  610. (* ((D alpha) t) (u1 t) (G^0_10 (up (alpha t) (beta t))))
  611. (* ((D beta) t) (u0 t) (G^0_01 (up (alpha t) (beta t))))
  612. (* ((D beta) t) (u1 t) (G^0_11 (up (alpha t) (beta t))))
  613. ((D u0) t))
  614. (+ (* ((D alpha) t) (u0 t) (G^1_00 (up (alpha t) (beta t))))
  615. (* ((D alpha) t) (u1 t) (G^1_10 (up (alpha t) (beta t))))
  616. (* ((D beta) t) (u0 t) (G^1_01 (up (alpha t) (beta t))))
  617. (* ((D beta) t) (u1 t) (G^1_11 (up (alpha t) (beta t))))
  618. ((D u1) t)))
  619. |#
  620. (pec
  621. (s:map/r
  622. (lambda (omega)
  623. ((omega
  624. (((covariant-derivative (Christoffel->Cartan CG) gamma:N->M)
  625. d/dt)
  626. ((differential gamma:N->M) d/dt)))
  627. ((the-real-line '->point) 't)))
  628. (basis->1form-basis basis-over-gamma)))
  629. #| Result:
  630. (up
  631. (+ (* (expt ((D alpha) t) 2) (G^0_00 (up (alpha t) (beta t))))
  632. (* ((D alpha) t) ((D beta) t) (G^0_01 (up (alpha t) (beta t))))
  633. (* ((D alpha) t) ((D beta) t) (G^0_10 (up (alpha t) (beta t))))
  634. (* (expt ((D beta) t) 2) (G^0_11 (up (alpha t) (beta t))))
  635. (((expt D 2) alpha) t))
  636. (+ (* (expt ((D alpha) t) 2) (G^1_00 (up (alpha t) (beta t))))
  637. (* ((D alpha) t) ((D beta) t) (G^1_01 (up (alpha t) (beta t))))
  638. (* ((D alpha) t) ((D beta) t) (G^1_10 (up (alpha t) (beta t))))
  639. (* (expt ((D beta) t) 2) (G^1_11 (up (alpha t) (beta t))))
  640. (((expt D 2) beta) t)))
  641. |#
  642. |#
  643. #|
  644. ;;;; Geodesic Equations = Lagrange Equations
  645. ;;; Here I restrict everything to the unit sphere.
  646. ;;; The coordinates on the unit sphere
  647. (define-coordinates t R1-rect)
  648. (define-coordinates (up theta phi) S2-spherical)
  649. (define 2-sphere-basis (coordinate-system->basis S2-spherical))
  650. ;;; The Christoffel symbols (for r=1) (p.341 MTW) are:
  651. (define G-S2-1
  652. (make-Christoffel
  653. (let ((zero (lambda (point) 0)))
  654. (down (down (up zero zero)
  655. (up zero (/ 1 (tan theta))))
  656. (down (up zero (/ 1 (tan theta)))
  657. (up (- (* (sin theta) (cos theta))) zero))))
  658. 2-sphere-basis))
  659. (pec (let ((mu:N->M (compose (S2-spherical '->point)
  660. (up (literal-function 'mu-theta)
  661. (literal-function 'mu-phi))
  662. (R1-rect '->coords)))
  663. (Cartan (Christoffel->Cartan G-S2-1)))
  664. (s:map/r
  665. (lambda (w)
  666. ((w
  667. (((covariant-derivative Cartan mu:N->M) d/dt)
  668. ((differential mu:N->M) d/dt)))
  669. ((R1-rect '->point) 'tau)))
  670. (basis->1form-basis
  671. (basis->basis-over-map mu:N->M
  672. (Cartan->basis Cartan))))))
  673. #| Result:
  674. (up (+ (* -1
  675. (expt ((D mu-phi) tau) 2)
  676. (cos (mu-theta tau))
  677. (sin (mu-theta tau)))
  678. (((expt D 2) mu-theta) tau))
  679. (+ (/ (* 2 ((D mu-phi) tau)
  680. (cos (mu-theta tau))
  681. ((D mu-theta) tau))
  682. (sin (mu-theta tau)))
  683. (((expt D 2) mu-phi) tau)))
  684. |#
  685. ;;; We can get the geodesic equations as ordinary Lagrange
  686. ;;; equations of a free particle constrained to the surface
  687. ;;; of the sphere:
  688. (define ((Lfree m) s)
  689. (let ((t (time s))
  690. (q (coordinate s))
  691. (v (velocity s)))
  692. (* 1/2 m (square v))))
  693. #|
  694. ;;; F is really the embedding map, from the coordinates on the sphere
  695. ;;; to the 3-space coordinates in the embedding manifold.
  696. ;;; This hides the assumption that the R3 manifold is the same one as
  697. ;;; the embedding manifold.
  698. (define F
  699. (compose (R3-rect '->coords)
  700. (S2-spherical '->point)
  701. coordinate))
  702. ;;; Actually (9 June 2009--GJS) this no longer works, because R3-rect
  703. ;;; does not accept an S2-spherical point as in the same manifold.
  704. ;;; Fixed by explicit transfer of a point -- see manifold.scm
  705. |#
  706. (define F
  707. (compose (R3-rect '->coords)
  708. (transfer-point S2-spherical R3-rect)
  709. (S2-spherical '->point)
  710. coordinate))
  711. (define Lsphere
  712. (compose (Lfree 1) (F->C F)))
  713. (pec (((Lagrange-equations Lsphere)
  714. (up (literal-function 'theta)
  715. (literal-function 'phi)))
  716. 't))
  717. #| Result:
  718. (down
  719. (+ (((expt D 2) theta) t)
  720. (* -1 (cos (theta t)) (sin (theta t)) (expt ((D phi) t) 2)))
  721. (+ (* (expt (sin (theta t)) 2) (((expt D 2) phi) t))
  722. (* 2 (cos (theta t)) (sin (theta t)) ((D phi) t) ((D theta) t))))
  723. |#
  724. ;;; Note these are DOWN while the geodesic equations are UP. This is
  725. ;;; due to the fact that the geodesic equations are raised by the
  726. ;;; metric, which is diagonal, here R=1, and cancels an instance
  727. ;;; of(expt (sin theta) 2).
  728. ;;; Also see p.345 MTW for computing Christoffel symbols from Lagrange
  729. ;;; equations.
  730. |#
  731. #|
  732. ;;; Exercise on computation of Christoffel symbols.
  733. (install-coordinates R3-rect (up 'x 'y 'z))
  734. (define R3-rect-point ((R3-rect '->point) (up 'x0 'y0 'z0)))
  735. (install-coordinates R3-cyl (up 'r 'theta 'zeta))
  736. (define R3-cyl-point ((R3-cyl '->point) (up 'r0 'theta0 'z0)))
  737. (define mpr (R3-rect '->coords))
  738. (pec (((* d/dr d/dr) mpr) R3-rect-point))
  739. #| Result:
  740. (up 0 0 0)
  741. |#
  742. ;;; So \Gamma^r_{rr} = 0, \Gamma^\theta_{rr} = 0
  743. (pec (((* d/dtheta d/dr) mpr) R3-rect-point))
  744. #| Result:
  745. (up (/ (* -1 y0) (sqrt (+ (expt x0 2) (expt y0 2))))
  746. (/ x0 (sqrt (+ (expt x0 2) (expt y0 2))))
  747. 0)
  748. |#
  749. ;;; by hand = -sint d/dx + cost d/dy = 1/r d/dtheta
  750. ;;; Indeed.
  751. (pec (((* d/dtheta d/dr) mpr) R3-cyl-point))
  752. #| Result:
  753. (up (* -1 (sin theta0)) (cos theta0) 0)
  754. |#
  755. ;;; So \Gamma^r_{r\theta} = 0, \Gamma^\theta_{r\theta} = 1/r
  756. (pec (((* d/dr d/dtheta) mpr) R3-rect-point))
  757. #| Result:
  758. (up (/ (* -1 y0) (sqrt (+ (expt x0 2) (expt y0 2))))
  759. (/ x0 (sqrt (+ (expt x0 2) (expt y0 2))))
  760. 0)
  761. |#
  762. ;;; by hand = -sint d/dx + cost d/dy = 1/r d/dtheta
  763. (pec (((* d/dr d/dtheta) mpr) R3-cyl-point))
  764. #| Result:
  765. (up (* -1 (sin theta0)) (cos theta0) 0)
  766. |#
  767. ;;; So \Gammar_{\theta r} = 0, \Gamma\theta_{\theta r} = 1/r
  768. (pec (((* d/dtheta d/dtheta) mpr) R3-rect-point))
  769. #| Result:
  770. (up (* -1 x0) (* -1 y0) 0)
  771. |#
  772. ;;; by hand = -r cost d/dx - r sint d/dy = -r d/dr
  773. (pec (((* d/dtheta d/dtheta) mpr) R3-cyl-point))
  774. #| Result:
  775. (up (* -1 r0 (cos theta0)) (* -1 r0 (sin theta0)) 0)
  776. |#
  777. ;;; So \Gammar_{\theta \theta} = -r, \Gamma\theta_{\theta \theta} = 0
  778. ;;; These are correct Christoffel symbols...
  779. |#
  780. #|
  781. ;;; Computation of Covariant derivatives by difference quotient.
  782. ;;; CD below is parallel in definition to the Lie Derivative.
  783. ;;; Does not seem to depend on a derivative of basis vectors, in fact
  784. ;;; the derivative of the basis vectors is multiplied by zero in the
  785. ;;; product rule output.
  786. (define (Gijk i j k)
  787. (literal-manifold-function
  788. (string->symbol
  789. (string-append "G^"
  790. (number->string i)
  791. "_"
  792. (number->string j)
  793. (number->string k)))
  794. R2-rect))
  795. (define G
  796. (down (down (up (Gijk 0 0 0)
  797. (Gijk 1 0 0))
  798. (up (Gijk 0 1 0)
  799. (Gijk 1 1 0)))
  800. (down (up (Gijk 0 0 1)
  801. (Gijk 1 0 1))
  802. (up (Gijk 0 1 1)
  803. (Gijk 1 1 1)))))
  804. (define X (literal-vector-field 'X R2-rect))
  805. (define Y (literal-vector-field 'Y R2-rect))
  806. (define q_0 (up 'q_x 'q_y))
  807. (define m_0
  808. ((R2-rect '->point) q_0))
  809. (define F (literal-manifold-function 'F R2-rect))
  810. (define (((((CD CF chart) v) u) F) m)
  811. (define (Sigma state) (ref state 0))
  812. (define (U state) (ref state 1))
  813. (define (sigma-u sigma u) (up sigma u))
  814. (define chi (chart '->coords))
  815. (define chi^-1 (chart '->point))
  816. ;; ((gamma m) delta) is the point on gamma advanced by delta.
  817. (define ((gamma m) delta)
  818. (chi^-1 (+ (chi m) (* delta ((v chi) m)))))
  819. (let ((basis (Cartan->basis CF)))
  820. (let ((vector-basis (basis->vector-basis basis))
  821. (1form-basis (basis->1form-basis basis)))
  822. (let ((u^i (1form-basis u)))
  823. (let ((initial-state
  824. (sigma-u (chi m) (u^i m))))
  825. (define (bs state)
  826. (let ((sigma (Sigma state)))
  827. (let ((m_0 (chi^-1 sigma)))
  828. (up ((v chi) m_0)
  829. (* -1
  830. (((Cartan->forms CF) v) m_0)
  831. (u^i m_0))))))
  832. (define (vs fs)
  833. (* (D fs) bs))
  834. ;; First-order approximation to A
  835. (define (Au delta)
  836. (+ (U initial-state)
  837. (* delta ((vs U) initial-state))))
  838. (define (g delta)
  839. (let ((advanced-m ((gamma m) delta)))
  840. (* (- (u^i advanced-m) (Au delta))
  841. ((vector-basis F) advanced-m))))
  842. ((D g) 0))))))
  843. ;;; A bit simpler, but lacking in motivation?
  844. (define (((((CD CF chart) v) u) F) m)
  845. (define (Sigma state) (ref state 0))
  846. (define (U state) (ref state 1))
  847. (define (sigma-u sigma u) (up sigma u))
  848. (define chi (chart '->coords))
  849. (define chi^-1 (chart '->point))
  850. ;; ((gamma m) delta) is the point on gamma advanced by delta.
  851. (define ((gamma m) delta)
  852. (chi^-1 (+ (chi m) (* delta ((v chi) m)))))
  853. (let ((basis (Cartan->basis CF)))
  854. (let ((vector-basis (basis->vector-basis basis))
  855. (1form-basis (basis->1form-basis basis)))
  856. (let ((u^i (1form-basis u)))
  857. (let ((initial-state
  858. (sigma-u (chi m) (u^i m))))
  859. ;; First-order approximation to A
  860. (define (Au delta)
  861. (- (u^i m)
  862. (* delta
  863. (((Cartan->forms CF) v) m)
  864. (u^i m))))
  865. (define (g delta)
  866. (let ((advanced-m ((gamma m) delta)))
  867. (* (- (u^i advanced-m) (Au delta))
  868. ((vector-basis F) advanced-m))))
  869. ((D g) 0))))))
  870. (let ((CF (Christoffel->Cartan
  871. (make-Christoffel G
  872. (coordinate-system->basis R2-rect)))))
  873. (pe (- (((((CD CF R2-rect) X) Y) F) m_0)
  874. (((((covariant-derivative CF) X) Y) F) m_0))))
  875. 0
  876. (let ((CF (Christoffel->Cartan
  877. (make-Christoffel G
  878. (coordinate-system->basis R2-polar)))))
  879. (pe (- (((((CD CF R2-rect) X) Y) F) m_0)
  880. (((((covariant-derivative CF) X) Y) F) m_0))))
  881. 0
  882. (let ((CF (Christoffel->Cartan
  883. (make-Christoffel G
  884. (coordinate-system->basis R2-rect)))))
  885. (pe (- (((((CD CF R2-polar) X) Y) F) m_0)
  886. (((((covariant-derivative CF) X) Y) F) m_0))))
  887. 0
  888. (let ((CF (Christoffel->Cartan
  889. (make-Christoffel G
  890. (coordinate-system->basis R2-polar)))))
  891. (pe (- (((((CD CF R2-polar) X) Y) F) m_0)
  892. (((((covariant-derivative CF) X) Y) F) m_0))))
  893. ;Too slow...
  894. |#
  895. #|
  896. ;;; Testing on forms.
  897. (define (Gijk i j k)
  898. (literal-manifold-function
  899. (string->symbol
  900. (string-append "G^"
  901. (number->string i)
  902. "_"
  903. (number->string j)
  904. (number->string k)))
  905. R2-rect))
  906. (define G
  907. (down (down (up (Gijk 0 0 0)
  908. (Gijk 1 0 0))
  909. (up (Gijk 0 1 0)
  910. (Gijk 1 1 0)))
  911. (down (up (Gijk 0 0 1)
  912. (Gijk 1 0 1))
  913. (up (Gijk 0 1 1)
  914. (Gijk 1 1 1)))))
  915. (define X (literal-vector-field 'X R2-rect))
  916. (define Y (literal-vector-field 'Y R2-rect))
  917. (define omega (literal-1form-field 'omega R2-rect))
  918. (define q_0 (up 'q_x 'q_y))
  919. (define m_0
  920. ((R2-rect '->point) q_0))
  921. (define F (literal-manifold-function 'F R2-rect))
  922. (let* ((CF (Christoffel->Cartan
  923. (make-Christoffel G
  924. (coordinate-system->basis R2-rect))))
  925. (D_x ((covariant-derivative CF) X)))
  926. (pe (- (+ (((D_x omega) Y) m_0)
  927. ((omega (D_x Y)) m_0))
  928. ((D_x (omega Y)) m_0))))
  929. 0
  930. (define tau (literal-1form-field 'tau R2-rect))
  931. (define Z (literal-vector-field 'Z R2-rect))
  932. (let* ((CF (Christoffel->Cartan
  933. (make-Christoffel G
  934. (coordinate-system->basis R2-rect))))
  935. (D_x ((covariant-derivative CF) X)))
  936. (pe (- (((D_x (wedge omega tau)) Y Z) m_0)
  937. (+ (((wedge omega (D_x tau)) Y Z) m_0)
  938. (((wedge (D_x omega) tau) Y Z) m_0)))))
  939. 0
  940. (let* ((CF (Christoffel->Cartan
  941. (make-Christoffel G
  942. (coordinate-system->basis R2-polar))))
  943. (D_x ((covariant-derivative CF) X)))
  944. (pe (- (((D_x (wedge omega tau)) Y Z) m_0)
  945. (+ (((wedge omega (D_x tau)) Y Z) m_0)
  946. (((wedge (D_x omega) tau) Y Z) m_0)))))
  947. 0
  948. |#
  949. (define* ((geodesic-equation source-coordsys target-coordsys
  950. Cartan-on-target)
  951. gamma)
  952. (lambda (source-m)
  953. (assert (= (coordinate-system-dimension source-coordsys) 1))
  954. (let ((e (coordinate-system->vector-basis source-coordsys)))
  955. (((((covariant-derivative Cartan-on-target gamma)
  956. e)
  957. ((differential gamma) e))
  958. (chart target-coordsys))
  959. source-m))))
  960. #|
  961. (((geodesic-equation the-real-line R2-rect (literal-Cartan 'G R2-rect))
  962. (literal-manifold-map 'gamma the-real-line R2-rect))
  963. ((point the-real-line) 't))
  964. #|
  965. (up
  966. (+ (* (expt ((D gamma0) t) 2) (G_00^0 (up (gamma0 t) (gamma1 t))))
  967. (* ((D gamma0) t) ((D gamma1) t) (G_10^0 (up (gamma0 t) (gamma1 t))))
  968. (* ((D gamma0) t) ((D gamma1) t) (G_01^0 (up (gamma0 t) (gamma1 t))))
  969. (* (expt ((D gamma1) t) 2) (G_11^0 (up (gamma0 t) (gamma1 t))))
  970. (((expt D 2) gamma0) t))
  971. (+ (* (expt ((D gamma0) t) 2) (G_00^1 (up (gamma0 t) (gamma1 t))))
  972. (* ((D gamma0) t) ((D gamma1) t) (G_10^1 (up (gamma0 t) (gamma1 t))))
  973. (* ((D gamma0) t) ((D gamma1) t) (G_01^1 (up (gamma0 t) (gamma1 t))))
  974. (* (expt ((D gamma1) t) 2) (G_11^1 (up (gamma0 t) (gamma1 t))))
  975. (((expt D 2) gamma1) t)))
  976. |#
  977. (let ((C (literal-Cartan 'G R2-rect)))
  978. (- (((geodesic-equation the-real-line R2-rect C)
  979. (literal-manifold-map 'gamma the-real-line R2-rect))
  980. ((point the-real-line) 't))
  981. (((geodesic-equation the-real-line R2-rect (symmetrize-Cartan C))
  982. (literal-manifold-map 'gamma the-real-line R2-rect))
  983. ((point the-real-line) 't))))
  984. #|
  985. (up 0 0)
  986. |#
  987. |#
  988. (define* ((parallel-transport-equation
  989. source-coordsys target-coordsys Cartan-on-target)
  990. gamma)
  991. (lambda (vector-over-gamma)
  992. (lambda (source-m)
  993. (assert (= (coordinate-system-dimension source-coordsys) 1))
  994. (let ((e (coordinate-system->vector-basis source-coordsys)))
  995. (((((covariant-derivative Cartan-on-target gamma)
  996. e) ;d/dt
  997. vector-over-gamma)
  998. (chart target-coordsys))
  999. source-m)))))
  1000. #|
  1001. (define M (make-manifold S^2-type 2 3))
  1002. (define S2-spherical
  1003. (coordinate-system-at 'spherical 'north-pole M))
  1004. (define-coordinates (up theta phi) S2-spherical)
  1005. (define S2-basis
  1006. (coordinate-system->basis S2-spherical))
  1007. (define G-S2-1
  1008. (make-Christoffel
  1009. (let ((zero (lambda (point) 0)))
  1010. (down (down (up zero zero)
  1011. (up zero (/ 1 (tan theta))))
  1012. (down (up zero (/ 1 (tan theta)))
  1013. (up (- (* (sin theta)
  1014. (cos theta)))
  1015. zero))))
  1016. S2-basis))
  1017. (define gamma
  1018. (compose (point S2-spherical)
  1019. (up (literal-function 'alpha)
  1020. (literal-function 'beta))
  1021. (chart the-real-line)))
  1022. (define basis-over-gamma
  1023. (basis->basis-over-map gamma S2-basis))
  1024. (define u
  1025. (basis-components->vector-field
  1026. (up (compose (literal-function 'u^0)
  1027. (chart the-real-line))
  1028. (compose (literal-function 'u^1)
  1029. (chart the-real-line)))
  1030. (basis->vector-basis basis-over-gamma)))
  1031. (define sphere-Cartan
  1032. (Christoffel->Cartan G-S2-1))
  1033. ((((parallel-transport-equation
  1034. the-real-line S2-spherical sphere-Cartan)
  1035. gamma)
  1036. u)
  1037. ((point the-real-line) 't))
  1038. #|
  1039. (up
  1040. (+ (* -1 (sin (alpha t)) ((D beta) t) (u^1 t) (cos (alpha t))) ((D u^0) t))
  1041. (+ (/ (* (u^0 t) ((D beta) t) (cos (alpha t))) (sin (alpha t)))
  1042. (/ (* (u^1 t) ((D alpha) t) (cos (alpha t))) (sin (alpha t)))
  1043. ((D u^1) t)))
  1044. |#
  1045. |#