ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 02 Dec 2022 14:30:40 +0100Iterate over Elements of Finite Quotient (of a Polynomial Ring)https://ask.sagemath.org/question/65155/iterate-over-elements-of-finite-quotient-of-a-polynomial-ring/Consider the following, which works:
sage: R.<x> = Integers(4)[]
sage: Q.<a> = R.quotient(x^2)
sage: for q in Q:
....: q
....:
0
1
2
3
a
a + 1
a + 2
a + 3
2*a
2*a + 1
2*a + 2
2*a + 3
3*a
3*a + 1
3*a + 2
3*a + 3
Now if I add a generator to the ideal and execute
sage: Q.<a> = R.quotient((x^2,2*x))
sage: for q in Q:
....: q
....:
which should yield a quotient with 8 elements, I get an error:
NotImplementedError: object does not support iteration
How can I make it work? Sage doesn't seem to be able to deal with finite rings that aren't principal ideal rings.ThrashFri, 02 Dec 2022 14:30:40 +0100https://ask.sagemath.org/question/65155/