Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

simplify_full() and symbolic vectors

First, the question:

Suppose I've constructed some vectors with symbolic entries, call them P0 and P1. Calling simplify_full on them will -- apparently by changes introduced in the latest version (#11335 and #11381)! -- do an elementwise simplification. Great!

Suppose I construct a new symbolic vector by, say, interpolating between P0 and P1:

Pt = (1-t)*P0 + t*P1

Now

Pt.simplify_full()

produces

Traceback (click to the left of this block for traceback)
...
AttributeError:
'sage.modules.free_module_element.FreeModuleElement_generic_dense'
object has no attribute 'simplify_full'

whereas

P0.simplify_full()

and

P1.simplify_full()

work just fine. Somehow the symbolic vector-ness is forgotten in the construction of Pt.

Am I doing something wrong?

Then, the disclaimer:

A friend pointed me to Sage today, and this is the first thing I'm trying to do with it -- I do have background in some other symbolic tools, but this may just be a Stupid User Error despite giving this my best shot and looking at documentation.

Anyway, I'm very impressed with what I'm seeing when I look at Sage.

(For completeness' sake, here's a full example:

var('x,w,C0,C1,t')
P0=vector([0, C1*w/(C1*w+C0) - w/(w+C0/C1)])
P1=vector([cos(x)/sin(x)*tan(x)-1, 0])

Now both

P0.simplify_full()
P1.simplify_full()

return (0,0) as they should. But

Pt=(1-t)*P0+t*P1

returns the above error.)

simplify_full() and symbolic vectors

First, the question:

Suppose I've constructed some vectors with symbolic entries, call them P0 and P1. Calling simplify_full on them will -- apparently by changes introduced in the latest version (#11335 and #11381)! -- do an elementwise simplification. Great!

Suppose I construct a new symbolic vector by, say, interpolating between P0 and P1:

Pt = (1-t)*P0 + t*P1

Now

Pt.simplify_full()

produces

Traceback (click to the left of this block for traceback)
...
AttributeError:
'sage.modules.free_module_element.FreeModuleElement_generic_dense'
object has no attribute 'simplify_full'

whereas

P0.simplify_full()

and

P1.simplify_full()

work just fine. Somehow the symbolic vector-ness is forgotten in the construction of Pt.

Am I doing something wrong?

Then, the disclaimer:

A friend pointed me to Sage today, and this is the first thing I'm trying to do with it -- I do have background in some other symbolic tools, but this may just be a Stupid User Error despite giving this my best shot and looking at documentation.

Anyway, I'm very impressed with what I'm seeing when I look at Sage.

(For completeness' sake, here's a full example:

var('x,w,C0,C1,t')
P0=vector([0, C1*w/(C1*w+C0) - w/(w+C0/C1)])
P1=vector([cos(x)/sin(x)*tan(x)-1, 0])

Now both

P0.simplify_full()
P1.simplify_full()

return (0,0) as they should. But

Pt=(1-t)*P0+t*P1
Pt.simplify_full()

returns the above error.)