Ticket #11234: trac_11234_ideal_class_order.patch

File trac_11234_ideal_class_order.patch, 1.4 KB (added by fwclarke, 11 years ago)
  • sage/rings/number_field/class_group.py

    # HG changeset patch
    # User Francis Clarke <francis.w.clarke@gmail.com>
    # Date 1303637768 -3600
    # Node ID 1543815dba15d7d7963cbdbc84eaf257a2da9d54
    # Parent  361a4ad7d52c69b64ae2e658ffd0820af0d87e93
    #11234: fix order of ideal classes
    
    diff -r 361a4ad7d52c -r 1543815dba15 sage/rings/number_field/class_group.py
    a b  
    244244        """
    245245        self.__ideal = ideal
    246246        if element is None:
    247             element = ideal._ideal_class_log(proof = parent._proof_flag)
     247            element = map(int, ideal._ideal_class_log(proof=parent._proof_flag))
    248248        AbelianGroupElement.__init__(self, parent, element)
    249249
    250250    def _repr_(self):
     
    376376            sage: K.<w>=QuadraticField(-23)
    377377            sage: OK=K.ring_of_integers()
    378378            sage: C=OK.class_group()
    379             sage: h=C.order(); h
    380             3
    381             sage: P2a,P2b=[P for P,e in (2*OK).factor()]
    382             sage: c=C(P2a); c
    383             Fractional ideal class (2, 1/2*w - 1/2)
    384             sage: c.order()
    385             3
     379            sage: [c.order() for c in C]
     380            [1, 3, 3]
    386381
    387382            sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G
    388383            Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072