Dear StackOverflow community,
although the Python package SymPy provides functionality for various QM (e.g. wave functions and operators) and QFT (e.g. gamma matrices) operations, there is no support for functional derivatives.
I would like to implement the following analytically known functional derivative
D f(t) / D f(t') = delta(t - t') (delta distribution)
to compute more interesting results, e.g.,
D F[f] / D f(t)
where ordinary derivation rules apply until D f(t) / D f(t') has to be computed. I have included an example below. I am aware SymPy already supports taking derivatives with respect to functions, but that is not a functional derivative.
With best regards, XeLasar
Example:
F[f] := exp(integral integral f(x) G(x, y) f(y) dx dy)
D F[f] / D f(t) = (integral f(x) * G(x, y) * delta (t - y) dx dy
+ integral delta (t - x) * G(x, y) * f(y) dx dy) * F[f]
= (integral f(x) * G(x, t) dx
+ integral G(t, y) * f(y) dy) * F[f]
= 2 * (integral G(t, t') * f(t') dt') * F[f]
Note: The integral over dt' collapses due to the delta that arises from D f(t) / D f(t')! G(t, t') is an arbitrary symmetric function. The result can be further simplified as integration variables can be renamed.