Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Kodaira symbols
Kodaira symbols encode the type of reduction of an elliptic curve at a (finite) place.
The standard notation for Kodaira Symbols is as a string which is one of `\rm{I}_m`, `\rm{II}`, `\rm{III}`, `\rm{IV}`, `\rm{I}^*_m`, `\rm{II}^*`, `\rm{III}^*`, `\rm{IV}^*`, where `m` denotes a non-negative integer. These have been encoded by single integers by different people. For convenience we give here the conversion table between strings, the eclib coding and the PARI encoding.
+----------------------+----------------+--------------------+ | Kodaira Symbol | Eclib coding | PARI Coding | +======================+================+====================+ | `\rm{I}_0` | `0` | `1` | +----------------------+----------------+--------------------+ | `\rm{I}^*_0` | `1` | `-1` | +----------------------+----------------+--------------------+ | `\rm{I}_m` `(m>0)` | `10m` | `m+4` | +----------------------+----------------+--------------------+ | `\rm{I}^*_m` `(m>0)` | `10m+1` | `-(m+4)` | +----------------------+----------------+--------------------+ | `\rm{II}` | `2` | `2` | +----------------------+----------------+--------------------+ | `\rm{III}` | `3` | `3` | +----------------------+----------------+--------------------+ | `\rm{IV}` | `4` | `4` | +----------------------+----------------+--------------------+ | `\rm{II}^*` | `7` | `-2` | +----------------------+----------------+--------------------+ | `\rm{III}^*` | `6` | `-3` | +----------------------+----------------+--------------------+ | `\rm{IV}^*` | `5` | `-4` | +----------------------+----------------+--------------------+
AUTHORS:
- David Roe <roed@math.harvard.edu>
- John Cremona
"""
#***************************************************************************** # Copyright (C) 2007 David Roe <roed@math.harvard.edu> # William Stein <wstein@gmail.com> # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # The full text of the GPL is available at: # # http://www.gnu.org/licenses/ #*****************************************************************************
from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, richcmp from sage.rings.integer import Integer import weakref
@richcmp_method class KodairaSymbol_class(SageObject): r""" Class to hold a Kodaira symbol of an elliptic curve over a `p`-adic local field.
Users should use the ``KodairaSymbol()`` function to construct Kodaira Symbols rather than use the class constructor directly. """ def __init__(self, symbol): r""" Constructor for Kodaira Symbol class.
INPUT:
- ``symbol`` (string or integer) -- The string should be a standard string representation (e.g. III*) of a Kodaira symbol, which will be parsed. Alternatively, use the PARI encoding of Kodaira symbols as integers.
EXAMPLES::
sage: from sage.schemes.elliptic_curves.kodaira_symbol import KodairaSymbol_class sage: KodairaSymbol_class(14) I10 sage: KodairaSymbol_class('III*') III* sage: latex(KodairaSymbol_class('In')) I_n sage: KodairaSymbol_class('In') In """ raise ValueError("Kodaira Symbol code number must be nonzero.") raise TypeError("symbol must be a nonempty string") else: self._str = "In*" self._latex = "I_n^*" else: else: else: else: else: raise ValueError("input is not a Kodaira symbol")
def __repr__(self): r""" Return the string representation of this Kodaira Symbol.
EXAMPLES::
sage: from sage.schemes.elliptic_curves.kodaira_symbol import KodairaSymbol_class sage: KS = KodairaSymbol_class(15) sage: str(KS) # indirect doctest 'I11' """
def _latex_(self): r""" Return the string representation of this Kodaira Symbol.
EXAMPLES::
sage: from sage.schemes.elliptic_curves.kodaira_symbol import KodairaSymbol_class sage: KS = KodairaSymbol_class(15) sage: latex(KS) I_{11} """
def __richcmp__(self, other, op): r""" Standard comparison function for Kodaira Symbols.
EXAMPLES::
sage: from sage.schemes.elliptic_curves.kodaira_symbol import KodairaSymbol_class sage: KS1 = KodairaSymbol_class(15); KS1 I11 sage: KS2 = KodairaSymbol_class(-34); KS2 I30* sage: KS1 < KS2 True sage: KS2 < KS1 False
::
sage: Klist = [KodairaSymbol_class(i) for i in [-10..10] if i!=0] sage: Klist.sort() sage: Klist [I0, I0*, I1, I1*, I2, I2*, I3, I3*, I4, I4*, I5, I5*, I6, I6*, II, II*, III, III*, IV, IV*] """ return richcmp(self._starred, other._starred, op) else: return NotImplemented
def _pari_code(self): """ Return the PARI encoding of this Kodaira Symbol.
EXAMPLES::
sage: KodairaSymbol('I0')._pari_code() 1 sage: KodairaSymbol('I10')._pari_code() 14 sage: KodairaSymbol('I10*')._pari_code() -14 sage: [KodairaSymbol(s)._pari_code() for s in ['II','III','IV']] [2, 3, 4] sage: [KodairaSymbol(s)._pari_code() for s in ['II*','III*','IV*']] [-2, -3, -4] """
_ks_cache = {} def KodairaSymbol(symbol): r""" Returns the specified Kodaira symbol.
INPUT:
- ``symbol`` (string or integer) -- Either a string of the form "I0", "I1", ..., "In", "II", "III", "IV", "I0*", "I1*", ..., "In*", "II*", "III*", or "IV*", or an integer encoding a Kodaira symbol using PARI's conventions.
OUTPUT:
(KodairaSymbol) The corresponding Kodaira symbol.
EXAMPLES::
sage: KS = KodairaSymbol sage: [KS(n) for n in range(1,10)] [I0, II, III, IV, I1, I2, I3, I4, I5] sage: [KS(-n) for n in range(1,10)] [I0*, II*, III*, IV*, I1*, I2*, I3*, I4*, I5*] sage: all([KS(str(KS(n)))==KS(n) for n in range(-10,10) if n!=0]) True """ |