Ask Your Question
0

how to define Ring of gaussian integers modulo n?

asked 2020-01-20 22:36:40 +0200

ed gravatar image

updated 2020-01-21 22:07:13 +0200

vdelecroix gravatar image

how to define Ring of gaussian integers modulo n? modulo operation defined as :

def modGI(x,n): 
    import math
    E=(x*n.conjugate())/(n*n.conjugate())
    return x-complex(math.floor(E.real),math.floor(E.imag))*n
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-01-21 22:17:12 +0200

vdelecroix gravatar image

You can take quotient of general ring (including the Gaussian integers).

sage: G = ZZ[I]                                                                                                                                                                                                     
sage: J = G.ideal([3 * I + 5])                                                                                                                                                                                      
sage: Q = G.quotient(J, 'x')                                                                                                                                                                                        
sage: a = Q(I)
sage: (7*a + 5) * (13*a - 2)
-4*I

Which is not exactly what you get via your function

sage: modGI(complex(7*I + 5) * complex(13*I - 2), complex(3*I+5))                                                                                                                                                   
(2+4j)

But these are the same thing in the quotient

sage: sage: Q(2 + 4*I)                                                                                                                                                                                                    
-4*I
edit flag offensive delete link more

Comments

Thank you !

ed gravatar imageed ( 2020-01-25 18:24:55 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-01-20 22:36:40 +0200

Seen: 460 times

Last updated: Jan 21 '20