;;; Parameters and metrics (define \$N 3) (define \$x [|r θ φ|]) (define \$g__ [| [| 1 0 0 |] [| 0 r^2 0 |] [| 0 0 (* r^2 (sin θ)^2) |] |]) (define \$g~~ (M.inverse g_#_#)) ;;; Hodge Laplacian (define \$d (lambda [%X] !((flip ∂/∂) x X))) (define \$hodge (lambda [%A] (let {[\$k (df-order A)]} (with-symbols {i j} (* (sqrt (abs (M.det g_#_#))) (foldl . (. (ε' N k)_[i_1]..._[i_N] A..._[j_1]..._[j_k]) (map 1#g~[i_%1]~[j_%1] (between 1 k)))))))) (define \$δ (lambda [%A] (let {[\$r (df-order A)]} (* (** -1 (+ (* N r) 1)) (hodge (d (hodge A))))))) (define \$Δ (lambda [%A] (match (df-order A) integer {[,0 (δ (d A))] [,N (d (δ A))] [_ (+ (d (δ A)) (δ (d A)))]}))) (Δ (f r θ φ)) ;(/ (+ (f|3|3 r θ φ) (* (sin θ) (cos θ) (f|2 r θ φ)) (* (sin θ)^2 (f|2|2 r θ φ)) (* 2 r (sin θ)^2 (f|1 r θ φ)) (* r^2 (sin θ)^2 (f|1|1 r θ φ))) (* (sin θ)^2 r^2)) ;= ;(/ (+ (* r^2 (sin θ)^2 (f|1|1 r θ φ)) ; (* 2 r (sin θ)^2 (f|1 r θ φ)) ; (* (sin θ) (cos θ) (f|2 r θ φ)) ; (* (sin θ)^2 (f|2|2 r θ φ)) ; (f|3|3 r θ φ)) ; (* (sin θ)^2 r^2))