On Apr 1, 11:08 pm, dstahlke <dstah...@gmail.com> wrote:
> Given tables defining the addition and multiplication operations for a
> finite ring, is there a way to construct such a Ring() in Sage?
>
> For example:
>
> add_tab = Matrix([
>     [0, 1, 2, 3],
>     [1, 0, 3, 2],
>     [2, 3, 0, 1],
>     [3, 2, 1, 0],
> ])
>
> mul_tab = Matrix([
>     [0, 0, 0, 0],
>     [0, 0, 0, 0],
>     [0, 0, 1, 1],
>     [0, 0, 1, 1],
> ])

Not directly, I do not believe so.  We have lots and lots of finite
rings (and fields) and their tables.


sage: M = MatrixSpace(Integers(6),1,1)
sage: M.multiplication_table()
*  a b c d e f
 +------------
a| a a a a a a
b| a b c d e f
c| a c e a c e
d| a d a d a d
e| a e c a e c
f| a f e d c b


sage: M = MatrixSpace(Integers(2),2,2)
sage: M.multiplication_table()
*  a b c d e f g h i j k l m n o p
 +--------------------------------
a| a a a a a a a a a a a a a a a a
b| a b c a a f b b c c a f f b c f
c| a a a b c a b c b c f b c f f f
d| a d e a a k d d e e a k k d e k
e| a a a d e a d e d e k d e k k k
f| a b c b c f a f f a f c b c b a
g| a g j a a p g g j j a p p g j p
h| a b c d e f g h i j k l m n o p
i| a d e b c k g i h j f n o l m p
j| a a a g j a g j g j p g j p p p
k| a d e d e k a k k a k e d e d a
l| a g j b c p d l m e f o n i h k
m| a b c g j f d m l e p i h o n k
n| a g j d e p b n o c k m l h i f
o| a d e g j k b o n c p h i m l f
p| a g j g j p a p p a p j g j g a

which is perhaps less helpful than it could be...


sage: T = M.multiplication_table()
sage: T.row_keys()
(
[0 0]  [1 0]  [0 1]  [0 0]  [0 0]  [1 1]  [1 0]  [1 0]  [0 1]  [0 1]
[0 0], [0 0], [0 0], [1 0], [0 1], [0 0], [1 0], [0 1], [1 0], [0 1],

[0 0]  [1 1]  [1 1]  [1 0]  [0 1]  [1 1]
[1 1], [1 0], [0 1], [1 1], [1 1], [1 1]
)

There's something in the documentation about a list() method on T, but
I don't see it.

But anyway, I don't see a way to go backwards.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to