Ask Your Question

Revision history [back]

large finite fields with modulus='primitive' do not satisfy equality

I found the following discrepancy

>>> q=2**152; GF(q) == GF(q), GF(q,'a',modulus='primitive') == GF(q,'a',modulus='primitive')
(True, False)
>>> q=2**151; GF(q) == GF(q), GF(q,'a',modulus='primitive') == GF(q,'a',modulus='primitive')
(True, True)

Is this intentional? and if yes why? It seems to happen within the same library:

>>> type(GF(2**152))
<class 'sage.rings.finite_rings.finite_field_ntl_gf2e.FiniteField_ntl_gf2e_with_category'>
>>> type(GF(2**151))
<class 'sage.rings.finite_rings.finite_field_ntl_gf2e.FiniteField_ntl_gf2e_with_category'>

(tested on SageMath version 9.0, Release Date: 2020-01-01 on Kubuntu 20.04 and SageMath version 9.2, Release Date: 2020-10-24 on Arch linux with kernel 5.11.2-arch1-1)