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/iterating over quotient ring and polynomial ringhttps://ask.sagemath.org/question/38324/iterating-over-quotient-ring-and-polynomial-ring/Hello
I have been studied some finite algebraic structure as follows:
P.<v> = PolynomialRing(GF(2))
R.<v> = P.quotient((v^2-v))
T.<x> = PolynomialRing(R)
R is a quotient ring with elements : 0,1,v,1+v.
I want to list all of the polynomials with degree 2. So I write:
for r in T.polynomials(of_degree=2): r
but the error is "object does not support iteration".
And also the same problem arises when I want to list the elements of R.
Is there any solution to this problem?
How can I iterate over this structure?
thank youtugbaWed, 19 Jul 2017 13:12:25 +0200https://ask.sagemath.org/question/38324/