Ask Your Question

Revision history [back]

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