# 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
|
|
244 | 244 | """ |
245 | 245 | self.__ideal = ideal |
246 | 246 | 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)) |
248 | 248 | AbelianGroupElement.__init__(self, parent, element) |
249 | 249 | |
250 | 250 | def _repr_(self): |
… |
… |
|
376 | 376 | sage: K.<w>=QuadraticField(-23) |
377 | 377 | sage: OK=K.ring_of_integers() |
378 | 378 | 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] |
386 | 381 | |
387 | 382 | sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G |
388 | 383 | Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072 |