On Mon, Dec 04, 2006 at 09:46:18AM -0800, Robert Bradshaw wrote:
>
> I think we are thinking of these indetermanents wrongly--they are
> dummy variables and have should really have no context outside of the
> function definition. Another problem is that, if we say f = sin(a)+cos
> (x), then f(1,2) is ambiguous. Here's what I think should happen:
>
> f = sin(x) should be illegal (though I'm not sure how to throw an
> informative error here). Instead one should have to type f(x) = sin
> (x). This would be pre-parsed to something like
>
> with inject_indetermanents('x'):
> f = sin(x)
>
> Here inject_indetermanents would be assign x to an indetermanent that
> knows both its name (for printing) and its position (in the tuple if
> f is called with multiple arguments, and x is recursively called down
> the tree). It would be a morphism of the category of sets and always
> act as the identity function on __call__. It could, say, know how to
> differentiate itself (return 1 if the variable with respect to
> integration matches self.name, 0 (or dx/dother) otherwise. It would
> support addition, exponentiation, etc. via a generic "sum" class that
> takes two functions and returns a function. Coercible into R[x], etc.
>
> (I'm not sure how contexts work, perhaps the all the indetermanents
> in the block would have to be wrapped... this is still doable via
> regular expressions...)
>
> Any comments?
I like this proposal a great deal. It fixes all of my complaints that
I've been bringing up about polynomial rings. It is however very
difficult to actually implement this with-out pre-parser logic. I'm
not certain how much of a downside that is.
One other downside is that these indeterminants would not be
elements in the polynomial ring and so it seems that they would not
benefit from the speed of the polynomial arithmetic architecture. That
is to say, you could have polynomials in sage which don't know they
are polynomials so I guess all the computation would use the most
naive methods of computation and not utilize the heavily optimized
polynomial code. This would be rather sad.
However, if you want to make a decently usable calculus interface, I
think you will have to make some sacrifices of this nature.
--
Joel
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---