# HG changeset patch
# User Chris Wuthrich <christian.wuthrich@gmail.com>
# Date 1368526410 -3600
# Node ID 2f31acea3e1139e55e106da331ba78e3e7d0e3c3
# Parent 876b0eedb9670a453f7d175d1679f6badf114ea4
trac #11630 local data does not use global generators
diff --git a/sage/schemes/elliptic_curves/ell_local_data.py b/sage/schemes/elliptic_curves/ell_local_data.py
a
|
b
|
|
61 | 61 | sage: EK = E.base_extend(K) |
62 | 62 | sage: da = EK.local_data(1+i) |
63 | 63 | sage: da.minimal_model() |
64 | | Elliptic Curve defined by y^2 = x^3 + i over Number Field in i with defining polynomial x^2 + 1 |
| 64 | Elliptic Curve defined by y^2 = x^3 + (-i) over Number Field in i with defining polynomial x^2 + 1 |
65 | 65 | |
66 | 66 | REFERENCES: |
67 | 67 | |
… |
… |
|
151 | 151 | |
152 | 152 | """ |
153 | 153 | |
154 | | def __init__(self, E, P, proof=None, algorithm="pari"): |
| 154 | def __init__(self, E, P, proof=None, algorithm="pari", globally=False): |
155 | 155 | r""" |
156 | 156 | Initializes the reduction data for the elliptic curve `E` at the prime `P`. |
157 | 157 | |
… |
… |
|
173 | 173 | `\QQ`. If "generic", use the general number field |
174 | 174 | implementation. |
175 | 175 | |
| 176 | - ``globally`` (bool, default: False) -- If True, the algorithm |
| 177 | uses the generators of principal ideals rather than an arbitrary |
| 178 | uniformizer. |
| 179 | |
176 | 180 | .. note:: |
177 | 181 | |
178 | 182 | This function is not normally called directly by users, who |
… |
… |
|
267 | 271 | if self._fp>0: |
268 | 272 | self._reduction_type = Eint.ap(p) # = 0,-1 or +1 |
269 | 273 | else: |
270 | | self._Emin, ch, self._val_disc, self._fp, self._KS, self._cp, self._split = self._tate(proof) |
| 274 | self._Emin, ch, self._val_disc, self._fp, self._KS, self._cp, self._split = self._tate(proof, globally) |
271 | 275 | if self._fp>0: |
272 | 276 | if self._Emin.c4().valuation(p)>0: |
273 | 277 | self._reduction_type = 0 |
… |
… |
|
604 | 608 | """ |
605 | 609 | return self._reduction_type == 0 |
606 | 610 | |
607 | | def _tate(self, proof = None): |
| 611 | def _tate(self, proof = None, globally=False): |
608 | 612 | r""" |
609 | 613 | Tate's algorithm for an elliptic curve over a number field. |
610 | 614 | |
… |
… |
|
617 | 621 | principal, the minimal model returned will preserve |
618 | 622 | integrality at other primes, but not minimality. |
619 | 623 | |
| 624 | The optional argument globally, when set to True, tells the algorithm to use |
| 625 | the generator of the prime ideal if it is principal. Otherwise just any |
| 626 | uniformizer will be used. |
| 627 | |
620 | 628 | .. note:: |
621 | 629 | |
622 | 630 | Called only by ``EllipticCurveLocalData.__init__()``. |
… |
… |
|
664 | 672 | sage: E.tamagawa_number(K.ideal(2)) |
665 | 673 | 4 |
666 | 674 | |
| 675 | This is to show that the bug #11630 is fixed. (The computation |
| 676 | of the class group would produce a warning):: |
| 677 | |
| 678 | sage: K.<t> = NumberField(x^7-2*x+177) |
| 679 | sage: E = EllipticCurve([0,1,0,t,t]) |
| 680 | sage: P = K.ideal(2,t^3 + t + 1) |
| 681 | sage: E.local_data(P).kodaira_symbol() |
| 682 | II |
| 683 | |
667 | 684 | """ |
668 | 685 | E = self._curve |
669 | 686 | P = self._prime |
… |
… |
|
683 | 700 | # primes, so that we can divide by it without losing |
684 | 701 | # integrality at other primes. |
685 | 702 | |
686 | | principal_flag = P.is_principal() |
687 | | if principal_flag: |
| 703 | if globally: |
| 704 | principal_flag = P.is_principal() |
| 705 | else: |
| 706 | principal_flag = False |
| 707 | |
| 708 | if (K is QQ) or principal_flag : |
688 | 709 | pi = P.gens_reduced()[0] |
689 | 710 | verbose("P is principal, generator pi = %s"%pi, t, 1) |
690 | 711 | else: |
691 | 712 | pi = K.uniformizer(P, 'positive') |
692 | | verbose("P is not principal, uniformizer pi = %s"%pi, t, 1) |
| 713 | verbose("uniformizer pi = %s"%pi, t, 1) |
693 | 714 | pi2 = pi*pi; pi3 = pi*pi2; pi4 = pi*pi3 |
694 | 715 | pi_neg = None |
695 | 716 | prime = pi if K is QQ else P |
diff --git a/sage/schemes/elliptic_curves/ell_number_field.py b/sage/schemes/elliptic_curves/ell_number_field.py
a
|
b
|
|
667 | 667 | raise DeprecationWarning, "local_information is deprecated; use local_data instead" |
668 | 668 | return self.local_data(P,proof) |
669 | 669 | |
670 | | def local_data(self, P=None, proof = None, algorithm="pari"): |
| 670 | def local_data(self, P=None, proof = None, algorithm="pari", globally=False): |
671 | 671 | r""" |
672 | 672 | Local data for this elliptic curve at the prime `P`. |
673 | 673 | |
… |
… |
|
685 | 685 | ``ellglobalred`` implementation of Tate's algorithm over |
686 | 686 | `\QQ`. If "generic", use the general number field |
687 | 687 | implementation. |
688 | | |
| 688 | |
| 689 | - ``globally`` (boolean, default=False) -- indicates if Tate's |
| 690 | algorithm should use a generator for principal ideals rather |
| 691 | than just a local uniformizer. |
| 692 | |
689 | 693 | OUTPUT: |
690 | 694 | |
691 | 695 | If `P` is specified, returns the ``EllipticCurveLocalData`` |
… |
… |
|
755 | 759 | from sage.schemes.elliptic_curves.ell_local_data import check_prime |
756 | 760 | P = check_prime(self.base_field(),P) |
757 | 761 | |
758 | | return self._get_local_data(P,proof,algorithm) |
| 762 | return self._get_local_data(P,proof,algorithm,globally) |
759 | 763 | |
760 | | def _get_local_data(self, P, proof, algorithm="pari"): |
| 764 | def _get_local_data(self, P, proof, algorithm="pari",globally=False): |
761 | 765 | r""" |
762 | 766 | Internal function to create data for this elliptic curve at the prime `P`. |
763 | 767 | |
… |
… |
|
779 | 783 | ``ellglobalred`` implementation of Tate's algorithm over |
780 | 784 | `\QQ`. If "generic", use the general number field |
781 | 785 | implementation. |
782 | | |
| 786 | |
| 787 | - ``globally`` (boolean, default=False) -- indicates if Tate's |
| 788 | algorithm should use a generator for principal ideals rather |
| 789 | than just a local uniformizer. |
| 790 | |
783 | 791 | EXAMPLES:: |
784 | 792 | |
785 | 793 | sage: K.<i> = NumberField(x^2+1) |
… |
… |
|
803 | 811 | False |
804 | 812 | """ |
805 | 813 | try: |
806 | | return self._local_data[P, proof, algorithm] |
| 814 | return self._local_data[P, proof, algorithm, globally] |
807 | 815 | except AttributeError: |
808 | 816 | self._local_data = {} |
809 | 817 | except KeyError: |
810 | 818 | pass |
811 | 819 | from sage.schemes.elliptic_curves.ell_local_data import EllipticCurveLocalData |
812 | | self._local_data[P, proof, algorithm] = EllipticCurveLocalData(self, P, proof, algorithm) |
813 | | return self._local_data[P, proof, algorithm] |
| 820 | self._local_data[P, proof, algorithm, globally] = EllipticCurveLocalData(self, P, proof, algorithm, globally) |
| 821 | return self._local_data[P, proof, algorithm, globally] |
814 | 822 | |
815 | 823 | def local_minimal_model(self, P, proof = None, algorithm="pari"): |
816 | 824 | r""" |
… |
… |
|
830 | 838 | ``ellglobalred`` implementation of Tate's algorithm over |
831 | 839 | `\QQ`. If "generic", use the general number field |
832 | 840 | implementation. |
833 | | |
| 841 | |
834 | 842 | OUTPUT: |
835 | 843 | |
836 | 844 | A model of the curve which is minimal (and integral) at `P`. |
… |
… |
|
839 | 847 | |
840 | 848 | The model is not required to be integral on input. |
841 | 849 | |
842 | | For principal `P`, a generator is used as a uniformizer, |
843 | | and integrality or minimality at other primes is not |
844 | | affected. For non-principal `P`, the minimal model |
845 | | returned will preserve integrality at other primes, but not |
846 | | minimality. |
| 850 | The minimal model returned will preserve integrality |
| 851 | at other primes, but not minimality. |
847 | 852 | |
848 | 853 | EXAMPLES:: |
849 | 854 | |
… |
… |
|
858 | 863 | # We use the "number_field" flag because the actual proof dependence is in PARI's number field functions. |
859 | 864 | proof = sage.structure.proof.proof.get_flag(None, "number_field") |
860 | 865 | |
861 | | return self.local_data(P, proof, algorithm).minimal_model() |
| 866 | return self.local_data(P, proof, algorithm, globally=False).minimal_model() |
862 | 867 | |
863 | 868 | def has_good_reduction(self, P): |
864 | 869 | r""" |
… |
… |
|
1351 | 1356 | E = self.global_integral_model() |
1352 | 1357 | primes = E.base_ring()(E.discriminant()).support() |
1353 | 1358 | for P in primes: |
1354 | | E = E.local_data(P,proof).minimal_model() |
| 1359 | E = E.local_data(P,proof,globally=True).minimal_model() |
1355 | 1360 | return E._reduce_model() |
1356 | 1361 | |
1357 | 1362 | def reduction(self,place): |