Ask Your Question

Revision history [back]

It's a bit unclear what you want to achieve in general. But for the first part of your question, since https://trac.sagemath.org/ticket/23218 we have more general extensions of p-adic rings. So with Sage 8.4 you can do

sage: K.<a> = Zq(9)
sage: R.<x> = K[]
sage: L.<b> = K.extension(x^2 - 3)

In general you can create a ramified extension of an unramified extension, so if you can transform your field into this form, you can create the corresponding ring. I am not sure what you are trying to achieve in general, as of course, once you have it in this form, the question how the prime factors is trivial. Explicitly, you can then also do:

sage: L.ideal(3)
Principal ideal (b^2 + O(b^42)) of 3-adic Eisenstein Extension Ring in b defined by x^2 - 3 over its base ring

Number fields probably provide the most convenient path to currently answer this question, if you're only looking at small examples where performance does not matter:

sage: R.<x> = QQ[]
sage: K.<a> = NumberField(x^2 - 2)
sage: L.<b> = K.extension(x^2 - 3)
sage: L.ideal(3).factor()
(Fractional ideal (b))^2

If you don't mind the language of valuations, you could try with the following which might avoid some expensive calls:

sage: QQ.valuation(3).extensions(L)
[3-adic valuation]
sage: v = _[0]
sage: v.value_group()
Additive Abelian Group generated by 1/2

Finally, there is also the henselization package which allows you to work with Henselizations instead of $Q_p$ which you can also use to compute such factorizations:

sage: from henselization import *
sage: K = QQ.henselization(3)
sage: R.<x> = K[]
sage: L.<a> = K.extension(x^2 - 3)
sage: R.<x> = L[]
sage: M.<b> = L.extension(x^2 - 2)
sage: v = M.valuation()
sage: v.value_group()
Additive Abelian Group generated by 1/2