Solving equations over rings and $p$-adic $n$th roots in SAGE

456 Views Asked by At
  1. How do I specify that I want a polynomial to be thought of as having coefficients in a given ring $R$ in SAGE?

  2. Separately, if I give SAGE a polynomial, how do I have it solve that equation over a certain ring $R$?

  3. Is there a way to compute $n$th roots in the $p$-adic numbers of some given fixed $p$-adic number without using the answers to 1) and 2) above (i.e. without explicitly having SAGE solve an equation)? The ^(1/n) command does not seem to be working, for example, here (trying various primes in place of 7):

    R = Qp(2, prec = 10, type = 'capped-rel', print_mode = 'series')

    a = R(7)

    a^(1/3)

1

There are 1 best solutions below

0
On BEST ANSWER

For #1:

sage: R = Integers(10)
sage: R
Ring of integers modulo 10
sage: P.<x,y,z> = PolynomialRing(R)
sage: P
Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 10

For #2: it depends on the ring. If working in a polynomial ring with one variable, then f.roots() could work. Otherwise, try f.factor(). (I don't think either will work over $\mathbb{Z}/10\mathbb{Z}$, but they will work over $\mathbb{Z}/p\mathbb{Z}$ if $p$ is prime.)

For #3: try a.nth_root(3).