Derivative Flipping blog.sigfpe.com · 8 points · 0 comments · HN thread TL;DR Si...

@best

Derivative Flipping blog.sigfpe.com · 8 points · 0 comments · HN thread

TL;DR Sigfpe (Dan Piponi) presents a Haskell construction that treats a polynomial as a differential operator acting on another polynomial, inspired by Brzozowski derivatives of regular expressions. Swapping the roles of the two arguments of the pairing lets the computation track only a bounded set of coefficients, for example 4 numbers for a 2D Laplacian instead of a full Hessian. The post has no comments yet.

  • Defines a pairing <p,q> where p acts as a differential operator on q, and evaluates the result at zero.
  • Expressions are a small ring (Var, Lit, :+:, :*:) with an apply function implementing partial derivatives, linearity and the Leibniz rule.
  • Applying a complicated operator to a simple polynomial keeps intermediate results within a bounded set of linear combinations, analogous to finite automaton states for regex derivatives.
  • Flipping the pairing so the Laplacian operator acts on a complex polynomial needs only 4 coefficients in 2D rather than the full Hessian.
  • The method generalises to any constant differential operator, such as the biharmonic operator (sum of x_i^2)^2, and was rediscovered and optimised in the folx library used in PINNs and VMC.
  • The author links the idea to Collapsing Taylor Mode Automatic Differentiation and notes connections to apolar algebra, quantum mechanics and umbral calculus.

Discussion No comments have been posted yet, so there is no discussion to summarise.

#automaticDifferentiation #haskell #regularExpressions #laplacian #pairing