Ask Your Question

Revision history [back]

Extension field over p-adics: how to write an element in the standard basis?

Suppose we have an extension field $\mathbb{Q}_2(w)$, where $w$ is a root of $f(x) = x^3 + 4x^2 + 2$. By default, Sage represents $w^3$ as $w^3 + O(w^d)$, where $d$ is the precision. How do I get Sage to print $w^3$ out as a linear combination of the standard basis, i.e., as $-4w^2 - 2$ (with -4 and -2 written as they would be in $\mathbb{Q}_2$)?