nutils icon indicating copy to clipboard operation
nutils copied to clipboard

derivatives and substitutions with values bound to one or more spaces

Open joostvanzwieten opened this issue 3 years ago • 2 comments

In certain situations I need to compute the derivative of some function.Array, say f, to an argument, say x, and evaluate f with x substituted with a value that is bound to a space, e.g. a basis. This is currently not possible. Derivatives are computed after lowering and during lowering we need to know for each function.Array to which spaces they are bound. function.Argument is not bound to any space.

joostvanzwieten avatar Dec 16 '22 09:12 joostvanzwieten

One way to go about this is to extend function.Argument with spaces. If an argument is bound to one or more spaces, it cannot be evaluated, but it can be substituted and used for computing derivatives. function.replace_arguments has to be aware of the spaces on which the arguments are defined.

joostvanzwieten avatar Dec 16 '22 10:12 joostvanzwieten

Or if every evaluable.Array supports a variable number of leading pointwise axes, we can actually introduce the required axes with evaluable.replace_arguments.

joostvanzwieten avatar Dec 16 '22 10:12 joostvanzwieten