On Fri, 7 Nov 2008 01:14:26 -0800 (PST)
Simon King <[EMAIL PROTECTED]> wrote:

> 
> Dear Team,
> 
> the impression that I got from this thread is the following:
> -------
> Commutative:
> 1. If f is a *commutative* polynomial in x,y,z,..., then everybody
> would at least correctly guess that f(1,2,3,...) has the intended
> meaning "evalutation of f at x=1, y=2, z=3,..."
> 2. Some people would actually *expect* (not just accept) that this
> meaning is intended.
> 
> =>
>    It is ok that multivariate polynomials in Sage are callable in the
> sense described above. Currently, symbolic variables commute with each
> other, and thus it is acceptable that they are callable as well.
> 
> Hence, no need to change!
> Do we agree on this?

I was already unhappy about symbolic expressions being callable, this
discussion convinced me that they shouldn't be.

One thing we should not forget is that, polynomials and symbolic
expressions in Sage are different things. I really appreciate
polynomials being callable, and I don't see the need to differentiate
polynomial functions and polynomials. 

Note that for polynomials, it is clear what to do when it is called.
There is an ordered list of variables that will be substituted. We
don't need to guess what the user intends.

Things are not so simple for symbolic expressions. I find the current
behavior confusing, and many people on sage-support seem to be confused
by the different ways of constructing functions in Sage. (i.e.,
python function definition, f(x) = ... syntax, just use a symbolic
expression)

I think the python function definition and f(x) = syntax are more than
enough, and we don't need to make symbolic expressions callable. 

The advantage of the f(x) syntax is that it gives a clear and ordered
list of variables to substitute for. One could say that this exists for
any symbolic expression, since we have an alphabetically ordered list of
variables, but then we have the following problem:

sage: var('x,y,a,b')
(x, y, a, b)
sage: f = a*x + b*y
sage: f(3,5)
5*y + 3*x

If I was trying to second guess what the user intended, I would expect
a and b to be constants, and x and y to be replaced. This is just
impossible to get right.

Keeping the "explicit is better than implicit" motto in mind, I think
this should change. This syntax is much better, IMHO.

sage: f(x,y) = a*x + b*y
sage: f(3,5)
5*b + 3*a

And I think this should raise an error:

sage: f(5)
b*y + 5*a


BTW, don't forget that we're going to have non-commutative symbolic
variables at some point.

> ---------
> Non-Commutative:
>   Several people gave evidence that calling a non-commutative
> polynomial should be different from the above. It makes sense to
> consider non-commutative multiplication as a functional composition
> (e.g., if differentials are involved). Therefore my suggestion: f(a,b)
> for non-commutative bivariate polynomial f should require that a and b
> are functions, and the nc-monomials in f give rise to functional
> compositions of a and b. However, this suggestion would only work if f
> is freely non-commutative.
> 
> =>
>   The people who are currently implementing non-commutative
> polynomials (Burcin, Michael B., William?) should speak up, what
> meaning they want to give to their __call__ methods.

I haven't thought about it at all. I am working towards a deadline
(next week), so I didn't have any time to cleaning that up to even
submit the initial version. 


Cheers,

Burcin


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to