# 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
|
b
|
|
4387 | 4387 | sage: 3._bnfisnorm(QuadraticField(-1, 'i')) |
4388 | 4388 | (1, 3) |
4389 | 4389 | sage: 7._bnfisnorm(CyclotomicField(7)) |
4390 | | (-zeta7 + 1, 1) |
| 4390 | (-zeta7 + 1, 1) # 64-bit |
| 4391 | (-zeta7^5 + zeta7^4, 1) # 32-bit |
4391 | 4392 | """ |
4392 | 4393 | from sage.rings.rational_field import QQ |
4393 | 4394 | return QQ(self)._bnfisnorm(K, certify=certify, extra_primes=extra_primes) |
diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field.py
a
|
b
|
|
3613 | 3613 | |
3614 | 3614 | sage: pari('setrand(2)') |
3615 | 3615 | sage: L.<b> = K.extension(x^2 - 7) |
3616 | | sage: L.factor(a + 1) |
3617 | | (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) |
| 3616 | sage: f = L.factor(a + 1); f |
| 3617 | (Fractional ideal (-1/2*a*b - a - 1/2)) * (Fractional ideal (1/2*b + 1/2*a - 1)) # 32-bit |
| 3618 | (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) # 64-bit |
| 3619 | sage: f.value() == a+1 |
| 3620 | True |
3618 | 3621 | |
3619 | 3622 | It doesn't make sense to factor the ideal (0), so this raises an error:: |
3620 | 3623 | |
diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field_element.pyx
a
|
b
|
|
1139 | 1139 | |
1140 | 1140 | sage: K.<a, b> = NumberField([x^2 - 2, x^2 - 3]) |
1141 | 1141 | sage: L.<c> = K.extension(x^3 + 2) |
1142 | | sage: t = (2*a + b)._rnfisnorm(L); t[1] |
1143 | | (b - 2)*a + 2*b - 3 |
1144 | | sage: t[0].norm(K)*t[1] |
1145 | | 2*a + b |
| 1142 | sage: s = 2*a + b |
| 1143 | sage: t = s._rnfisnorm(L) |
| 1144 | sage: t[1] == 1 # True iff s is a norm |
| 1145 | False |
| 1146 | sage: s == t[0].norm(K)*t[1] |
| 1147 | True |
1146 | 1148 | |
1147 | 1149 | AUTHORS: |
1148 | 1150 | |
diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/polynomial/polynomial_quotient_ring.py
a
|
b
|
|
735 | 735 | sage: R.<x> = K[] |
736 | 736 | sage: S.<xbar> = R.quotient(x^2 + 23) |
737 | 737 | sage: S.S_class_group([]) |
738 | | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] |
| 738 | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 32-bit |
| 739 | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 64-bit |
739 | 740 | sage: S.S_class_group([K.ideal(3, a-1)]) |
740 | 741 | [] |
741 | 742 | sage: S.S_class_group([K.ideal(2, a+1)]) |
742 | 743 | [] |
743 | 744 | sage: S.S_class_group([K.ideal(a)]) |
744 | | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] |
| 745 | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 32-bit |
| 746 | [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 64-bit |
745 | 747 | |
746 | 748 | Now we take an example over a nontrivial base with two factors, each |
747 | 749 | contributing to the class group:: |
… |
… |
|
1134 | 1136 | sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1)], 3) |
1135 | 1137 | [2, -a - 1] |
1136 | 1138 | sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3) |
1137 | | [2, -a - 1, -a] # 32-bit |
1138 | | [2, -a - 1, a] # 64-bit |
| 1139 | [2, -a - 1, a] |
1139 | 1140 | |
1140 | 1141 | """ |
1141 | 1142 | units, clgp_gens = self._S_class_group_and_units(tuple(S), proof=proof) |