On Sunday, March 13, 2016 at 8:08:51 AM UTC-7, Eric Gourgoulhon wrote:
>
>
> Is this a known issue? Shall I open a ticket for it?
>
> I think it's known, but difficult to solve. Consider this:

sage: f1=function('f')
sage: f2=function('f')
sage: f3=function('f',latex_name='F')
sage: f1(x).operator() is f2(x).operator()
True
sage: f1(x).operator() is f3(x).operator()
False
sage: f2,f3
(f, f)

This illustrates what happens internally. As you can see, we end up with 
two functions, with different latex_names (this should apply to other 
attributes too), but they cannot be distinguished from their print names.

When they go through maxima, we cannot distinguish them anymore:

sage: [maxima_calculus(f) for f in [f1,f2,f3]]
[f, f, f]

For symbolics we have a similar problem but a different decision is made 
(things are already squashed in the symbolic ring):

sage: a1=SR.symbol('a')
sage: a2=SR.symbol('a',latex_name='A')
sage: a1 is a2
True
sage: latex(a1) #note that a1 changed as a side-effect of defining a2
A
sage: [maxima_calculus(a) for a in [a1,a2]]
[_SAGE_VAR_a, _SAGE_VAR_a]
sage: [latex(SR(maxima_calculus(a))) for a in [a1,a2]]
[A, A]

As you can see, symbols already get translated to maxima with extra 
information in their name: we prepend `_SAGE_VAR_`. We could extend that 
further by adding other useful(?) information to the name, or store it in 
properties on the symbol.

We could do the same thing with functions: we could translate their arity 
(this is now lost, but isn't used anyway) into the symbol representing them 
on the maxima side. In the process it might be nice to make the 
representing sage objects a little more representative of the underlying 
pynac objects too. Currently:

 sage: function('f') is function('f')
False
sage: function('f')(x).operator() is function('f')(x).operator()
True


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to