73
73
74
74
::
75
75
76
- sage: k = GF(5^2,'c'); type(k)
76
+ sage: k = GF(5^2,'c'); type(k) # needs sage.libs.linbox
77
77
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
78
78
79
79
One can also give the cardinality `q=p^n` as the tuple `(p,n)`::
83
83
84
84
::
85
85
86
- sage: k = GF(2^16,'c'); type(k)
86
+ sage: k = GF(2^16,'c'); type(k) # needs sage.libs.ntl
87
87
<class 'sage.rings.finite_rings.finite_field_ntl_gf2e.FiniteField_ntl_gf2e_with_category'>
88
88
89
89
::
125
125
126
126
::
127
127
128
- sage: k = GF(9,'alpha'); type(k)
128
+ sage: k = GF(9,'alpha'); type(k) # needs sage.libs.linbox
129
129
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
130
- sage: k.base_ring()
130
+ sage: k.base_ring() # needs sage.libs.linbox
131
131
Finite Field of size 3
132
132
133
133
::
@@ -508,12 +508,12 @@ def create_key_and_extra_args(self, order, name=None, modulus=None, names=None,
508
508
"""
509
509
EXAMPLES::
510
510
511
- sage: GF.create_key_and_extra_args(9, 'a')
511
+ sage: GF.create_key_and_extra_args(9, 'a') # needs sage.libs.linbox
512
512
((9, ('a',), x^2 + 2*x + 2, 'givaro', 3, 2, True, None, 'poly', True, True, True), {})
513
513
514
514
The order `q` can also be given as a pair `(p,n)`::
515
515
516
- sage: GF.create_key_and_extra_args((3, 2), 'a')
516
+ sage: GF.create_key_and_extra_args((3, 2), 'a') # needs sage.libs.linbox
517
517
((9, ('a',), x^2 + 2*x + 2, 'givaro', 3, 2, True, None, 'poly', True, True, True), {})
518
518
519
519
We do not take invalid keyword arguments and raise a value error
@@ -527,28 +527,28 @@ def create_key_and_extra_args(self, order, name=None, modulus=None, names=None,
527
527
Moreover, ``repr`` and ``elem_cache`` are ignored when not
528
528
using givaro::
529
529
530
- sage: GF.create_key_and_extra_args(16, 'a', impl='ntl', repr='poly')
530
+ sage: GF.create_key_and_extra_args(16, 'a', impl='ntl', repr='poly') # needs sage.libs.ntl
531
531
((16, ('a',), x^4 + x + 1, 'ntl', 2, 4, True, None, None, None, True, True), {})
532
- sage: GF.create_key_and_extra_args(16, 'a', impl='ntl', elem_cache=False)
532
+ sage: GF.create_key_and_extra_args(16, 'a', impl='ntl', elem_cache=False) # needs sage.libs.ntl
533
533
((16, ('a',), x^4 + x + 1, 'ntl', 2, 4, True, None, None, None, True, True), {})
534
- sage: GF(16, impl='ntl') is GF(16, impl='ntl', repr='foo')
534
+ sage: GF(16, impl='ntl') is GF(16, impl='ntl', repr='foo') # needs sage.libs.ntl
535
535
True
536
536
537
537
We handle extra arguments for the givaro finite field and
538
538
create unique objects for their defaults::
539
539
540
- sage: GF(25, impl='givaro') is GF(25, impl='givaro', repr='poly')
540
+ sage: GF(25, impl='givaro') is GF(25, impl='givaro', repr='poly') # needs sage.libs.linbox
541
541
True
542
- sage: GF(25, impl='givaro') is GF(25, impl='givaro', elem_cache=True)
542
+ sage: GF(25, impl='givaro') is GF(25, impl='givaro', elem_cache=True) # needs sage.libs.linbox
543
543
True
544
- sage: GF(625, impl='givaro') is GF(625, impl='givaro', elem_cache=False)
544
+ sage: GF(625, impl='givaro') is GF(625, impl='givaro', elem_cache=False) # needs sage.libs.linbox
545
545
True
546
546
547
547
We explicitly take ``structure``, ``implementation`` and ``prec`` attributes
548
548
for compatibility with :class:`~sage.categories.pushout.AlgebraicExtensionFunctor`
549
549
but we ignore them as they are not used, see :trac:`21433`::
550
550
551
- sage: GF.create_key_and_extra_args(9, 'a', structure=None)
551
+ sage: GF.create_key_and_extra_args(9, 'a', structure=None) # needs sage.libs.linbox
552
552
((9, ('a',), x^2 + 2*x + 2, 'givaro', 3, 2, True, None, 'poly', True, True, True), {})
553
553
554
554
TESTS::
@@ -684,8 +684,8 @@ def create_object(self, version, key, **kwds):
684
684
We try to create finite fields with various implementations::
685
685
686
686
sage: k = GF(2, impl='modn')
687
- sage: k = GF(2, impl='givaro')
688
- sage: k = GF(2, impl='ntl')
687
+ sage: k = GF(2, impl='givaro') # needs sage.libs.linbox
688
+ sage: k = GF(2, impl='ntl') # needs sage.libs.ntl
689
689
sage: k = GF(2, impl='pari')
690
690
Traceback (most recent call last):
691
691
...
@@ -698,18 +698,18 @@ def create_object(self, version, key, **kwds):
698
698
Traceback (most recent call last):
699
699
...
700
700
ValueError: the 'modn' implementation requires a prime order
701
- sage: k.<a> = GF(2^15, impl='givaro')
702
- sage: k.<a> = GF(2^15, impl='ntl')
701
+ sage: k.<a> = GF(2^15, impl='givaro') # needs sage.libs.linbox
702
+ sage: k.<a> = GF(2^15, impl='ntl') # needs sage.libs.ntl
703
703
sage: k.<a> = GF(2^15, impl='pari')
704
704
sage: k.<a> = GF(3^60, impl='modn')
705
705
Traceback (most recent call last):
706
706
...
707
707
ValueError: the 'modn' implementation requires a prime order
708
- sage: k.<a> = GF(3^60, impl='givaro')
708
+ sage: k.<a> = GF(3^60, impl='givaro') # needs sage.libs.linbox
709
709
Traceback (most recent call last):
710
710
...
711
711
ValueError: q must be < 2^16
712
- sage: k.<a> = GF(3^60, impl='ntl')
712
+ sage: k.<a> = GF(3^60, impl='ntl') # needs sage.libs.ntl
713
713
Traceback (most recent call last):
714
714
...
715
715
ValueError: q must be a 2-power
0 commit comments