circuits-diff
Safe HaskellNone
LanguageGHC2024

Circuit.Diff.Chart

Description

Charts interpreted as differentiable maps and the geometry they induce.

A chart φ : U ⊂ ℝⁿ → M pulls the Euclidean metric on M back to a coordinate metric g = JᵀJ. From that metric we can raise/lower indices and compute Christoffel symbols / covariant derivatives — the standard differential-geometry pipeline, using the Diff pullback as the Jacobian.

Synopsis

Induced metric

inducedMetric2D :: (Additive a, Multiplicative a) => Diff' (a, a) (a, a) -> Diff' ((a, a), (a, a)) (a, a) Source #

Pull back the Euclidean metric through a 2-D differentiable chart.

For a chart φ with Jacobian J, the induced metric is g(v) = Jᵀ J v. The backward pass of the returned 'Diff is zero because the typical consumer (an optimizer or connection computation) does not back-propagate through the metric coefficients.

raise2D :: Field a => Diff' ((a, a), (a, a)) (a, a) -> Diff' ((a, a), (a, a)) (a, a) Source #

Invert a 2-D metric 'Diff to obtain the raising operation g⁻¹.

Levi-Civita connection from a 2D metric

partialG :: (Additive a, Multiplicative a) => Diff' ((a, a), (a, a)) (a, a) -> (a, a) -> (((a, a), (a, a)), ((a, a), (a, a))) Source #

Extract the partial derivatives ∂ᵢ gⱼₖ of a 2-D metric from its own 'Diff pullback.

christoffel2D :: Field a => Diff' ((a, a), (a, a)) (a, a) -> Diff' ((a, a), (a, a)) (a, a) -> (a, a) -> (a, a, a, a, a, a, a, a) Source #

Christoffel symbols Γᶜₐᵦ of a 2-D metric from ∂g and g⁻¹.

Uses Γᶜₐᵦ = ½ gᶜⁱ(∂ₐ gᵢᵦ + ∂ᵦ gᵢₐ − ∂ᵢ gₐᵦ).

directionalDerivative :: (Additive a, Multiplicative a) => Diff' (a, a) (a, a) -> (a, a) -> (a, a) -> (a, a) Source #

Directional derivative of a vector field from its Diff pullback.

covariantDerivative :: Field a => Diff' ((a, a), (a, a)) (a, a) -> Diff' ((a, a), (a, a)) (a, a) -> Diff' (a, a) (a, a) -> (a, a) -> (a, a) -> (a, a) Source #

Covariant derivative ∇_dx V = ∂_dx V + Γ(x)(dx, V(x)).