Ask Your Question

Paco Braxe's profile - activity

2018-03-30 13:08:38 +0200 received badge  Famous Question (source)
2017-04-07 23:17:58 +0200 received badge  Notable Question (source)
2016-07-06 05:29:06 +0200 received badge  Popular Question (source)
2015-03-09 14:37:46 +0200 received badge  Student (source)
2015-03-08 20:09:53 +0200 received badge  Scholar (source)
2015-03-08 20:09:49 +0200 commented answer Evaluating symbolic expressions

Thank you tmonteil. You are my hero!

2015-03-08 19:53:13 +0200 asked a question Evaluating symbolic expressions

Hi all,

I have to evaluate in Sage a symbolic expression and, by some constrains of my problem, I have to use a dictionary to do so. Everything goes smooth with symbolic expressions like the following:

var('x,y')
h = x^3+y^3 
type(h) #returns sage.symbolic.expression.Expression 
h({x:0,y:1}) #returns 1

But, when I use a symbolic expression defined with arguments, it fails:

g(x,y) = x^3+y^3 
type(g) #returns also sage.symbolic.expression.Expression 
g({x:0,y:1})

And returns "TypeError: no canonical coercion from <type 'dict'=""> to Callable function ring with arguments (x, y)"

Since both expressions are "sage.symbolic.expression.Expression", why does that occur? Any help would be appreciated.