multiplication_table() of Zmod(p)

asked 2024-05-25 13:10:41 +0200

dantetante gravatar image

I want to print multiplication tables of Z_n (for n prime but this is irrelevant for my needs at the moment). When I try e.g. Zmod(5).multiplication_table(names='digits') I get

(asterisk) 0 1 2 3

+--------

0| 0 1 2 3

1| 1 2 3 0

2| 2 3 0 1

3| 3 0 1 2

what is not really what I want, I want the canonical representants. If I don't use the names-key, I get letters. How can I get 1, 2, 3, 4, or even better -2, -1, 1, 2?

edit retag flag offensive close merge delete

Comments

1

What Sage are you using ? in 10.4.beta6, I get :

sage: Zmod(5).multiplication_table(names='digits')
*  0 1 2 3 4
 +----------
0| 0 0 0 0 0
1| 0 1 2 3 4
2| 0 2 4 1 3
3| 0 3 1 4 2
4| 0 4 3 2 1

Your system seems to give you a (seriously mangled) version of the addition table :

sage: Zmod(5).addition_table(names='digits')
+  0 1 2 3 4
 +----------
0| 0 1 2 3 4
1| 1 2 3 4 0
2| 2 3 4 0 1
3| 3 4 0 1 2
4| 4 0 1 2 3
Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-05-25 17:28:55 +0200 )edit