Quotients and quo_rem method on p-adic elements

14 views
Skip to first unread message

Hayden Stainsby

unread,
Jan 21, 2014, 3:50:17 AM1/21/14
to sage-...@googlegroups.com
Hi,

I'm porting some code from magma, and need to create a polynomial ring over a quotient of a p-adic ring. I can create the quotient fine, but its functionality seems to be limited by the fact that the p-adic element classes don't implement quo_rem. For instance, the random_element method appears to depend on this, as does the creation of a polynomial ring over the quotient. In fact, I can't even caste an element into the quotient.

The minimum code to produce the error (on Sage 6.0) is the following:

p = 3
ZZp = Zp(p)
pi = ZZp.uniformizer()
ZZq = ZZp.quotient(pi^6, 'a')
ZZqx.<x> = PolynomialRing(ZZq)

Which gives the error:
AttributeError: 'sage.rings.padics.padic_capped_relative_element.pAdicCappedRelativeElement' object has no attribute 'quo_rem'

The error occurs in sage/rings/ideal.py:1344 in reduce(self, f). Full traceback here: http://pastebin.com/b2PBsnxf.

In order to see whether anything else was stopping this from working, I stuck a naïve implementation of quo_rem onto the pAdicCappedRelativeElement class sage/rings/padics/padic_capped_relative_element.pyx.

This solved the problem, in that I no longer get the AttributeError and the quotient appears to work correctly.

So, my question is, is this a valid solution? Is there something that I'm missing or would a correct implementation of quo_rem for the p-adic element classes correct this problem in general? I checked all the "padics" component issues on trac and couldn't find any reference to this.

Thanks for the help,

Hayden
Reply all
Reply to author
Forward
0 new messages