connection.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  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. ;;; A metric induces a torsion-free connection
  21. ;;; We reserve *Christoffel* and Christoffel? for Christoffel type 2
  22. (define (make-Christoffel-1 symbols basis)
  23. (list '*Christoffel-1* symbols basis))
  24. (define (metric->Christoffel-1 metric basis)
  25. (assert (coordinate-basis? basis))
  26. (let ((vector-basis (basis->vector-basis basis)))
  27. (make-Christoffel-1
  28. (s:map/r (lambda (e_k)
  29. (s:map/r (lambda (e_j)
  30. (s:map/r (lambda (e_i)
  31. (* 1/2 (- (+ (e_k (metric e_i e_j))
  32. (e_j (metric e_i e_k)))
  33. (e_i (metric e_j e_k)))))
  34. vector-basis))
  35. vector-basis))
  36. vector-basis)
  37. basis)))
  38. #|
  39. (define 2-sphere R2-rect)
  40. (install-coordinates 2-sphere (up 'theta 'phi))
  41. (define ((g-sphere R) u v)
  42. (* (square R)
  43. (+ (* (dtheta u) (dtheta v))
  44. (* (compose (square sin) theta)
  45. (dphi u)
  46. (dphi v)))))
  47. (pec ((Christoffel->symbols
  48. (metric->Christoffel-1 (g-sphere 'R)
  49. (coordinate-system->basis 2-sphere)))
  50. ((2-sphere '->point) (up 'theta0 'phi0))))
  51. #| Result:
  52. (down
  53. (down (down 0 0) (down 0 (* (* (cos theta0) (sin theta0)) (expt R 2))))
  54. (down (down 0 (* (* (cos theta0) (sin theta0)) (expt R 2)))
  55. (down (* (* -1 (cos theta0) (sin theta0)) (expt R 2)) 0)))
  56. |#
  57. |#
  58. #|
  59. ;;; Check of text procedure for getting second Christoffel symbols
  60. (define (metric->Christoffel-2 metric basis)
  61. (let ((gi (metric:invert metric basis))
  62. (G1 (metric->Christoffel-1 metric basis)))
  63. (let ((vector-basis (basis->vector-basis basis))
  64. (1form-basis (basis->1form-basis basis))
  65. (G1S (Christoffel->symbols G1)))
  66. (define ((Gamma-Bar v w) u)
  67. (let ((stuff
  68. (s:map/r (lambda (e_k)
  69. (s:map/r (lambda (e_j)
  70. (s:map/r (lambda (e_i)
  71. (* (e_i u) (e_j v) (e_k w)))
  72. 1form-basis))
  73. 1form-basis))
  74. 1form-basis)))
  75. (apply + (ultra-flatten (s:map/r * G1S stuff)))))
  76. (define (Gamma-hat v w)
  77. (apply +
  78. (ultra-flatten
  79. (s:map/r
  80. (lambda (e~i e_i)
  81. (* (gi (Gamma-Bar v w) e~i) e_i))
  82. 1form-basis vector-basis))))
  83. (make-Christoffel
  84. (s:map/r (lambda (e_k)
  85. (s:map/r (lambda (e_j)
  86. (s:map/r (lambda (e~i)
  87. (e~i (Gamma-hat e_j e_k)))
  88. 1form-basis))
  89. vector-basis))
  90. vector-basis)
  91. basis))))
  92. (pec ((Christoffel->symbols
  93. (metric->Christoffel-2 (g-sphere 'R)
  94. (coordinate-system->basis 2-sphere)))
  95. ((2-sphere '->point) (up 'theta0 'phi0))))
  96. #| Result:
  97. (down (down (up 0 0)
  98. (up 0 (/ (cos theta0) (sin theta0))))
  99. (down (up 0 (/ (cos theta0) (sin theta0)))
  100. (up (* -1 (cos theta0) (sin theta0)) 0)))
  101. |#
  102. ;;; As expected!
  103. |#
  104. #|
  105. ;;; Test with general 2d metric
  106. (install-coordinates R2-rect (up 'x 'y))
  107. (define fa
  108. (compose (literal-function 'a (-> (UP Real Real) Real))
  109. (R2-rect '->coords)))
  110. (define fb
  111. (compose (literal-function 'b (-> (UP Real Real) Real))
  112. (R2-rect '->coords)))
  113. (define fc
  114. (compose (literal-function 'c (-> (UP Real Real) Real))
  115. (R2-rect '->coords)))
  116. (define ((g-R2 g_00 g_01 g_11) u v)
  117. (+ (* g_00 (dx u) (dx v))
  118. (* g_01 (+ (* (dx u) (dy v)) (* (dy u) (dx v))))
  119. (* g_11 (dy u) (dy v))))
  120. (pec (((g-R2 fa fb fc)
  121. (literal-vector-field 'u R2-rect)
  122. (literal-vector-field 'v R2-rect))
  123. ((R2-rect '->point) (up 'x0 'y0))))
  124. #| Result:
  125. (+ (* (v^1 (up x0 y0)) (u^1 (up x0 y0)) (c (up x0 y0)))
  126. (* (v^0 (up x0 y0)) (b (up x0 y0)) (u^1 (up x0 y0)))
  127. (* (u^0 (up x0 y0)) (b (up x0 y0)) (v^1 (up x0 y0)))
  128. (* (a (up x0 y0)) (u^0 (up x0 y0)) (v^0 (up x0 y0))))
  129. |#
  130. (define R2-basis (coordinate-system->basis R2-rect))
  131. (pec ((Christoffel->symbols
  132. (metric->Christoffel-1 (g-R2 fa fb fc) R2-basis))
  133. ((R2-rect '->point) (up 'x0 'y0))))
  134. #| Result:
  135. (down
  136. (down
  137. (down (* 1/2 (((partial 0) a) (up x0 y0)))
  138. (+ (* -1/2 (((partial 1) a) (up x0 y0)))
  139. (((partial 0) b) (up x0 y0))))
  140. (down (* 1/2 (((partial 1) a) (up x0 y0)))
  141. (* 1/2 (((partial 0) c) (up x0 y0)))))
  142. (down
  143. (down (* 1/2 (((partial 1) a) (up x0 y0)))
  144. (* 1/2 (((partial 0) c) (up x0 y0))))
  145. (down (+ (((partial 1) b) (up x0 y0))
  146. (* -1/2 (((partial 0) c) (up x0 y0))))
  147. (* 1/2 (((partial 1) c) (up x0 y0))))))
  148. |#
  149. |#
  150. (define (metric->Christoffel-2 metric basis)
  151. (assert (coordinate-basis? basis))
  152. (let ((gi (metric:invert metric basis)))
  153. (let ((vector-basis (basis->vector-basis basis))
  154. (1form-basis (basis->1form-basis basis)))
  155. (make-Christoffel
  156. (s:map/r (lambda (e_k)
  157. (s:map/r (lambda (e_j)
  158. (s:map/r (lambda (w_i)
  159. (contract
  160. (lambda (e_m w_m)
  161. (* (gi w_i w_m)
  162. (* 1/2
  163. (- (+ (e_k (metric e_m e_j))
  164. (e_j (metric e_m e_k)))
  165. (e_m (metric e_j e_k))))))
  166. basis))
  167. 1form-basis))
  168. vector-basis))
  169. vector-basis)
  170. basis))))
  171. #|
  172. (pec ((Christoffel->symbols
  173. (metric->Christoffel-2 (g-sphere 'R)
  174. (coordinate-system->basis 2-sphere)))
  175. ((2-sphere '->point) (up 'theta0 'phi0))))
  176. #| Result:
  177. (down
  178. (down (up 0 0) (up 0 (/ (cos theta0) (sin theta0))))
  179. (down (up 0 (/ (cos theta0) (sin theta0)))
  180. (up (* -1 (sin theta0) (cos theta0)) 0)))
  181. |#
  182. |#
  183. (define (literal-Christoffel-names name scripts n)
  184. (define (Gijk i j k)
  185. (define (tex s)
  186. (cond ((eq? s 'up) "^")
  187. ((eq? s 'down) "_")
  188. (else (error "Bad scripts"))))
  189. (string->symbol
  190. (string-append (symbol->string name)
  191. (tex (car scripts))
  192. (number->string i)
  193. (number->string j)
  194. (tex (caddr scripts))
  195. (number->string k))))
  196. (assert (eq? (car scripts) (cadr scripts)))
  197. (s:generate n (car scripts)
  198. (lambda (i)
  199. (s:generate n (cadr scripts)
  200. (lambda (j)
  201. (s:generate n (caddr scripts)
  202. (lambda (k)
  203. (Gijk i j k))))))))
  204. (define (literal-Christoffel-1 name coordsys)
  205. (let ((n (coordinate-system-dimension coordsys)))
  206. (make-Christoffel-1
  207. (s:map/r (lambda (name)
  208. (literal-manifold-function name coordsys))
  209. (literal-Christoffel-names name '(down down down) n))
  210. (coordinate-system->basis coordsys))))
  211. (define (literal-Christoffel-2 name coordsys)
  212. (let ((n (coordinate-system-dimension coordsys)))
  213. (make-Christoffel
  214. (s:map/r (lambda (name)
  215. (literal-manifold-function name coordsys))
  216. (literal-Christoffel-names name '(down down up) n))
  217. (coordinate-system->basis coordsys))))
  218. (define (literal-Cartan name coordsys)
  219. (Christoffel->Cartan (literal-Christoffel-2 name coordsys)))
  220. #|
  221. (define Cartan (literal-Cartan 'G R2-rect))
  222. #| Cartan |#
  223. (define CF (Cartan->forms Cartan))
  224. #| CF |#
  225. |#
  226. #|
  227. (define polar R2-polar)
  228. (install-coordinates polar (up 'r 'theta))
  229. (define polar-point
  230. ((polar '->point) (up 'r 'theta)))
  231. (define polar-basis
  232. (coordinate-system->basis polar))
  233. (define (polar-metric v1 v2)
  234. (+ (* (dr v1) (dr v2))
  235. (* (square r)
  236. (* (dtheta v1) (dtheta v2)))))
  237. (define foo
  238. ((Christoffel->symbols
  239. (metric->Christoffel-2 polar-metric polar-basis))
  240. polar-point))
  241. (pec foo)
  242. #| Result:
  243. (down
  244. (down (up 0 0)
  245. (up 0 (/ 1 r)))
  246. (down (up 0 (/ 1 r))
  247. (up (* -1 r) 0)))
  248. |#
  249. ;;; Faster, a simplified version.
  250. (define polar R2-rect)
  251. (install-coordinates polar (up 'r 'theta))
  252. (define polar-point
  253. ((polar '->point) (up 'r 'theta)))
  254. (define polar-Gamma
  255. (make-Christoffel
  256. (let ((O (lambda x 0)))
  257. (down
  258. (down (up O O)
  259. (up O (/ 1 r)))
  260. (down (up O (/ 1 r))
  261. (up (* -1 r) O))))
  262. (coordinate-system->basis polar)))
  263. ;;; Now look at curvature
  264. (let* ((nabla
  265. (covariant-derivative (Christoffel->Cartan polar-Gamma)))
  266. (curvature (Riemann nabla)))
  267. (for-each
  268. (lambda (alpha)
  269. (for-each
  270. (lambda (beta)
  271. (for-each
  272. (lambda (gamma)
  273. (for-each
  274. (lambda (delta)
  275. (newline)
  276. (pe `(,alpha ,beta ,gamma ,delta))
  277. (pe ((curvature alpha beta gamma delta) polar-point)))
  278. (list d/dr d/dtheta)))
  279. (list d/dr d/dtheta)))
  280. (list d/dr d/dtheta)))
  281. (list dr dtheta)))
  282. ;;; 16 zeros
  283. |#
  284. #|
  285. (define spherical R3-rect)
  286. (install-coordinates spherical (up 'r 'theta 'phi))
  287. (define spherical-point
  288. ((spherical '->point) (up 'r 'theta 'phi)))
  289. (define spherical-basis
  290. (coordinate-system->basis spherical))
  291. (define (spherical-metric v1 v2)
  292. (+ (* (dr v1) (dr v2))
  293. (* (square r)
  294. (+ (* (dtheta v1) (dtheta v2))
  295. (* (expt (sin theta) 2)
  296. (dphi v1) (dphi v2))))))
  297. (define foo
  298. ((Christoffel->symbols
  299. (metric->Christoffel-2 spherical-metric spherical-basis))
  300. spherical-point))
  301. (pec foo)
  302. #| Result:
  303. (down
  304. (down (up 0 0 0) (up 0 (/ 1 r) 0) (up 0 0 (/ 1 r)))
  305. (down (up 0 (/ 1 r) 0) (up (* -1 r) 0 0) (up 0 0 (/ (cos theta) (sin theta))))
  306. (down (up 0 0 (/ 1 r))
  307. (up 0 0 (/ (cos theta) (sin theta)))
  308. (up (* -1 r (expt (sin theta) 2)) (* -1 (sin theta) (cos theta)) 0)))
  309. |#
  310. ;;; Thus, make simplified version.
  311. (define spherical-Gamma
  312. (make-Christoffel
  313. (let ((O (lambda x 0)))
  314. (down
  315. (down (up O O O) (up O (/ 1 r) O) (up O O (/ 1 r)))
  316. (down (up O (/ 1 r) O) (up (* -1 r) O O) (up O O (/ (cos theta) (sin theta))))
  317. (down (up O O (/ 1 r))
  318. (up O O (/ (cos theta) (sin theta)))
  319. (up (* -1 r (expt (sin theta) 2)) (* -1 (sin theta) (cos theta)) O))))
  320. (coordinate-system->basis spherical)))
  321. ;;; Now look at curvature
  322. (let* ((nabla
  323. (covariant-derivative (Christoffel->Cartan spherical-Gamma)))
  324. (curvature (Riemann nabla)))
  325. (for-each
  326. (lambda (alpha)
  327. (for-each
  328. (lambda (beta)
  329. (for-each
  330. (lambda (gamma)
  331. (for-each
  332. (lambda (delta)
  333. (newline)
  334. (pe `(,alpha ,beta ,gamma ,delta))
  335. (pe ((curvature alpha beta gamma delta)
  336. spherical-point)))
  337. (list d/dr d/dtheta d/dphi)))
  338. (list d/dr d/dtheta d/dphi)))
  339. (list d/dr d/dtheta d/dphi)))
  340. (list dr dtheta dphi)))
  341. ;;; 81 zeros
  342. |#
  343. ;;; Connections for non-coordinate basis -- MTW p.210
  344. ;;; c_ijk = g_kl c_ij^l = g_kl e^l([e_i, e_j])
  345. (define (structure-constant e_i e_j e_k basis metric)
  346. (contract
  347. (lambda (e_l w_l)
  348. (* (metric e_k e_l)
  349. (w_l (commutator e_i e_j))))
  350. basis))
  351. (define (metric->connection-1 metric basis)
  352. (let ((vector-basis (basis->vector-basis basis))
  353. (1form-basis (basis->1form-basis basis)))
  354. (make-Christoffel
  355. (s:map/r
  356. (lambda (e_k)
  357. (s:map/r
  358. (lambda (e_j)
  359. (s:map/r
  360. (lambda (e_i)
  361. (* 1/2 (+ (- (+ (e_k (metric e_i e_j))
  362. (e_j (metric e_i e_k)))
  363. (e_i (metric e_j e_k)))
  364. (- (+ (structure-constant e_i e_j e_k basis metric)
  365. (structure-constant e_i e_k e_j basis metric))
  366. (structure-constant e_j e_k e_i basis metric)))))
  367. vector-basis))
  368. vector-basis))
  369. vector-basis)
  370. basis)))
  371. (define (metric->connection-2 metric basis)
  372. (let ((vector-basis (basis->vector-basis basis))
  373. (1form-basis (basis->1form-basis basis))
  374. (inverse-metric (metric:invert metric basis)))
  375. (make-Christoffel
  376. (s:map/r
  377. (lambda (e_k)
  378. (s:map/r
  379. (lambda (e_j)
  380. (s:map/r
  381. (lambda (w_i)
  382. (contract
  383. (lambda (e_m w_m)
  384. (* (inverse-metric w_i w_m)
  385. (* 1/2 (+ (- (+ (e_k (metric e_m e_j))
  386. (e_j (metric e_m e_k)))
  387. (e_m (metric e_j e_k)))
  388. (- (+ (structure-constant e_m e_j e_k basis metric)
  389. (structure-constant e_m e_k e_j basis metric))
  390. (structure-constant e_j e_k e_m basis metric))))))
  391. basis))
  392. 1form-basis))
  393. vector-basis))
  394. vector-basis)
  395. basis)))
  396. #|
  397. ;;; MTW p205 spherical flat lorentz
  398. (define spherical-Lorentz R4-rect)
  399. (install-coordinates spherical-Lorentz (up 't 'r 'theta 'phi))
  400. (define spherical-Lorentz-basis
  401. (coordinate-system->basis spherical-Lorentz))
  402. (define ((spherical-Lorentz-metric c^2) v1 v2)
  403. (+ (* -1 c^2 (* (dt v1) (dt v2)))
  404. (* (dr v1) (dr v2))
  405. (* (square r)
  406. (+ (* (dtheta v1) (dtheta v2))
  407. (* (square (sin theta))
  408. (* (dphi v1) (dphi v2)))))))
  409. (define spherical-Lorentz-point
  410. ((spherical-Lorentz '->point) (up 't 'r 'theta 'phi)))
  411. (define (orthonormal-spherical-Lorentz-vector-basis c^2)
  412. (down (* (/ 1 (sqrt c^2)) d/dt)
  413. d/dr
  414. (* (/ 1 r) d/dtheta)
  415. (* (/ 1 (* r (sin theta))) d/dphi)))
  416. (define (orthonormal-spherical-Lorentz-1form-basis c^2)
  417. (let ((orthonormal-spherical-Lorentz-vectors
  418. (orthonormal-spherical-Lorentz-vector-basis c^2)))
  419. (vector-basis->dual orthonormal-spherical-Lorentz-vectors
  420. spherical-Lorentz)))
  421. (define (orthonormal-spherical-Lorentz-basis c^2)
  422. (make-basis (orthonormal-spherical-Lorentz-vector-basis c^2)
  423. (orthonormal-spherical-Lorentz-1form-basis c^2)))
  424. (pec ((s:map/r (orthonormal-spherical-Lorentz-1form-basis 'c^2)
  425. (orthonormal-spherical-Lorentz-vector-basis 'c^2))
  426. spherical-Lorentz-point))
  427. #| Result:
  428. (down (up 1 0 0 0) (up 0 1 0 0) (up 0 0 1 0) (up 0 0 0 1))
  429. |#
  430. (pec (((spherical-Lorentz-metric 'c^2)
  431. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 0)
  432. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 0))
  433. spherical-Lorentz-point))
  434. #| Result:
  435. -1
  436. |#
  437. (pec (((spherical-Lorentz-metric 'c^2)
  438. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 1)
  439. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 1))
  440. spherical-Lorentz-point))
  441. #| Result:
  442. 1
  443. |#
  444. (pec (((spherical-Lorentz-metric 'c^2)
  445. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 2)
  446. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 2))
  447. spherical-Lorentz-point))
  448. #| Result:
  449. 1
  450. |#
  451. (pec (((spherical-Lorentz-metric 'c^2)
  452. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 3)
  453. (ref (orthonormal-spherical-Lorentz-vector-basis 'c^2) 3))
  454. spherical-Lorentz-point))
  455. #| Result:
  456. 1
  457. |#
  458. (pec ((Christoffel->symbols
  459. (metric->connection-1 (spherical-Lorentz-metric 'c^2)
  460. (orthonormal-spherical-Lorentz-basis 'c^2)))
  461. spherical-Lorentz-point))
  462. #| Result:
  463. (down
  464. (down (down 0 0 0 0) (down 0 0 0 0) (down 0 0 0 0) (down 0 0 0 0))
  465. (down (down 0 0 0 0) (down 0 0 0 0) (down 0 0 0 0) (down 0 0 0 0))
  466. (down (down 0 0 0 0) (down 0 0 (/ 1 r) 0) (down 0 (/ -1 r) 0 0) (down 0 0 0 0))
  467. (down (down 0 0 0 0)
  468. (down 0 0 0 (/ 1 r))
  469. (down 0 0 0 (/ (cos theta) (* r (sin theta))))
  470. (down 0 (/ -1 r) (/ (* -1 (cos theta)) (* r (sin theta))) 0)))
  471. |#
  472. (define foo
  473. (show-time
  474. (lambda ()
  475. ((Christoffel->symbols
  476. (metric->connection-2 (spherical-Lorentz-metric 'c^2)
  477. (orthonormal-spherical-Lorentz-basis 'c^2)))
  478. spherical-Lorentz-point))))
  479. (pec foo)
  480. #| Result:
  481. (down
  482. (down (up 0 0 0 0) (up 0 0 0 0) (up 0 0 0 0) (up 0 0 0 0))
  483. (down (up 0 0 0 0) (up 0 0 0 0) (up 0 0 0 0) (up 0 0 0 0))
  484. (down (up 0 0 0 0) (up 0 0 (/ 1 r) 0) (up 0 (/ -1 r) 0 0) (up 0 0 0 0))
  485. (down (up 0 0 0 0)
  486. (up 0 0 0 (/ 1 r))
  487. (up 0 0 0 (/ (cos theta) (* r (sin theta))))
  488. (up 0 (/ -1 r) (/ (* -1 (cos theta)) (* r (sin theta))) 0)))
  489. |#
  490. ;;; The last two are essentially the same. Is this correct?
  491. #|
  492. ;;; Check answers from MTW p.213
  493. ;;; t r theta phi
  494. ;;; 0 1 2 3
  495. (pe (ref foo 3 2 3))
  496. (/ (cos theta) (* r (sin theta)))
  497. (pe (ref foo 3 3 2))
  498. (/ (* -1 (cos theta)) (* r (sin theta)))
  499. (pe (ref foo 2 1 2))
  500. (/ 1 r)
  501. (pe (ref foo 3 1 3))
  502. (/ 1 r)
  503. (pe (ref foo 2 2 1))
  504. (/ -1 r)
  505. (pe (ref foo 3 3 1))
  506. (/ -1 r)
  507. |#
  508. (define (orthonormal-spherical-Lorentz-second-connection c^2)
  509. (make-Christoffel
  510. (let ((zero (lambda (point) 0)))
  511. (down
  512. (down (up zero zero zero zero)
  513. (up zero zero zero zero)
  514. (up zero zero zero zero)
  515. (up zero zero zero zero))
  516. (down (up zero zero zero zero)
  517. (up zero zero zero zero)
  518. (up zero zero zero zero)
  519. (up zero zero zero zero))
  520. (down (up zero zero zero zero)
  521. (up zero zero (/ 1 r) zero)
  522. (up zero (/ -1 r) zero zero)
  523. (up zero zero zero zero))
  524. (down (up zero zero zero zero)
  525. (up zero zero zero (/ 1 r))
  526. (up zero zero zero (/ (cos theta) (* r (sin theta))))
  527. (up zero
  528. (/ -1 r)
  529. (/ (* -1 (cos theta)) (* r (sin theta)))
  530. zero))))
  531. (orthonormal-spherical-Lorentz-basis c^2)))
  532. ;;; Look at curvature
  533. (for-each
  534. (lambda (alpha)
  535. (for-each
  536. (lambda (beta)
  537. (for-each
  538. (lambda (gamma)
  539. (for-each
  540. (lambda (delta)
  541. (newline)
  542. (pe `(,alpha ,beta ,gamma ,delta))
  543. (pe (((Riemann
  544. (Christoffel->Cartan
  545. (orthonormal-spherical-Lorentz-second-connection 'c^2)))
  546. alpha beta gamma delta)
  547. spherical-Lorentz-point)))
  548. (list d/dt d/dr d/dtheta d/dphi)))
  549. (list d/dt d/dr d/dtheta d/dphi)))
  550. (list d/dt d/dr d/dtheta d/dphi)))
  551. (list dt dr dtheta dphi))
  552. ;;; 256 zeros
  553. |#