Ticket #12767: trac_12767-number_field_docs.patch

File trac_12767-number_field_docs.patch, 10.3 KB (added by davidloeffler, 9 years ago)

Patch against 5.0.beta10

  • doc/en/reference/categories.rst

    # HG changeset patch
    # User David Loeffler <d.loeffler.01@cantab.net>
    # Date 1332933266 -3600
    # Node ID 42dfa116e50d152f5c5c7a374c3c67c3721f9ab8
    # Parent  66e568c3d082ee389659bd257efa500e5a8e5955
    #12767: fix broken links in number field docs
    
    diff --git a/doc/en/reference/categories.rst b/doc/en/reference/categories.rst
    a b  
    1010   sage/categories/tutorial
    1111   sage/categories/category
    1212   sage/categories/category_types
     13   sage/categories/map
    1314   sage/categories/homset
    1415   sage/categories/morphism
    1516   sage/categories/functor
  • sage/categories/map.pyx

    diff --git a/sage/categories/map.pyx b/sage/categories/map.pyx
    a b  
     1r"""
     2Base class for maps
     3"""
    14#*****************************************************************************
    25#       Copyright (C) 2008 Robert Bradshaw <robertwb@math.washington.edu>
    36#
     
    7275    NOTE:
    7376
    7477    The call method is of course not implemented in this base class. This must
    75     be done in the sub classes, by overloading :meth:`_call_` and possibly also
    76     :meth:`_call_with_args`.
     78    be done in the sub classes, by overloading ``_call_`` and possibly also
     79    ``_call_with_args``.
    7780
    7881    EXAMPLES:
    7982   
     
    417420
    418421        INPUT:
    419422
    420             ``x`` -- an element coercible to the domain of ``self``; also
    421                      objects like ideals are supported in some cases
     423        - ``x`` -- an element coercible to the domain of ``self``; also objects
     424          like ideals are supported in some cases
    422425
    423426        OUTPUT:
    424427
    425             an element (or ideal, etc.)
     428        an element (or ideal, etc.)
    426429
    427430        EXAMPLES::
    428431
     
    495498            4
    496499
    497500        If the argument does not coerce into the domain, and if
    498         ``pushforward`` fails, ``_call_`` is tried after conversion.
     501        ``pushforward`` fails, ``_call_`` is tried after conversion. ::
    499502
    500503            sage: g = FOO(QQ,ZZ)
    501504            sage: g(SR(3))
     
    588591
    589592        OUTPUT:
    590593       
    591         The map $x \mapsto self(right(x))$.
     594        The map `x \mapsto self(right(x))`.
    592595
    593596        EXAMPLES::
    594597
     
    772775    def pre_compose(self, right):
    773776        """
    774777        INPUT:
    775          - ``self`` -- a Map in some ``Hom(Y, Z, category_left)``
    776          - ``left`` -- a Map in some ``Hom(X, Y, category_right)``
     778
     779        - ``self`` -- a Map in some ``Hom(Y, Z, category_left)``
     780        - ``left`` -- a Map in some ``Hom(X, Y, category_right)``
    777781
    778782        Returns the composition of ``right`` followed by ``self`` as a
    779783        morphism in ``Hom(X, Z, category)`` where ``category`` is the
     
    808812    def post_compose(self, left):
    809813        """
    810814        INPUT:
    811          - ``self`` -- a Map in some ``Hom(X, Y, category_right)``
    812          - ``left`` -- a Map in some ``Hom(Y, Z, category_left)``
     815
     816        - ``self`` -- a Map in some ``Hom(X, Y, category_right)``
     817        - ``left`` -- a Map in some ``Hom(Y, Z, category_left)``
    813818
    814819        Returns the composition of ``self`` followed by ``right`` as a
    815820        morphism in ``Hom(X, Z, category)`` where ``category`` is the
    816821        meet of ``category_left`` and ``category_right``.
    817822
    818         Caveat: see the current restrictions on :method:`Category.meet`
     823        Caveat: see the current restrictions on :meth:`Category.meet`
    819824
    820825        EXAMPLES::
    821826
     
    843848
    844849    def extend_domain(self, new_domain):
    845850        r"""
    846         INPUT:
    847             self          -- a member of Hom(Y, Z)
    848             new_codomain  -- an object X such that there is a canonical
    849                              coercion $\phi$ in Hom(X, Y)
     851        INPUT:
     852
     853        - ``self`` -- a member of Hom(Y, Z)
     854        - ``new_codomain`` -- an object X such that there is a canonical coercion
     855          `\phi` in Hom(X, Y)
    850856                             
    851857        OUTPUT:
    852             An element of Hom(X, Z) obtained by composing self with the $\phi$.
    853             If no canonical $\phi$ exists, a TypeError is raised.
     858
     859        An element of Hom(X, Z) obtained by composing self with `\phi`.  If
     860        no canonical `\phi` exists, a TypeError is raised.
    854861       
    855         EXAMPLES:
     862        EXAMPLES::
     863
    856864            sage: mor = CDF.coerce_map_from(RDF)
    857865            sage: mor.extend_domain(QQ)
    858866            Composite map:
     
    881889    def extend_codomain(self, new_codomain):
    882890        r"""
    883891        INPUT:
    884             self          -- a member of Hom(X, Y)
    885             new_codomain  -- an object Z such that there is a canonical
    886                              coercion $\phi$ in Hom(Y, Z)
     892
     893        - ``self`` -- a member of Hom(X, Y)
     894        - ``new_codomain`` -- an object Z such that there is a canonical coercion
     895          `\phi` in Hom(Y, Z)
    887896                             
    888         OUTPUT:
    889             An element of Hom(X, Z) obtained by composing self with the $\phi$.
    890             If no canonical $\phi$ exists, a TypeError is raised.
     897        OUTPUT:
     898
     899        An element of Hom(X, Z) obtained by composing self with `\phi`.  If
     900        no canonical `\phi` exists, a TypeError is raised.
    891901       
    892         EXAMPLES:
     902        EXAMPLES::
     903
    893904            sage: mor = QQ.coerce_map_from(ZZ)
    894905            sage: mor.extend_codomain(RDF)
    895906            Composite map:
     
    947958
    948959    def __pow__(Map self, n, dummy):
    949960        """
    950         TESTS:
     961        TESTS::
     962
    951963            sage: R.<x> = ZZ['x']
    952964            sage: phi = R.hom([x+1]); phi
    953965            Ring endomorphism of Univariate Polynomial Ring in x over Integer Ring
  • sage/rings/number_field/number_field.py

    diff --git a/sage/rings/number_field/number_field.py b/sage/rings/number_field/number_field.py
    a b  
    41884188
    41894189        from sage.matrix.constructor import matrix
    41904190
    4191         d = self.degree()
     4191        d = self.absolute_degree()
    41924192        Z_basis = self.integral_basis()
    41934193
    41944194        ## If self is totally real, then we can use (x*y).trace() as
     
    42274227           to calculate the Minkowski embedding. (See NOTE below.)
    42284228       
    42294229       
    4230         OUTPUT: The Gram matrix `[<x_i,x_j>]` of an LLL reduced
     4230        OUTPUT: The Gram matrix `[\langle x_i,x_j \rangle]` of an LLL reduced
    42314231        basis for the maximal order of self, where the integral basis for
    4232         self is given by `\{x_0, \dots, x_{n-1}\}`. Here < , > is the
    4233         usual inner product on `\RR^n`, and self is embedded in
    4234         `\RR^n` by the Minkowski embedding. See the docstring for
    4235         :meth:`Minkowski_embedding` for more information.
     4232        self is given by `\{x_0, \dots, x_{n-1}\}`. Here `\langle , \rangle` is
     4233        the usual inner product on `\RR^n`, and self is embedded in `\RR^n` by
     4234        the Minkowski embedding. See the docstring for
     4235        :meth:`NumberField_absolute.Minkowski_embedding` for more information.
    42364236       
    42374237        .. note::
    42384238
     
    42914291
    42924292        from sage.matrix.constructor import matrix
    42934293        from sage.misc.flatten import flatten
    4294         d = self.degree()
     4294        d = self.absolute_degree()
    42954295
    42964296        if self.is_totally_real():
    42974297            B = self.reduced_basis()
  • sage/rings/number_field/number_field_base.pyx

    diff --git a/sage/rings/number_field/number_field_base.pyx b/sage/rings/number_field/number_field_base.pyx
    a b  
    3434from sage.rings.ring cimport Field
    3535
    3636cdef class NumberField(Field):
     37    r"""
     38    Base class for all number fields.
     39    """
     40    # This token docstring is mostly there to prevent Sphinx from pasting in
     41    # the docstring of the __init__ method inherited from IntegralDomain, which
     42    # is rather confusing.
    3743
    3844    def ring_of_integers(self, *args, **kwds):
    3945        r"""
  • sage/rings/number_field/number_field_ideal.py

    diff --git a/sage/rings/number_field/number_field_ideal.py b/sage/rings/number_field/number_field_ideal.py
    a b  
    10431043        OUTPUT:
    10441044
    10451045        None.  This function simply caches the results: it sets
    1046         ``_ideal_class_log`` (see :meth:`_ideal_class_log`),
     1046        ``_ideal_class_log`` (see :meth:`ideal_class_log`),
    10471047        ``_is_principal`` (see :meth:`is_principal`) and
    10481048        ``_reduced_generators``.
    10491049        """
     
    11551155
    11561156    def S_ideal_class_log(self, S):
    11571157        r"""
    1158         S-class group version of :meth:`_ideal_class_log`.
     1158        S-class group version of :meth:`ideal_class_log`.
    11591159
    11601160        EXAMPLES::
    11611161
  • sage/rings/number_field/number_field_rel.py

    diff --git a/sage/rings/number_field/number_field_rel.py b/sage/rings/number_field/number_field_rel.py
    a b  
    609609        """
    610610        raise NotImplementedError, "For a relative number field you must use relative_degree or absolute_degree as appropriate"
    611611
    612     def maximal_order(self):
     612    def maximal_order(self, v=None):
    613613        """
    614614        Return the maximal order, i.e., the ring of integers of this
    615615        number field.
     
    632632            sage: K.<a,b> = NumberField([x^4 + 1, x^4 - 3])
    633633            sage: K.maximal_order()
    634634            Maximal Relative Order in Number Field in a with defining polynomial x^4 + 1 over its base field
     635
     636        An example with nontrivial ``v``::
     637
     638            sage: L.<a,b> = NumberField([x^2 - 3, x^2 - 5])
     639            sage: O3 = L.maximal_order([3])
     640            sage: O3.absolute_discriminant()
     641            3686400
     642            sage: O3.is_maximal()
     643            False
    635644        """
     645        v = self._normalize_prime_list(v)
    636646        try:
    637             return self.__maximal_order
     647            return self.__maximal_order[v]
    638648        except AttributeError:
     649            self.__maximal_order = {}
     650        except KeyError:
    639651            pass
    640         abs_order = self.absolute_field('z').maximal_order()
    641         self.__maximal_order = RelativeOrder(self, abs_order, is_maximal=True, check=False)
    642         return self.__maximal_order
     652        abs_order = self.absolute_field('z').maximal_order(v)
     653        if v == ():
     654            self.__maximal_order[v] = RelativeOrder(self, abs_order, is_maximal=True, check=False)
     655        else:
     656            self.__maximal_order[v] = RelativeOrder(self, abs_order, is_maximal=None, check=False)
     657        return self.__maximal_order[v]
    643658
    644659    def __reduce__(self):
    645660        """