1 | initial version |
Because 251 is prime, Sage choose a different implementation for GF(13^2)
and GF(251)
, see:
sage: 251 in Primes()
True
sage: type(GF(13^2))
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
sage: type(GF(251))
<class 'sage.rings.finite_rings.finite_field_prime_modn.FiniteField_prime_modn_with_category'>
As you can see, the field GF(13^2)
is handled by givaro. If you look to the documentation of the GF
constructor:
sage: GF?
you can see that you can chose the implementation yourself instead of relying to Sage best guess. Hence you can construct the field GF(251)
using the givaro backend, which provides the fetch_int
method:
sage: F.<x> = GF(251^2, impl='givaro')
sage: a=F.fetch_int(37)+F.fetch_int(41)
sage: m=F.fetch_int(37)*F.fetch_int(41)
sage: ai=a.integer_representation()
sage: mi=m.integer_representation()
sage: ai,mi
(78, 11)
2 | No.2 Revision |
Because 251 is prime, Sage choose a different implementation for GF(13^2)
and GF(251)
, see:
sage: 251 in Primes()
True
sage: type(GF(13^2))
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
sage: type(GF(251))
<class 'sage.rings.finite_rings.finite_field_prime_modn.FiniteField_prime_modn_with_category'>
As you can see, the field GF(13^2)
is handled by givaro. If you look to the documentation of the GF
constructor:
sage: GF?
you can see that you can chose the implementation yourself instead of relying to Sage best guess. Hence you can construct the field GF(251)
using the givaro backend, which provides the fetch_int
method:
sage: F.<x> = GF(251^2, impl='givaro')
sage: a=F.fetch_int(37)+F.fetch_int(41)
sage: m=F.fetch_int(37)*F.fetch_int(41)
sage: ai=a.integer_representation()
sage: mi=m.integer_representation()
sage: ai,mi
(78, 11)
By the way, Var('x')
is if no use here, since F.<x> =
defines both F
and x
.
3 | No.3 Revision |
Because 251 is prime, Sage choose a different implementation for GF(13^2)
and GF(251)
, see:
sage: 251 in Primes()
True
sage: type(GF(13^2))
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
sage: type(GF(251))
<class 'sage.rings.finite_rings.finite_field_prime_modn.FiniteField_prime_modn_with_category'>
As you can see, the field GF(13^2)
is handled by givaro. If you look to the documentation of the GF
constructor:
sage: GF?
you can see that you can chose the implementation yourself instead of relying to Sage best guess. Hence you can construct the field GF(251)
using the givaro backend, which provides the fetch_int
method:
sage: F.<x> = GF(251^2, impl='givaro')
sage: a=F.fetch_int(37)+F.fetch_int(41)
sage: m=F.fetch_int(37)*F.fetch_int(41)
sage: ai=a.integer_representation()
sage: mi=m.integer_representation()
sage: ai,mi
(78, 11)
By the way, Var('x')
is if no use here, since F.<x> =
defines both F
and x
. (and the var
function name is lowercase).