;;; ;;; Parameters ;;; (define \$x [|t r θ φ|]) ;; ;; Metric tensor ;; (define \$g__ [|[| (/ '(- (* c^2 r) (* 2 G M)) (* c^2 r)) 0 0 0 |] [| 0 (/ -1 (/ '(- (* c^2 r) (* 2 G M)) (* c^2 r))) 0 0 |] [| 0 0 (* -1 r^2) 0 |] [| 0 0 0 (* -1 r^2 (sin θ)^2) |] |]) (define \$g~~ (M.inverse g_#_#)) g~#~# ;[|[| (/ (* c^2 r) '(+ (* c^2 r) (* -2 G M))) 0 0 0 |] ; [| 0 (/ (* -1 '(+ (* c^2 r) (* -2 G M))) (* c^2 r)) 0 0 |] ; [| 0 0 (/ -1 r^2) 0 |] ; [| 0 0 0 (/ -1 (* r^2 (sin θ)^2)) |]|]~#~# (with-symbols {i j k} (. g~i~j g_j_k)) ;[| [| 1 0 0 0 |] [| 0 1 0 0 |] [| 0 0 1 0 |] [| 0 0 0 1 |] |] ;; ;; Christoffel symbols of the first kind ;; (define \$Γ_j_k_l (* (/ 1 2) (+ (∂/∂ g_j_k x~l) (∂/∂ g_j_l x~k) (* -1 (∂/∂ g_k_l x~j))))) Γ_1_#_#;[| [| 0 (/ (+ (* c^2 r) (* -1 '(+ (* c^2 r) (* -2 G M)))) (* 2 c^2 r^2)) 0 0 |] [| (/ (+ (* c^2 r) (* -1 '(+ (* c^2 r) (* -2 G M)))) (* 2 c^2 r^2)) 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]_#_# Γ_2_#_#;[| [| (/ (+ (* -1 c^2 r) '(+ (* c^2 r) (* -2 G M))) (* 2 c^2 r^2)) 0 0 0 |] [| 0 (/ (+ (* -1 c^2 '(+ (* c^2 r) (* -2 G M))) (* c^4 r)) (* 2 '(+ (* c^2 r) (* -2 G M))^2)) 0 0 |] [| 0 0 r 0 |] [| 0 0 0 (* r (sin θ)^2) |] |]_#_# Γ_3_#_#;[| [| 0 0 0 0 |] [| 0 0 (* -1 r) 0 |] [| 0 (* -1 r) 0 0 |] [| 0 0 0 (* r^2 (sin θ) (cos θ)) |] |]_#_# Γ_4_#_#;[| [| 0 0 0 0 |] [| 0 0 0 (* -1 r (sin θ)^2) |] [| 0 0 0 (* -1 r^2 (sin θ) (cos θ)) |] [| 0 (* -1 r (sin θ)^2) (* -1 r^2 (sin θ) (cos θ)) 0 |] |]_#_# ;; ;; Christoffel symbols of the second kind ;; (define \$Γ~__ (with-symbols {i} (. g~#~i Γ_i_#_#))) Γ~1_#_#;[| [| 0 (/ (+ (* c^2 r) (* -1 '(+ (* c^2 r) (* -2 G M)))) (* 2 '(+ (* c^2 r) (* -2 G M)) r)) 0 0 |] [| (/ (+ (* c^2 r) (* -1 '(+ (* c^2 r) (* -2 G M)))) (* 2 '(+ (* c^2 r) (* -2 G M)) r)) 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]_#_# Γ~2_#_#;[| [| (/ (+ (* '(+ (* c^2 r) (* -2 G M)) c^2 r) (* -1 '(+ (* c^2 r) (* -2 G M))^2)) (* 2 c^4 r^3)) 0 0 0 |] [| 0 (/ (+ '(+ (* c^2 r) (* -2 G M)) (* -1 c^2 r)) (* 2 r '(+ (* c^2 r) (* -2 G M)))) 0 0 |] [| 0 0 (/ (* -1 '(+ (* c^2 r) (* -2 G M))) c^2) 0 |] [| 0 0 0 (/ (* -1 '(+ (* c^2 r) (* -2 G M)) (sin θ)^2) c^2) |] |]_#_# Γ~3_#_#;[| [| 0 0 0 0 |] [| 0 0 (/ 1 r) 0 |] [| 0 (/ 1 r) 0 0 |] [| 0 0 0 (* -1 (sin θ) (cos θ)) |] |]_#_# Γ~4_#_#;[| [| 0 0 0 0 |] [| 0 0 0 (/ 1 r) |] [| 0 0 0 (/ (cos θ) (sin θ)) |] [| 0 (/ 1 r) (/ (cos θ) (sin θ)) 0 |] |]_#_# ;; ;; Riemann curvature tensor ;; (define \$R~i_j_k_l (with-symbols {m} (expand-all (+ (- (∂/∂ Γ~i_j_l x~k) (∂/∂ Γ~i_j_k x~l)) (- (. Γ~m_j_l Γ~i_m_k) (. Γ~m_j_k Γ~i_m_l)))))) R~#_#_1_1;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_1_2;[| [| 0 (/ (* 2 G M) (+ (* c^2 r^3) (* -2 G M r^2))) 0 0 |] [| (/ (+ (* 2 G M c^2 r) (* -4 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_1_3;[| [| 0 0 (/ (* -1 G M) (* c^2 r)) 0 |] [| 0 0 0 0 |] [| (/ (+ (* -1 G M c^2 r) (* 2 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_1_4;[| [| 0 0 0 (/ (* -1 G M (sin θ)^2) (* c^2 r)) |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| (/ (+ (* -1 G M c^2 r) (* 2 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] |]~#_# R~#_#_2_1;[| [| 0 (/ (* -2 G M) (+ (* c^2 r^3) (* -2 G M r^2))) 0 0 |] [| (/ (+ (* -2 G M c^2 r) (* 4 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_2_2;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_2_3;[| [| 0 0 0 0 |] [| 0 0 (/ (* -1 G M) (* c^2 r)) 0 |] [| 0 (/ (* G M) (+ (* r^3 c^2) (* -2 r^2 G M))) 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_2_4;[| [| 0 0 0 0 |] [| 0 0 0 (/ (* -1 G M (sin θ)^2) (* c^2 r)) |] [| 0 0 0 0 |] [| 0 (/ (* G M) (+ (* r^3 c^2) (* -2 r^2 G M))) 0 0 |] |]~#_# R~#_#_3_1;[| [| 0 0 (/ (* G M) (* c^2 r)) 0 |] [| 0 0 0 0 |] [| (/ (+ (* G M c^2 r) (* -2 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_3_2;[| [| 0 0 0 0 |] [| 0 0 (/ (* G M) (* r c^2)) 0 |] [| 0 (/ (* -1 G M) (+ (* r^3 c^2) (* -2 r^2 G M))) 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_3_3;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# R~#_#_3_4;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 (/ (* 2 G M (sin θ)^2) (* c^2 r)) |] [| 0 0 (/ (* -2 G M) (* c^2 r)) 0 |] |]~#_# R~#_#_4_1;[| [| 0 0 0 (/ (* G M (sin θ)^2) (* c^2 r)) |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| (/ (+ (* G M c^2 r) (* -2 G^2 M^2)) (* c^4 r^4)) 0 0 0 |] |]~#_# R~#_#_4_2;[| [| 0 0 0 0 |] [| 0 0 0 (/ (* G M (sin θ)^2) (* r c^2)) |] [| 0 0 0 0 |] [| 0 (/ (* -1 G M) (+ (* r^3 c^2) (* -2 r^2 G M))) 0 0 |] |]~#_# R~#_#_4_3;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 (/ (* -2 G M (sin θ)^2) (* c^2 r)) |] [| 0 0 (/ (* 2 G M) (* c^2 r)) 0 |] |]~#_# R~#_#_4_4;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]~#_# ;; ;; Ricci curvature ;; (define \$Ric__ (with-symbols {i} (contract + R~i_#_i_#))) Ric_#_#;[| [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] [| 0 0 0 0 |] |]_#_#