Ticket #14269: trac_14269_rebased.patch

File trac_14269_rebased.patch, 2.3 KB (added by chapoton, 6 years ago)

replaces previous patch

  • sage/libs/pari/gen.pyx

    # HG changeset patch
    # User David Loeffler <d.loeffler.01@cantab.net>
    # Date 1363276275 0
    # Node ID 429a675a31bdf6334f529952f7b05c7fba7aa54b
    # Parent  887986a93a008399a3d44f5d523885c5569e36d8
    #14269: ray class numbers modulo ideals
    * * *
    trac #14269 : correct the sig_on command
    
    diff --git a/sage/libs/pari/gen.pyx b/sage/libs/pari/gen.pyx
    a b cdef class gen(sage.structure.element.Ri 
    69606960        pari_catch_sig_on()
    69616961        return self.new_gen(bnfisunit(self.g, t0))
    69626962
     6963    def bnrclassno(self, I):
     6964        r"""
     6965        Return the order of the ray class group of self modulo ``I``.
     6966
     6967        INPUT:
     6968
     6969        - ``self``: a pari "BNF" object representing a number field
     6970        - ``I``: a pari "BID" object representing an ideal of self
     6971
     6972        OUTPUT: integer
     6973
     6974        TESTS::
     6975
     6976            sage: K.<z> = QuadraticField(-23)
     6977            sage: p = K.primes_above(3)[0]
     6978            sage: K.pari_bnf().bnrclassno(p._pari_bid_())
     6979            3
     6980        """
     6981        t0GEN(I)
     6982        pari_catch_sig_on()
     6983        return self.new_gen(bnrclassno(self.g, t0))
     6984
    69636985    def dirzetak(self, n):
    69646986        t0GEN(n)
    69656987        pari_catch_sig_on()
  • 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 class NumberFieldFractionalIdeal(NumberF 
    30633063        """
    30643064        return ZZ(self.pari_prime().pr_get_f())
    30653065
     3066    def ray_class_number(self):
     3067        r"""
     3068        Return the order of the ray class group modulo this ideal. This is a
     3069        wrapper around Pari's ``bnrclassno()`` function.
     3070       
     3071        EXAMPLE::
     3072       
     3073            sage: K.<z> = QuadraticField(-23)
     3074            sage: p = K.primes_above(3)[0]
     3075            sage: p.ray_class_number()
     3076            3
     3077
     3078            sage: x = polygen(K)
     3079            sage: L.<w> = K.extension(x^3 - z)
     3080            sage: I = L.ideal(5)         
     3081            sage: I.ray_class_number()
     3082            5184
     3083        """
     3084        bid = self._pari_bid_()
     3085        return ZZ(self.number_field().pari_bnf().bnrclassno(bid))
     3086
    30663087def is_NumberFieldFractionalIdeal(x):
    30673088    """
    30683089    Return True if x is a fractional ideal of a number field.