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 = 3ZZp = 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'
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