1
+ # sage.doctest: optional - sage.rings.finite_rings
1
2
"""
2
3
Finite field morphisms
3
4
@@ -13,8 +14,8 @@ EXAMPLES::
13
14
14
15
Construction of an embedding::
15
16
16
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
17
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
17
+ sage: k.<t> = GF(3^7)
18
+ sage: K.<T> = GF(3^21)
18
19
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K)); f
19
20
Ring morphism:
20
21
From: Finite Field in t of size 3^7
@@ -44,8 +45,8 @@ map which is the inverse of `f` on the image of `f`::
44
45
45
46
There is no embedding of `GF(5^6)` into `GF(5^11)`::
46
47
47
- sage: k.<t> = GF(5^6) # optional - sage.rings.finite_rings
48
- sage: K.<T> = GF(5^11) # optional - sage.rings.finite_rings
48
+ sage: k.<t> = GF(5^6)
49
+ sage: K.<T> = GF(5^11)
49
50
sage: FiniteFieldHomomorphism_generic(Hom(k, K))
50
51
Traceback (most recent call last):
51
52
...
@@ -54,7 +55,7 @@ There is no embedding of `GF(5^6)` into `GF(5^11)`::
54
55
55
56
Construction of Frobenius endomorphisms::
56
57
57
- sage: k.<t> = GF(7^14) # optional - sage.rings.finite_rings
58
+ sage: k.<t> = GF(7^14)
58
59
sage: Frob = k.frobenius_endomorphism(); Frob
59
60
Frobenius endomorphism t |--> t^7 on Finite Field in t of size 7^14
60
61
sage: Frob(t)
@@ -125,8 +126,8 @@ cdef class SectionFiniteFieldHomomorphism_generic(Section):
125
126
TESTS::
126
127
127
128
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
128
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
129
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
129
+ sage: k.<t> = GF(3^7)
130
+ sage: K.<T> = GF(3^21)
130
131
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
131
132
sage: g = f.section()
132
133
sage: g(f(t^3+t^2+1))
@@ -153,8 +154,8 @@ cdef class SectionFiniteFieldHomomorphism_generic(Section):
153
154
EXAMPLES::
154
155
155
156
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
156
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
157
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
157
+ sage: k.<t> = GF(3^7)
158
+ sage: K.<T> = GF(3^21)
158
159
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
159
160
sage: g = f.section()
160
161
sage: g._repr_()
@@ -170,8 +171,8 @@ cdef class SectionFiniteFieldHomomorphism_generic(Section):
170
171
EXAMPLES::
171
172
172
173
sage: from sage. rings. finite_rings. hom_finite_field import FiniteFieldHomomorphism_generic
173
- sage: k. <t> = GF( 3^ 7) # optional - sage . rings . finite_rings
174
- sage: K. <T> = GF( 3^ 21) # optional - sage . rings . finite_rings
174
+ sage: k. <t> = GF( 3^ 7)
175
+ sage: K. <T> = GF( 3^ 21)
175
176
sage: f = FiniteFieldHomomorphism_generic( Hom( k, K))
176
177
sage: g = f. section( )
177
178
sage: g. _latex_( )
@@ -188,8 +189,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
188
189
TESTS::
189
190
190
191
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
191
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
192
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
192
+ sage: k.<t> = GF(3^7)
193
+ sage: K.<T> = GF(3^21)
193
194
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
194
195
sage: TestSuite(f).run()
195
196
@@ -199,16 +200,16 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
199
200
TESTS::
200
201
201
202
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
202
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
203
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
203
+ sage: k.<t> = GF(3^7)
204
+ sage: K.<T> = GF(3^21)
204
205
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K)); f
205
206
Ring morphism:
206
207
From: Finite Field in t of size 3^7
207
208
To: Finite Field in T of size 3^21
208
209
Defn: t |--> T^20 + 2*T^18 + T^16 + 2*T^13 + T^9 + 2*T^8 + T^7 + T^6 + T^5 + T^3 + 2*T^2 + T
209
210
210
- sage: k.<t> = GF(3^6) # optional - sage.rings.finite_rings
211
- sage: K.<t> = GF(3^9) # optional - sage.rings.finite_rings
211
+ sage: k.<t> = GF(3^6)
212
+ sage: K.<t> = GF(3^9)
212
213
sage: FiniteFieldHomomorphism_generic(Hom(k, K))
213
214
Traceback (most recent call last):
214
215
...
@@ -249,8 +250,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
249
250
TESTS::
250
251
251
252
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
252
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
253
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
253
+ sage: k.<t> = GF(3^7)
254
+ sage: K.<T> = GF(3^21)
254
255
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
255
256
sage: g = copy(f)
256
257
sage: g.section()(g(t)) == f.section()(f(t))
@@ -282,8 +283,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
282
283
EXAMPLES::
283
284
284
285
sage: from sage. rings. finite_rings. hom_finite_field import FiniteFieldHomomorphism_generic
285
- sage: k. <t> = GF( 3^ 7) # optional - sage . rings . finite_rings
286
- sage: K. <T> = GF( 3^ 21) # optional - sage . rings . finite_rings
286
+ sage: k. <t> = GF( 3^ 7)
287
+ sage: K. <T> = GF( 3^ 21)
287
288
sage: f = FiniteFieldHomomorphism_generic( Hom( k, K))
288
289
sage: f. _latex_( )
289
290
'\\ Bold{F}_{3^ {7} } \\ hookrightarrow \\ Bold{F}_{3^ {21} }'
@@ -295,8 +296,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
295
296
TESTS::
296
297
297
298
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
298
- sage: k.<t> = GF(3^3) # optional - sage.rings.finite_rings
299
- sage: K.<T> = GF(3^9) # optional - sage.rings.finite_rings
299
+ sage: k.<t> = GF(3^3)
300
+ sage: K.<T> = GF(3^9)
300
301
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
301
302
sage: f(t)
302
303
2*T^6 + 2*T^4 + T^2 + T
@@ -323,8 +324,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
323
324
EXAMPLES::
324
325
325
326
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
326
- sage: k.<t> = GF(3^3) # optional - sage.rings.finite_rings
327
- sage: K.<T> = GF(3^9) # optional - sage.rings.finite_rings
327
+ sage: k.<t> = GF(3^3)
328
+ sage: K.<T> = GF(3^9)
328
329
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
329
330
sage: f.is_injective()
330
331
True
@@ -340,8 +341,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
340
341
EXAMPLES::
341
342
342
343
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
343
- sage: k.<t> = GF(3^3) # optional - sage.rings.finite_rings
344
- sage: K.<T> = GF(3^9) # optional - sage.rings.finite_rings
344
+ sage: k.<t> = GF(3^3)
345
+ sage: K.<T> = GF(3^9)
345
346
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
346
347
sage: f.is_surjective()
347
348
False
@@ -364,8 +365,8 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
364
365
EXAMPLES::
365
366
366
367
sage: from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic
367
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
368
- sage: K.<T> = GF(3^21) # optional - sage.rings.finite_rings
368
+ sage: k.<t> = GF(3^7)
369
+ sage: K.<T> = GF(3^21)
369
370
sage: f = FiniteFieldHomomorphism_generic(Hom(k, K))
370
371
sage: g = f.section(); g
371
372
Section of Ring morphism:
@@ -395,7 +396,7 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
395
396
396
397
EXAMPLES::
397
398
398
- sage: k.<t> = GF(3^7) # optional - sage.rings.finite_rings
399
+ sage: k.<t> = GF(3^7)
399
400
sage: K.<T>, f = k.extension(3, map=True)
400
401
sage: b = f(t^2); b
401
402
2*T^20 + 2*T^19 + T^18 + T^15 + 2*T^14 + 2*T^13 + 2*T^12 + T^8 + 2*T^6 + T^5 + 2*T^4 + T^3 + 2*T^2 + T
@@ -417,7 +418,7 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
417
418
418
419
TESTS::
419
420
420
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
421
+ sage: k. <t> = GF( 5^ 3)
421
422
sage: Frob = k. frobenius_endomorphism( )
422
423
sage: embed = Frob. fixed_field( ) [1 ]
423
424
sage: hash( embed) # random
@@ -431,7 +432,7 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
431
432
432
433
TESTS::
433
434
434
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
435
+ sage: k. <t> = GF( 5^ 3)
435
436
sage: Frob = k. frobenius_endomorphism( )
436
437
sage: embed = Frob. fixed_field( ) [1 ]
437
438
sage: embed. __reduce__( ) # indirect doctest
@@ -459,7 +460,7 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
459
460
460
461
TESTS::
461
462
462
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
463
+ sage: k. <t> = GF( 5^ 3)
463
464
sage: Frob = k. frobenius_endomorphism( )
464
465
sage: embed = Frob. fixed_field( ) [1 ]
465
466
sage: f = loads( dumps( embed))
@@ -481,7 +482,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
481
482
482
483
TESTS::
483
484
484
- sage: k.<a> = GF(7^11) # optional - sage.rings.finite_rings
485
+ sage: k.<a> = GF(7^11)
485
486
sage: Frob = k.frobenius_endomorphism(5)
486
487
sage: TestSuite(Frob).run()
487
488
@@ -506,7 +507,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
506
507
TESTS::
507
508
508
509
sage: from sage.rings.finite_rings.hom_finite_field import FrobeniusEndomorphism_finite_field
509
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
510
+ sage: k.<t> = GF(5^3)
510
511
sage: FrobeniusEndomorphism_finite_field(k)
511
512
Frobenius endomorphism t |--> t^5 on Finite Field in t of size 5^3
512
513
sage: FrobeniusEndomorphism_finite_field(k, 2)
@@ -543,7 +544,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
543
544
544
545
EXAMPLES::
545
546
546
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
547
+ sage: k.<t> = GF(5^3)
547
548
sage: Frob = k.frobenius_endomorphism(); Frob
548
549
Frobenius endomorphism t |--> t^5 on Finite Field in t of size 5^3
549
550
@@ -567,7 +568,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
567
568
568
569
EXAMPLES::
569
570
570
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
571
+ sage: k.<t> = GF(5^3)
571
572
sage: Frob = k.frobenius_endomorphism(); Frob
572
573
Frobenius endomorphism t |--> t^5 on Finite Field in t of size 5^3
573
574
@@ -590,7 +591,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
590
591
591
592
EXAMPLES::
592
593
593
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
594
+ sage: k. <t> = GF( 5^ 3)
594
595
sage: Frob = k. frobenius_endomorphism( )
595
596
sage: Frob. _latex_( )
596
597
't \\ mapsto t^ {5} '
@@ -612,7 +613,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
612
613
"""
613
614
TESTS::
614
615
615
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
616
+ sage: k.<t> = GF(5^3)
616
617
sage: Frob = k.frobenius_endomorphism()
617
618
sage: Frob(t)
618
619
2*t^2 + 4*t + 4
@@ -631,7 +632,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
631
632
632
633
EXAMPLES::
633
634
634
- sage: k.<t> = GF(5^12) # optional - sage.rings.finite_rings
635
+ sage: k.<t> = GF(5^12)
635
636
sage: Frob = k.frobenius_endomorphism()
636
637
sage: Frob.order()
637
638
12
@@ -654,7 +655,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
654
655
655
656
EXAMPLES::
656
657
657
- sage: k.<t> = GF(5^12) # optional - sage.rings.finite_rings
658
+ sage: k.<t> = GF(5^12)
658
659
sage: Frob = k.frobenius_endomorphism()
659
660
sage: Frob.power()
660
661
1
@@ -672,7 +673,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
672
673
673
674
EXAMPLES::
674
675
675
- sage: k.<t> = GF(5^12) # optional - sage.rings.finite_rings
676
+ sage: k.<t> = GF(5^12)
676
677
sage: Frob = k.frobenius_endomorphism(); Frob
677
678
Frobenius endomorphism t |--> t^5 on Finite Field in t of size 5^12
678
679
sage: Frob^2
@@ -694,7 +695,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
694
695
695
696
EXAMPLES::
696
697
697
- sage: k.<a> = GF(7^11) # optional - sage.rings.finite_rings
698
+ sage: k.<a> = GF(7^11)
698
699
sage: f = k.frobenius_endomorphism(5)
699
700
sage: (f.inverse() * f).is_identity()
700
701
True
@@ -707,7 +708,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
707
708
708
709
EXAMPLES::
709
710
710
- sage: k.<t> = GF(5^12) # optional - sage.rings.finite_rings
711
+ sage: k.<t> = GF(5^12)
711
712
sage: f = k.frobenius_endomorphism(); f
712
713
Frobenius endomorphism t |--> t^5 on Finite Field in t of size 5^12
713
714
sage: g = k.frobenius_endomorphism(2); g
@@ -745,7 +746,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
745
746
746
747
EXAMPLES::
747
748
748
- sage: k.<t> = GF(5^6) # optional - sage.rings.finite_rings
749
+ sage: k.<t> = GF(5^6)
749
750
sage: f = k.frobenius_endomorphism(2)
750
751
sage: kfixed, embed = f.fixed_field()
751
752
sage: kfixed
@@ -778,7 +779,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
778
779
779
780
EXAMPLES::
780
781
781
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
782
+ sage: k.<t> = GF(5^3)
782
783
sage: Frob = k.frobenius_endomorphism()
783
784
sage: Frob.is_injective()
784
785
True
@@ -793,7 +794,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
793
794
794
795
EXAMPLES::
795
796
796
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
797
+ sage: k.<t> = GF(5^3)
797
798
sage: Frob = k.frobenius_endomorphism()
798
799
sage: Frob.is_surjective()
799
800
True
@@ -807,7 +808,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
807
808
808
809
EXAMPLES::
809
810
810
- sage: k.<t> = GF(5^3) # optional - sage.rings.finite_rings
811
+ sage: k.<t> = GF(5^3)
811
812
sage: Frob = k.frobenius_endomorphism()
812
813
sage: Frob.is_identity()
813
814
False
@@ -822,7 +823,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
822
823
823
824
EXAMPLES::
824
825
825
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
826
+ sage: k. <t> = GF( 5^ 3)
826
827
sage: Frob = k. frobenius_endomorphism( )
827
828
sage: hash( Frob) # random
828
829
383183030479672104
@@ -835,7 +836,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
835
836
836
837
TESTS::
837
838
838
- sage: k. <t> = GF( 5^ 3) # optional - sage . rings . finite_rings
839
+ sage: k. <t> = GF( 5^ 3)
839
840
sage: Frob = k. frobenius_endomorphism( 2)
840
841
sage: Frob
841
842
Frobenius endomorphism t | --> t^ ( 5^ 2) on Finite Field in t of size 5^ 3
0 commit comments