;;; Parameters and Metric tensor (define \$x [| θ φ |]) (define \$g__ [| [| r^2 0 |] [| 0 (* r^2 (sin θ)^2) |] |]) (define \$g~~ [| [| (/ 1 r^2) 0 |] [| 0 (/ 1 (* r^2 (sin θ)^2)) |] |]) ;;; Christoffel symbols (define \$Γ_j_k_l (* (/ 1 2) (+ (∂/∂ g_j_l x_k) (∂/∂ g_j_k x_l) (* -1 (∂/∂ g_k_l x_j))))) (define \$Γ~__ (with-symbols {i} (. g~#~i Γ_i_#_#))) ;;; Riemann curvature tensor (define \$R~i_j_k_l (with-symbols {m} (+ (- (∂/∂ Γ~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 |] |]~#_# R~#_#_1_2;[| [| 0 (sin θ)^2 |] [| -1 0 |] |]~#_# R~#_#_2_1;[| [| 0 (* -1 (sin θ)^2) |] [| 1 0 |] |]~#_# R~#_#_2_2;[| [| 0 0 |] [| 0 0 |] |]~#_# ;;; Connection form (define \$ω Γ~#_#_#) ;;; Curvature form (define \$wedge (lambda [%X %Y] !(. X Y))) (define \$d (lambda [%A] !((flip ∂/∂) x A))) (define \$D (lambda [%A] (with-symbols {i j} (+ (d A) (wedge ω~i_j A))))) (define \$Ω (with-symbols {i j} (df-normalize (+ (d ω~i_j) (wedge ω~i_k ω~k_j))))) Ω~#_#_1_1;[| [| 0 0 |] [| 0 0 |] |]~#_# Ω~#_#_1_2;[| [| 0 (/ (sin θ)^2 2) |] [| (/ -1 2) 0 |] |]~#_# Ω~#_#_2_1;[| [| 0 (/ (* -1 (sin θ)^2) 2) |] [| (/ 1 2) 0 |] |]~#_# Ω~#_#_2_2;[| [| 0 0 |] [| 0 0 |] |]~#_#