Ticket #2329: 2329_selmer.patch

File 2329_selmer.patch, 2.3 KB (added by jdemeyer, 11 years ago)

Additional patch

  • sage/rings/number_field/number_field.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1299233596 -3600
    # Node ID 03f52012aebc527cb4480ca0550f19beaaa85f22
    # Parent  ba1e23318d3cd145c9538b9249c3b33f4f7f083d
    #2329: Rewrite Selmer group test to take care of random sign
    
    diff -r ba1e23318d3c -r 03f52012aebc sage/rings/number_field/number_field.py
    a b  
    30633063            [2]
    30643064            sage: K.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1)], 3)
    30653065            [2, a + 1]
    3066             sage: K.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3)
    3067             [2, a + 1, -a]  # 32-bit
    3068             [2, a + 1, a]   # 64-bit
     3066            sage: K.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3)  # random signs
     3067            [2, a + 1, a]
    30693068            sage: K.<a> = NumberField(polygen(QQ))
    30703069            sage: K.selmer_group([],5)
    30713070            []
    30723071
     3072        TESTS::
     3073
     3074            sage: K.<a> = QuadraticField(-5)
     3075            sage: S = K.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3)
     3076            sage: S == [2, a + 1, a] or S == [2, a + 1, -a]
     3077            True
    30733078        """
    30743079        units, clgp_gens = self._S_class_group_and_units(tuple(S), proof=proof)
    30753080        gens = []
  • sage/rings/rational.pyx

    diff -r ba1e23318d3c -r 03f52012aebc sage/rings/rational.pyx
    a b  
    12191219        The number field doesn't have to be defined by an
    12201220        integral polynomial::
    12211221           
    1222             sage: (1/5).is_norm(QuadraticField(5/4, 'a'), element=True)
    1223             (True, -1/5*a + 1/2)
     1222            sage: B, e = (1/5).is_norm(QuadraticField(5/4, 'a'), element=True)
     1223            sage: B
     1224            True
     1225            sage: e.norm()
     1226            1/5
    12241227           
    12251228        A non-Galois number field::
    12261229       
    1227             sage: K.<b> = NumberField(x^3-2)
    1228             sage: x, y = (3/5).is_norm(K, element=True); x
     1230            sage: K.<a> = NumberField(x^3-2)
     1231            sage: B, e = (3/5).is_norm(K, element=True); B
    12291232            True
    1230             sage: y.norm()
     1233            sage: e.norm()
    12311234            3/5
    12321235           
    12331236            sage: 7.is_norm(K)