Listing elements of a finite ring.

26 zobrazení
Preskočiť na prvú neprečítanú správu

Gaurish Telang

neprečítané,
20. 11. 2022, 1:39:2720. 11. 2022
komu: sage-support
I am afraid I cannot seem to find the answer to the following question in the docs. 

Suppose I have finite ring? How do I list all its elements? e.g.

```
R = PolynomialRing(GF(97),'x')
x = R.gen()

p = lambda x: x^2+2
S = R.quotient(p(x), 'a')
```

I would like to list all the elements of the quotient ring S. Is there a function/method that allows listing elements of S?

 

Emmanuel Charpentier

neprečítané,
20. 11. 2022, 4:42:2920. 11. 2022
komu: sage-support

No predefined method, but listing S’s elements seems easy :

sage: R1.<t>=GF(97)[]
sage: p=lambda x:x^2+2
sage: S=R1.quotient(p(t),'a')
sage: L=[u for u in S]
sage: len(L)
9409

HTH,

Gaurish Telang

neprečítané,
20. 11. 2022, 11:54:2520. 11. 2022
komu: sage-s...@googlegroups.com
Oh wow! That was easy! 

Thanks so much! 
G

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/5288658d-8d36-454f-9f07-8a6cadf056edn%40googlegroups.com.

John H Palmieri

neprečítané,
20. 11. 2022, 16:57:3820. 11. 2022
komu: sage-support
You can also do `list(S)`, or depending on what you're doing it might be better to iterate over its elements, as Emmanuel wrote: `for u in S...`
Odpovedať všetkým
Odpovedať autorovi
Poslať ďalej
0 nových správ