On 14 March 2015 at 22:55, david.guichard <[email protected]> wrote:
> I'm looking for a way to create a symbolic rational variable--it must be
> possible, right? I want to do something like this:
>
> R = PolynomialRing(QQ,'x');S.<a>=R.quotient(x^3+x+1);S1.<y> = S[];
> (y^3+y+1)(y=a);
> var('b1 b2 b3')
> (b1+b2*a+b3*a^2)^2
>
> and get
>
> (b2^2+2*b1*b3-b3^2)*a^2+(2*b1*b2-2*b2*b4*b3-b3^2)*a+b1^2-2*b2*b3
>
> barring typos.
>
> I get the error "TypeError: unsupported operand parent(s) for '*': 'Symbolic
> Ring' and 'Univariate Quotient Polynomial Ring in a over Rational Field with
> modulus x^3 + x + 1' "

Don't use the symbolic ring and var() variables, but define a
polynomial ring over your S with new variables:

sage: R = PolynomialRing(QQ,'x');S.<a>=R.quotient(x^3+x+1);
sage: T.<b1,b2,b3> = S[]
sage: (b1+b2*a+b3*a^2)^2
b1^2 + 2*a*b1*b2 + a^2*b2^2 + 2*a^2*b1*b3 + (-2*a - 2)*b2*b3 + (-a^2 - a)*b3^2


>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" 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 http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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 http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to