How to use a string in a symbolic expression with SageMath?

asked 2019-12-05 14:56:25 +0200

JarenK gravatar image

I would like to use a string as part of a symbolic expression. For instance:

function('P') var('x1 x2 x3 y1 y2 y3')
st = eval('y1,0,1')
sum(P(x1,y1,y2,y3),st)

How could I use st which is a string in the symbolic expression sum?

I want the same result as if I had typed directly:

sum(P(x1,y1,y2,y3),y1,0,1)

edit retag flag offensive close merge delete