Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Symbolic arithmetic in a number field

How to prevent expanding the value of the generating element in symbolic expressions?

E.<w> = CyclotomicField(3)
w^4 # shows w
(w+1)^2 # shows w
a = var('a')
(w + a)^2 # shows an expression with w expanded as a complex number

How can I make the last expression show up as w2+2aw+a2?

Symbolic arithmetic in a number field

How to prevent expanding the value of the generating element in symbolic expressions?

E.<w> = CyclotomicField(3)
w^4 # shows w
(w+1)^2 # shows w
a = var('a')
(w + a)^2 # shows an expression with w expanded as a complex number

How can I make the last expression show up as w2+2aw+a2?

My use case is to expand (a+bw+cw2)3 so that the result is expressed as a rational (or integer) combination of 1, w, w^2.