Ask Your Question
0

how to define Ring of gaussian integers modulo n?

asked 2020-01-20 15:36:40 -0500

ed gravatar image

updated 2020-01-21 15:07:13 -0500

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 15:17:12 -0500

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 11:24:55 -0500 )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 15:36:40 -0500

Seen: 22 times

Last updated: Jan 21