# HG changeset patch
# User Martin Albrecht <martinralbrecht@googlemail.com>
# Date 1339422258 -3600
# Node ID 2e87bb38f2217283f003e48e60870c526252b16f
# Parent 7871b851103379c8ddf6bb818006b8acb4b414d1
#9511 update Givaro to 3.7.0 (patch applies to Sage 5.1.beta5 and above)
diff --git a/module_list.py b/module_list.py
a
|
b
|
|
72 | 72 | |
73 | 73 | singular_libs = ['m', 'readline', 'singular', 'givaro', 'ntl', 'gmpxx', 'gmp'] |
74 | 74 | |
| 75 | |
| 76 | ######################################################### |
| 77 | ### Givaro flags |
| 78 | ######################################################### |
| 79 | |
| 80 | givaro_extra_compile_args =['-D__STDC_LIMIT_MACROS'] |
| 81 | |
75 | 82 | ######################################################### |
76 | 83 | ### PolyBoRi defines |
77 | 84 | ######################################################### |
… |
… |
|
608 | 615 | libraries = ['linboxsage', 'ntl', 'linbox', |
609 | 616 | 'stdc++', 'givaro', 'gmp', 'gmpxx', BLAS, BLAS2], |
610 | 617 | language = 'c++', |
| 618 | extra_compile_args = givaro_extra_compile_args, |
611 | 619 | depends = [SAGE_INC + 'givaro/givconfig.h']), |
612 | 620 | |
613 | 621 | Extension('sage.libs.lcalc.lcalc_Lfunction', |
… |
… |
|
662 | 670 | libraries = singular_libs, |
663 | 671 | language="c++", |
664 | 672 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
665 | | depends = singular_depends), |
| 673 | depends = singular_depends, |
| 674 | extra_compile_args = givaro_extra_compile_args), |
666 | 675 | |
667 | 676 | Extension('sage.libs.singular.polynomial', |
668 | 677 | sources = ['sage/libs/singular/polynomial.pyx'], |
669 | 678 | libraries = singular_libs, |
670 | 679 | language="c++", |
671 | 680 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
672 | | depends = singular_depends), |
| 681 | depends = singular_depends, |
| 682 | extra_compile_args = givaro_extra_compile_args), |
673 | 683 | |
674 | 684 | Extension('sage.libs.singular.ring', |
675 | 685 | sources = ['sage/libs/singular/ring.pyx'], |
676 | 686 | libraries = singular_libs, |
677 | 687 | language="c++", |
678 | 688 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
679 | | depends = singular_depends), |
| 689 | depends = singular_depends, |
| 690 | extra_compile_args = givaro_extra_compile_args), |
680 | 691 | |
681 | 692 | Extension('sage.libs.singular.groebner_strategy', |
682 | 693 | sources = ['sage/libs/singular/groebner_strategy.pyx'], |
683 | 694 | libraries = singular_libs, |
684 | 695 | language="c++", |
685 | 696 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
686 | | depends = singular_depends), |
| 697 | depends = singular_depends, |
| 698 | extra_compile_args = givaro_extra_compile_args), |
687 | 699 | |
688 | 700 | Extension('sage.libs.singular.function', |
689 | 701 | sources = ['sage/libs/singular/function.pyx'], |
690 | 702 | libraries = singular_libs, |
691 | 703 | language="c++", |
692 | 704 | include_dirs = [SAGE_INC +'singular', SAGE_INC + 'factory'], |
693 | | depends = singular_depends), |
| 705 | depends = singular_depends, |
| 706 | extra_compile_args = givaro_extra_compile_args), |
694 | 707 | |
695 | 708 | Extension('sage.libs.singular.option', |
696 | 709 | sources = ['sage/libs/singular/option.pyx'], |
697 | 710 | libraries = singular_libs, |
698 | 711 | language="c++", |
699 | 712 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
700 | | depends = singular_depends), |
| 713 | depends = singular_depends, |
| 714 | extra_compile_args = givaro_extra_compile_args), |
701 | 715 | |
702 | 716 | Extension('sage.libs.symmetrica.symmetrica', |
703 | 717 | sources = ["sage/libs/symmetrica/%s"%s for s in ["symmetrica.pyx"]], |
… |
… |
|
960 | 974 | libraries = ['m4rie', 'm4ri', 'givaro', 'ntl', 'gmpxx', 'gmp', 'm', 'stdc++'], |
961 | 975 | depends = [SAGE_INC + "m4rie/m4rie.h"], |
962 | 976 | include_dirs = [SAGE_INC + 'm4rie'], |
963 | | extra_compile_args = m4ri_extra_compile_args, |
| 977 | extra_compile_args = m4ri_extra_compile_args + givaro_extra_compile_args, |
964 | 978 | language="c++"), |
965 | 979 | |
966 | 980 | Extension('sage.matrix.matrix_modn_dense', |
… |
… |
|
971 | 985 | sources = ['sage/matrix/matrix_modn_dense_float.pyx'], |
972 | 986 | language="c++", |
973 | 987 | libraries = ['gmp', 'linbox', 'givaro', BLAS, BLAS2], |
974 | | extra_compile_args = ['-DDISABLE_COMMENTATOR']), |
| 988 | extra_compile_args = ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), |
975 | 989 | |
976 | 990 | Extension('sage.matrix.matrix_modn_dense_double', |
977 | 991 | sources = ['sage/matrix/matrix_modn_dense_double.pyx'], |
978 | 992 | language="c++", |
979 | 993 | libraries = ['gmp', 'linbox', 'givaro', BLAS, BLAS2], |
980 | | extra_compile_args = ['-DDISABLE_COMMENTATOR']), |
| 994 | extra_compile_args = ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), |
981 | 995 | |
982 | 996 | Extension('sage.matrix.matrix_modn_sparse', |
983 | 997 | sources = ['sage/matrix/matrix_modn_sparse.pyx'], |
… |
… |
|
988 | 1002 | libraries = singular_libs, |
989 | 1003 | language="c++", |
990 | 1004 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
991 | | depends = singular_depends), |
| 1005 | depends = singular_depends, |
| 1006 | extra_compile_args = givaro_extra_compile_args), |
992 | 1007 | |
993 | 1008 | #Extension('sage.matrix.matrix_pid_dense', |
994 | 1009 | # sources = ['sage/matrix/matrix_pid_dense.pyx']), |
… |
… |
|
1436 | 1451 | sources = ["sage/rings/finite_rings/element_givaro.pyx"], |
1437 | 1452 | # this order is needed to compile under windows. |
1438 | 1453 | libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm', 'stdc++', ], |
1439 | | language='c++'), |
| 1454 | language='c++', |
| 1455 | extra_compile_args = givaro_extra_compile_args), |
1440 | 1456 | |
1441 | 1457 | Extension('sage.rings.finite_rings.element_ntl_gf2e', |
1442 | 1458 | sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx'], |
… |
… |
|
1576 | 1592 | libraries = singular_libs, |
1577 | 1593 | language="c++", |
1578 | 1594 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
1579 | | depends = singular_depends), |
| 1595 | depends = singular_depends, |
| 1596 | extra_compile_args = givaro_extra_compile_args), |
1580 | 1597 | |
1581 | 1598 | Extension('sage.rings.polynomial.plural', |
1582 | 1599 | sources = ['sage/rings/polynomial/plural.pyx'], |
1583 | 1600 | libraries = ['m', 'readline', 'singular', 'givaro', 'gmpxx', 'gmp'], |
1584 | 1601 | language="c++", |
1585 | 1602 | include_dirs = [SAGE_ROOT +'/local/include/singular'], |
1586 | | depends = [SAGE_ROOT + "/local/include/libsingular.h"]), |
| 1603 | depends = [SAGE_ROOT + "/local/include/libsingular.h"], |
| 1604 | extra_compile_args = givaro_extra_compile_args), |
1587 | 1605 | |
1588 | 1606 | Extension('sage.rings.polynomial.multi_polynomial_libsingular', |
1589 | 1607 | sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx'], |
1590 | 1608 | libraries = singular_libs, |
1591 | 1609 | language="c++", |
1592 | 1610 | include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'], |
1593 | | depends = singular_depends), |
| 1611 | depends = singular_depends, |
| 1612 | extra_compile_args = givaro_extra_compile_args), |
1594 | 1613 | |
1595 | 1614 | Extension('sage.rings.polynomial.multi_polynomial_ring_generic', |
1596 | 1615 | sources = ['sage/rings/polynomial/multi_polynomial_ring_generic.pyx']), |
diff --git a/sage/matrix/constructor.py b/sage/matrix/constructor.py
a
|
b
|
|
1064 | 1064 | |
1065 | 1065 | sage: K.<a>=FiniteField(3^2) |
1066 | 1066 | sage: random_matrix(K, 2, 5) |
1067 | | [ 1 2*a 1 a + 2 2] |
1068 | | [ a 2*a + 1 0 2 1] |
1069 | | |
| 1067 | [ 1 a 1 2*a + 1 2] |
| 1068 | [ 2*a a + 2 0 2 1] |
| 1069 | |
1070 | 1070 | sage: random_matrix(RR, 3, 4, density=0.66) |
1071 | 1071 | [ 0.000000000000000 -0.806696574554030 -0.693915509972359 0.000000000000000] |
1072 | 1072 | [ 0.629781664418083 0.000000000000000 -0.833709843116637 0.000000000000000] |
diff --git a/sage/matrix/matrix2.pyx b/sage/matrix/matrix2.pyx
a
|
b
|
|
9810 | 9810 | sage: A.is_symmetric() |
9811 | 9811 | True |
9812 | 9812 | sage: L = A.cholesky() |
9813 | | sage: L |
9814 | | [ 3 0 0] |
9815 | | [ 4*a^2 + 1 1 0] |
9816 | | [ 3*a + 2 a^2 + 2*a + 3 3] |
9817 | 9813 | sage: L*L.transpose() == A |
9818 | 9814 | True |
9819 | 9815 | |
diff --git a/sage/matrix/matrix_space.py b/sage/matrix/matrix_space.py
a
|
b
|
|
1491 | 1491 | [ -3 -1/3 -1] |
1492 | 1492 | [ 0 -1 1] |
1493 | 1493 | sage: Mat(GF(9,'a'),3,sparse=True).random_element() |
1494 | | [ 2*a a 1] |
1495 | | [ 2 1 2*a + 1] |
1496 | | [ a 2 2] |
| 1494 | [ a 2*a 1] |
| 1495 | [ 2 1 a + 2] |
| 1496 | [ 2*a 2 2] |
1497 | 1497 | """ |
1498 | 1498 | Z = self.zero_matrix().__copy__() |
1499 | 1499 | if density is None: |
diff --git a/sage/rings/finite_rings/constructor.py b/sage/rings/finite_rings/constructor.py
a
|
b
|
|
77 | 77 | sage: k = GF(9, 'a') |
78 | 78 | sage: for i,x in enumerate(k): print i,x |
79 | 79 | 0 0 |
80 | | 1 2*a |
| 80 | 1 a |
81 | 81 | 2 a + 1 |
82 | | 3 a + 2 |
| 82 | 3 2*a + 1 |
83 | 83 | 4 2 |
84 | | 5 a |
| 84 | 5 2*a |
85 | 85 | 6 2*a + 2 |
86 | | 7 2*a + 1 |
| 86 | 7 a + 2 |
87 | 87 | 8 1 |
88 | 88 | sage: for a in GF(5): |
89 | 89 | ... print a |
diff --git a/sage/rings/finite_rings/element_givaro.pxd b/sage/rings/finite_rings/element_givaro.pxd
a
|
b
|
|
8 | 8 | pass |
9 | 9 | |
10 | 10 | cdef extern from "givaro/givrandom.h": |
11 | | ctypedef struct GivRandom "GivRandom": |
| 11 | ctypedef struct GivRandom "Givaro::GivRandom": |
12 | 12 | pass |
13 | 13 | |
14 | | GivRandom GivRandomSeeded "GivRandom"(unsigned long seed) |
| 14 | GivRandom GivRandomSeeded "Givaro::GivRandom"(unsigned long seed) |
15 | 15 | |
16 | 16 | cdef extern from "givaro/givgfq.h": |
17 | 17 | ctypedef struct intvec "std::vector<unsigned int>": |
… |
… |
|
23 | 23 | |
24 | 24 | cdef extern from "givaro/givgfq.h": |
25 | 25 | |
26 | | ctypedef struct GivaroGfq "GFqDom<int>": |
| 26 | ctypedef struct GivaroGfq "Givaro::GFqDom<int>": |
27 | 27 | #attributes |
28 | 28 | unsigned int one |
29 | 29 | unsigned int zero |
… |
… |
|
42 | 42 | int (* random)(GivRandom gen, int res) |
43 | 43 | int (* initi "init")(int res, int e) |
44 | 44 | int (* initd "init")(int res, double e) |
45 | | int (* axpyin)(int r, int a, int x) |
46 | 45 | int (* sage_generator)() # SAGE specific method, not found upstream |
47 | 46 | int (* convert)(int r, int p) |
48 | 47 | int (* read)(int r, int p) |
| 48 | int (* axpyin)(int r, int a, int x) |
49 | 49 | int (* axpy)(int r, int a, int b, int c) |
50 | 50 | int (* axmy)(int r, int a, int b, int c) |
51 | | int (* amxy)(int r, int a, int b, int c) |
| 51 | int (* maxpy)(int r, int a, int b, int c) |
52 | 52 | bint (* isZero)(int e) |
53 | 53 | bint (* isOne)(int e) |
54 | 54 | bint (* isunit)(int e) |
55 | 55 | |
56 | | GivaroGfq *gfq_factorypk "new GFqDom<int>" (unsigned int p, unsigned int k) |
| 56 | GivaroGfq *gfq_factorypk "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k) |
57 | 57 | # SAGE specific method, not found upstream |
58 | | GivaroGfq *gfq_factorypkp "new GFqDom<int>" (unsigned int p, unsigned int k, intvec poly) |
59 | | GivaroGfq *gfq_factorycopy "new GFqDom<int>"(GivaroGfq orig) |
| 58 | GivaroGfq *gfq_factorypkp "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k, intvec poly) |
| 59 | GivaroGfq *gfq_factorycopy "new Givaro::GFqDom<int>"(GivaroGfq orig) |
60 | 60 | GivaroGfq gfq_deref "*"(GivaroGfq *orig) |
61 | 61 | void delete "delete "(void *o) |
62 | | int gfq_element_factory "GFqDom<int>::Element"() |
| 62 | int gfq_element_factory "Givaro::GFqDom<int>::Element"() |
63 | 63 | |
64 | 64 | cdef class FiniteField_givaroElement(FinitePolyExtElement) #forward declaration |
65 | 65 | |
diff --git a/sage/rings/finite_rings/element_givaro.pyx b/sage/rings/finite_rings/element_givaro.pyx
a
|
b
|
|
212 | 212 | sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='int').gen() |
213 | 213 | 3 |
214 | 214 | sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='log').gen() |
215 | | 5 |
| 215 | 1 |
216 | 216 | """ |
217 | 217 | # we are calling late_import here because this constructor is |
218 | 218 | # called at least once before any arithmetic is performed. |
… |
… |
|
351 | 351 | EXAMPLES: |
352 | 352 | sage: k = GF(23**3, 'a') |
353 | 353 | sage: e = k._cache.random_element(); e |
354 | | 9*a^2 + 10*a + 3 |
| 354 | 2*a^2 + 14*a + 21 |
355 | 355 | sage: type(e) |
356 | 356 | <type 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'> |
357 | 357 | |
358 | 358 | sage: P.<x> = PowerSeriesRing(GF(3^3, 'a')) |
359 | 359 | sage: P.random_element(5) |
360 | | a^2 + 2*a + 1 + (a + 1)*x + (a^2 + a + 1)*x^2 + (a^2 + 1)*x^3 + (2*a^2 + a)*x^4 + O(x^5) |
| 360 | 2*a + 2 + (a^2 + a + 2)*x + (2*a + 1)*x^2 + (2*a^2 + a)*x^3 + 2*a^2*x^4 + O(x^5) |
361 | 361 | """ |
362 | 362 | cdef int seed = current_randstate().c_random() |
363 | 363 | cdef int res |
… |
… |
|
625 | 625 | return self._element_int_repr(e) |
626 | 626 | |
627 | 627 | def _element_log_repr(self, FiniteField_givaroElement e): |
628 | | r""" |
629 | | Return str(i) where \code{base.gen()^i==self}. |
630 | | |
631 | | TODO -- this isn't what it does -- see below. |
| 628 | """ |
| 629 | Return ``str(i)`` where ``self` is ``gen^i`` with ``gen`` |
| 630 | being the *internal* multiplicative generator of this finite |
| 631 | field. |
632 | 632 | |
633 | 633 | EXAMPLES: |
634 | 634 | sage: k.<a> = GF(3^4); k |
635 | 635 | Finite Field in a of size 3^4 |
636 | 636 | sage: k._cache._element_log_repr(a^20) |
637 | 637 | '20' |
638 | | sage: k._cache._element_log_repr(a) # TODO -- why 41 ?? why not 1? |
639 | | '41' |
| 638 | sage: k._cache._element_log_repr(a) |
| 639 | '1' |
640 | 640 | """ |
641 | 641 | return str(int(e.element)) |
642 | 642 | |
… |
… |
|
750 | 750 | """ |
751 | 751 | cdef int r |
752 | 752 | |
753 | | r = self.objectptr.amxy(r , a.element, b.element, c.element, ) |
| 753 | r = self.objectptr.maxpy(r , a.element, b.element, c.element, ) |
754 | 754 | return make_FiniteField_givaroElement(self,r) |
755 | 755 | |
756 | 756 | def __reduce__(self): |
… |
… |
|
819 | 819 | sage: i.next() |
820 | 820 | 0 |
821 | 821 | sage: i.next() |
822 | | 2*a |
| 822 | a |
823 | 823 | """ |
824 | 824 | |
825 | 825 | self.iterator=self.iterator+1 |
… |
… |
|
899 | 899 | |
900 | 900 | sage: k.<FOOBAR> = GF(3^4,repr='log') |
901 | 901 | sage: FOOBAR |
902 | | 41 |
| 902 | 1 |
903 | 903 | |
904 | 904 | sage: k.<FOOBAR> = GF(3^4,repr='int') |
905 | 905 | sage: FOOBAR |
… |
… |
|
1478 | 1478 | sage: k.<b> = GF(5^2); k |
1479 | 1479 | Finite Field in b of size 5^2 |
1480 | 1480 | sage: (b+2).log_repr() |
1481 | | '3' |
| 1481 | '15' |
1482 | 1482 | """ |
1483 | 1483 | return self._cache._element_log_repr(self) |
1484 | 1484 | |
diff --git a/sage/rings/finite_rings/finite_field_base.pyx b/sage/rings/finite_rings/finite_field_base.pyx
a
|
b
|
|
54 | 54 | |
55 | 55 | sage: K.<a> = GF(7^4) |
56 | 56 | sage: K.list()[:7] |
57 | | [0, 6*a, a^2, 6*a^3, 2*a^2 + 3*a + 4, 5*a^3 + 4*a^2 + 3*a, 3*a^3 + a^2 + 6*a + 1] |
| 57 | [0, a, a^2, a^3, 2*a^2 + 3*a + 4, 2*a^3 + 3*a^2 + 4*a, 3*a^3 + a^2 + 6*a + 1] |
58 | 58 | sage: K.<a> = GF(5^9) |
59 | 59 | sage: for x in K: |
60 | 60 | ... if x == a+3: break |
diff --git a/sage/rings/finite_rings/finite_field_givaro.py b/sage/rings/finite_rings/finite_field_givaro.py
a
|
b
|
|
70 | 70 | sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='int').gen() |
71 | 71 | 3 |
72 | 72 | sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='log').gen() |
73 | | 5 |
| 73 | 1 |
74 | 74 | |
75 | 75 | sage: k.<a> = GF(2^3) |
76 | 76 | sage: j.<b> = GF(3^4) |
… |
… |
|
188 | 188 | EXAMPLES: |
189 | 189 | sage: k = GF(23**3, 'a') |
190 | 190 | sage: e = k.random_element(); e |
191 | | 9*a^2 + 10*a + 3 |
| 191 | 2*a^2 + 14*a + 21 |
192 | 192 | sage: type(e) |
193 | 193 | <type 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'> |
194 | 194 | |
195 | 195 | sage: P.<x> = PowerSeriesRing(GF(3^3, 'a')) |
196 | 196 | sage: P.random_element(5) |
197 | | a^2 + 2*a + 1 + (a + 1)*x + (a^2 + a + 1)*x^2 + (a^2 + 1)*x^3 + (2*a^2 + a)*x^4 + O(x^5) |
| 197 | 2*a + 2 + (a^2 + a + 2)*x + (2*a + 1)*x^2 + (2*a^2 + a)*x^3 + 2*a^2*x^4 + O(x^5) |
198 | 198 | """ |
199 | 199 | return self._cache.random_element() |
200 | 200 | |
diff --git a/sage/schemes/elliptic_curves/ell_finite_field.py b/sage/schemes/elliptic_curves/ell_finite_field.py
a
|
b
|
|
312 | 312 | sage: k.<a> = GF(7^5) |
313 | 313 | sage: E = EllipticCurve(k,[2,4]) |
314 | 314 | sage: P = E.random_element(); P |
315 | | (2*a^4 + 3*a^3 + 5*a^2 + 6*a + 4 : 6*a^4 + 4*a^3 + a + 6 : 1) |
| 315 | (2*a^4 + 3*a^2 + 4*a : 3*a^4 + 6*a^2 + 5 : 1) |
316 | 316 | sage: type(P) |
317 | 317 | <class 'sage.schemes.elliptic_curves.ell_point.EllipticCurvePoint_finite_field'> |
318 | 318 | sage: P in E |
diff --git a/sage/schemes/generic/affine_space.py b/sage/schemes/generic/affine_space.py
a
|
b
|
|
216 | 216 | sage: A.rational_points() |
217 | 217 | [(0), (1), (2)] |
218 | 218 | sage: A.rational_points(GF(3^2, 'b')) |
219 | | [(0), (2*b), (b + 1), (b + 2), (2), (b), (2*b + 2), (2*b + 1), (1)] |
| 219 | [(0), (b), (b + 1), (2*b + 1), (2), (2*b), (2*b + 2), (b + 2), (1)] |
220 | 220 | |
221 | 221 | sage: AffineSpace(2, ZZ).rational_points(GF(2)) |
222 | 222 | [(0, 0), (1, 0), (0, 1), (1, 1)] |
diff --git a/sage/schemes/generic/projective_space.py b/sage/schemes/generic/projective_space.py
a
|
b
|
|
691 | 691 | sage: P.rational_points() |
692 | 692 | [(0 : 1), (1 : 1), (2 : 1), (1 : 0)] |
693 | 693 | sage: P.rational_points(GF(3^2, 'b')) |
694 | | [(0 : 1), (2*b : 1), (b + 1 : 1), (b + 2 : 1), (2 : 1), (b : 1), (2*b + 2 : 1), (2*b + 1 : 1), (1 : 1), (1 : 0)] |
| 694 | [(0 : 1), (b : 1), (b + 1 : 1), (2*b + 1 : 1), (2 : 1), (2*b : 1), (2*b + 2 : 1), (b + 2 : 1), (1 : 1), (1 : 0)] |
695 | 695 | """ |
696 | 696 | if F == None: |
697 | 697 | return [ P for P in self ] |
diff --git a/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
a
|
b
|
|
7 | 7 | sage: x = polygen(K) |
8 | 8 | sage: C = HyperellipticCurve(x^7 - x^5 - 2, x^2 + a) |
9 | 9 | sage: C._points_fast_sqrt() |
10 | | [(0 : 1 : 0), (2*a : 2*a + 2 : 1), (2*a : 2*a : 1), (a + 1 : a : 1), (a + 1 : a + 1 : 1), (2 : a + 1 : 1), (1 : a + 1 : 1)] |
| 10 | [(0 : 1 : 0), (a + 1 : a : 1), (a + 1 : a + 1 : 1), (2 : a + 1 : 1), (2*a : 2*a + 2 : 1), (2*a : 2*a : 1), (1 : a + 1 : 1)] |
| 11 | |
11 | 12 | """ |
12 | 13 | |
13 | 14 | #***************************************************************************** |
… |
… |
|
173 | 174 | sage: x = polygen(K) |
174 | 175 | sage: C = HyperellipticCurve(x^7 - 1, x^2 + a) |
175 | 176 | sage: C._points_fast_sqrt() |
176 | | [(0 : 1 : 0), (2 : a + 1 : 1), (a : 2*a + 1 : 1), (2*a + 2 : 2*a : 1), (2*a + 2 : 1 : 1), (1 : 2*a + 2 : 1), (1 : 0 : 1)] |
| 177 | [(0 : 1 : 0), (a : 2*a + 1 : 1), (2 : a + 1 : 1), (2*a + 2 : 2*a : 1), (2*a + 2 : 1 : 1), (1 : 2*a + 2 : 1), (1 : 0 : 1)] |
177 | 178 | sage: K.<a> = GF(49, 'a') |
178 | 179 | sage: x = polygen(K) |
179 | 180 | sage: C = HyperellipticCurve(x^5 - x^2 - 1, x^2 + a) |
diff --git a/sage/schemes/hyperelliptic_curves/jacobian_morphism.py b/sage/schemes/hyperelliptic_curves/jacobian_morphism.py
a
|
b
|
|
290 | 290 | :: |
291 | 291 | |
292 | 292 | sage: Q = J(H.lift_x(F(a+1))); Q |
293 | | (x + 6*a + 6, y + 2) |
| 293 | (x + 6*a + 6, y + 2*a) |
294 | 294 | sage: 7*8297*Q # indirect doctest |
295 | 295 | (1) |
296 | 296 | |
diff --git a/sage/schemes/plane_curves/projective_curve.py b/sage/schemes/plane_curves/projective_curve.py
a
|
b
|
|
367 | 367 | sage: b.next() |
368 | 368 | (0 : 0 : 1) |
369 | 369 | sage: b.next() |
370 | | (2*a + 2 : 2*a : 1) |
| 370 | (2*a + 2 : a : 1) |
371 | 371 | sage: b.next() |
372 | 372 | (2 : a + 1 : 1) |
373 | 373 | sage: b.next() |
374 | | (a + 1 : a + 2 : 1) |
| 374 | (a + 1 : 2*a + 1 : 1) |
375 | 375 | sage: b.next() |
376 | 376 | (1 : 2 : 1) |
377 | 377 | sage: b.next() |
378 | | (2*a + 2 : a : 1) |
| 378 | (2*a + 2 : 2*a : 1) |
379 | 379 | sage: b.next() |
380 | 380 | (2 : 2*a + 2 : 1) |
381 | 381 | sage: b.next() |
382 | | (a + 1 : 2*a + 1 : 1) |
| 382 | (a + 1 : a + 2 : 1) |
383 | 383 | sage: b.next() |
384 | 384 | (1 : 1 : 1) |
385 | 385 | sage: b.next() |
diff --git a/sage/tests/french_book/numbertheory.py b/sage/tests/french_book/numbertheory.py
a
|
b
|
|
40 | 40 | Finite Field in x of size 3^2 |
41 | 41 | sage: R.polynomial() |
42 | 42 | x^2 + 2*x + 2 |
43 | | sage: [r for r in R] |
44 | | [0, 2*x, x + 1, x + 2, 2, x, 2*x + 2, 2*x + 1, 1] |
| 43 | sage: Set([r for r in R]) |
| 44 | {0, 1, 2, x, x + 1, x + 2, 2*x, 2*x + 1, 2*x + 2} |
45 | 45 | sage: Q.<x> = PolynomialRing(GF(3)) |
46 | 46 | sage: R2 = GF(9,name='x',modulus=x^2+1); R2 |
47 | 47 | Finite Field in x of size 3^2 |