derivatives and substitutions with values bound to one or more spaces
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.
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.
Or if every evaluable.Array supports a variable number of leading pointwise axes, we can actually introduce the required axes with evaluable.replace_arguments.