Reduction modulo p of Gaussian Integers

46 views
Skip to first unread message

Paweł Bogdan

unread,
Jan 31, 2021, 3:45:28 PM1/31/21
to sage-nt

Dear sage-nt group!

I'm working on some algorithm using the reduction modulo p of polynomial maps defined over Z. I'm just wondering if it is possible to implement something like that for Gaussian Integers (just like in thread: https://math.stackexchange.com/questions/2160330/about-ring-of-gaussian-integers-modulo-n) Is something like that implemented in Sage? How can I define such a structure?

Best regards
Paweł Bogdan

Julian Rüth

unread,
Jan 31, 2021, 6:21:29 PM1/31/21
to sag...@googlegroups.com
Dear Paweł,

* Paweł Bogdan <pawel....@gmail.com> [2021-01-31 12:45:28 -0800]:

> [...]
> Is something like that implemented in Sage? How can I define such a
> structure?

I am not sure I understood what you are trying to achieve exactly. But
if you are looking for a reduction map from the Gaussian Integers to a
residue field, the following might be more or less what you are trying
to do:

sage: Z.<I> = GaussianIntegers()
sage: R.<x> = Z[]
sage: p = 3
sage: red = R.hom(R.change_ring(Z.residue_field(prime=p)))
sage: g = R.random_element(); g
(-I - 7)*x^2 + x + 4*I - 7
sage: red(g)
(2*Ibar + 2)*x^2 + x + Ibar + 2
sage: p = Z.ideal(2).factor()[0][0]
sage: red = R.hom(R.change_ring(Z.residue_field(prime=p)))
sage: red(g)
x + 1

Is that what you had in mind?

julian

Paweł Bogdan

unread,
Feb 6, 2021, 4:10:12 PM2/6/21
to sage-nt
Dear Julien!

Yes, this is exactly what I meant. Thank you very much!

Best regards
Paweł
Reply all
Reply to author
Forward
0 new messages