Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Coercion and Laurent polynomial

Hi! Is there a simple way to make easy coercion from Symbolic Ring to Laurent polynomial ring (or even algebraic extension)? I've only been able to bypass the problem by the following trick (and due the amount of time I've spent on this I'm happy to share it!) :

# Polynomial in the Symbolic Ring
var('t')
P = t^3 + 1/10*t + 3*t^-1

# Laurent polynomial     
ringS.<t> = LaurentPolynomialRing(QQ)  

#PP = ringS(P)  # Not working
PP = ringS(sage_eval(str(P),locals={'t':t}))

print P, P.parent()
print PP, PP.parent()