Ticket #11130: 11130_sagelib32.patch

File 11130_sagelib32.patch, 4.1 KB (added by cremona, 8 years ago)

Apply after previous

• sage/rings/integer.pyx

```# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1303940454 -3600
# Node ID 926ff153ea9fe5503941514cd8a2e8366713518b
# Parent  ab527dc14dbbb2ca2572f816bc8674805984a74f
11130: fine tuning for 32-bit doctests

diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/integer.pyx```
 a sage: 3._bnfisnorm(QuadraticField(-1, 'i')) (1, 3) sage: 7._bnfisnorm(CyclotomicField(7)) (-zeta7 + 1, 1) (-zeta7 + 1, 1)            # 64-bit (-zeta7^5 + zeta7^4, 1)    # 32-bit """ from sage.rings.rational_field import QQ return QQ(self)._bnfisnorm(K, certify=certify, extra_primes=extra_primes)
• sage/rings/number_field/number_field.py

`diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field.py`
 a sage: pari('setrand(2)') sage: L. = K.extension(x^2 - 7) sage: L.factor(a + 1) (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) sage: f = L.factor(a + 1); f (Fractional ideal (-1/2*a*b - a - 1/2)) * (Fractional ideal (1/2*b + 1/2*a - 1)) # 32-bit (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) # 64-bit sage: f.value() == a+1 True It doesn't make sense to factor the ideal (0), so this raises an error::
• sage/rings/number_field/number_field_element.pyx

`diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field_element.pyx`
 a sage: K. = NumberField([x^2 - 2, x^2 - 3]) sage: L. = K.extension(x^3 + 2) sage: t = (2*a + b)._rnfisnorm(L); t[1] (b - 2)*a + 2*b - 3 sage: t[0].norm(K)*t[1] 2*a + b sage: s = 2*a + b sage: t = s._rnfisnorm(L) sage: t[1] == 1 # True iff s is a norm False sage: s == t[0].norm(K)*t[1] True AUTHORS:
• sage/rings/polynomial/polynomial_quotient_ring.py

`diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/polynomial/polynomial_quotient_ring.py`
 a sage: R. = K[] sage: S. = R.quotient(x^2 + 23) sage: S.S_class_group([]) [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 32-bit [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 64-bit sage: S.S_class_group([K.ideal(3, a-1)]) [] sage: S.S_class_group([K.ideal(2, a+1)]) [] sage: S.S_class_group([K.ideal(a)]) [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 32-bit [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 64-bit Now we take an example over a nontrivial base with two factors, each contributing to the class group:: sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1)], 3) [2, -a - 1] sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3) [2, -a - 1, -a]  # 32-bit [2, -a - 1, a]   # 64-bit [2, -a - 1, a] """ units, clgp_gens = self._S_class_group_and_units(tuple(S), proof=proof)