circuits-diff
Safe HaskellNone
LanguageGHC2024

Circuit.Diff.Jacobian

Description

Column-style Jacobian construction via reverse-mode AD.

Build ∂f/∂x for a list-valued function by seeding one input component at a time through Diff and reading back the pullbacks. This is the reusable pattern underlying the Daisyworld / DubinsChase oracle style: write the physics once, polymorphic in a carrier with Lit, then instantiate the Jacobian helper at Double.

Synopsis

Documentation

jacobianFrom :: forall {k} (tag :: k). [Double] -> ([Diff tag Double Double] -> [Diff tag Double Double]) -> [[Double]] Source #

Jacobian of f : R^n -> R^m at a point, built column-by-column.

The supplied function must already be instantiated at the Diff carrier; callers typically wrap a polymorphic model:

jacobianFrom s0 (s -> daisyRHS (lit l) s)

Returns an m × n list of lists: outer index is output component, inner index is input component.