New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Div, Grad, Curl, Lap operators (autodiff #7) #224
Conversation
Codecov Report
@@ Coverage Diff @@
## sritchie/diff_six #224 +/- ##
====================================================
Coverage ? 84.33%
====================================================
Files ? 81
Lines ? 8336
Branches ? 449
====================================================
Hits ? 7030
Misses ? 857
Partials ? 449 Continue to review full report at Codecov.
|
f99fc61
to
0526bfa
Compare
@@ -376,6 +384,51 @@ | |||
(o/make-operator #(g/partial-derivative % selectors) | |||
`(~'partial ~@selectors))) | |||
|
|||
(def ^{:doc "Operator that takes a function `f` and returns a new function that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these definitions are FDG-compliant, in the following sense: you make Grad by taking d and then doing a "static cast" of the variance. But the contravariant components of the gradient are equal to the covariant components only when the ambient metric is the identity matrix. Before FDG, SICMutils has no concept of metric, so there's no way to lift the index except to just patch it in as you do here. I think this loses one of the very important features of SICMutils in that it respects that fact that when f is a scalar function df is a one-form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there's a lot to be said for being able to use this system to do your Calculus 3 homework.
Div
,Grad
,Curl
andLap
operators insicmutils.calculus.derivative
and installs them intosicmutils.env
. Add Div, Grad, Curl, Lap operators (autodiff #7) #224also removes the
g/transpose
implementation forOperator
instances, andexposes
sicmutils.calculus.derivative/taylor-series
tosicmutils.env
.I THINK that
Grad
and div are related through a one-level-deep transpose only: https://en.wikipedia.org/wiki/Gradient not anything deeper. @littleredcomputer , lmk if you think this impl is correct.