# Changes between Version 9 and Version 17 of Ticket #13213

Ignore:
Timestamp:
08/08/12 15:31:40 (7 years ago)
Comment:

Unmodified
Added
Removed
Modified
• ## Ticket #13213

• Property Status changed from `needs_work` to `needs_review`
• ## Ticket #13213 – Description

 v9 The order of quadratic field is not induced from the order of RR and CC (when there is an embedding). More precisely we have The order of number field with specified embedding is not induced from the order of RR and CC. More precisely we have {{{ sage: K. = NumberField(x^2 - 2, 'sqrt2', embedding=1.4142) sage: sqrt2 < 100 False sage: K. = NumberField(x^3 - 2, 's', embedding=1.26) sage: s < 100 False }}} which is not compatible (!) with the order of CC. There is a patch for quadratic field. Another will come for general number fields. Note that this patch is partly a duplicate because of #7160. The modifications for the order on complex number field modify the behavior of many commands (output order). The ticket implements the order for quadratic field (for which comparisons are made using only operations on integers) and a patch for generic number fields with specified real embedding (for which comparisons are made using successive approximations). The lost of speed is about x5 for positive discriminant and almost nothing for negative ones Note: * this patch is partly a duplicate because of #7160 * the modifications for quadratic field field modify the behavior of many commands (especially about output order). ---- The lost of speed is about x10 for quadratic field and about x100 for generic real number field. {{{ sage: K. = QuadraticField(2,'sqrt2',embedding=1.4142) sage: K. = QuadraticField(2, 'sqrt2', embedding=1.4142) sage: a = (3*sqrt2 + 18)/7 sage: b = (5*sqrt2 + 14)/5 sage: %timeit a < b 625 loops, best of 3: 2.36 µs per loop 625 loops, best of 3: 4.32 µs per loop sage: K. = QuadraticField(-2) sage: a=3*s+2/4 sage: b=5/7*s+1/3 sage: a = 3*s + 2/4 sage: b = 5/7*s + 1/3 sage: %timeit a < b 625 loops, best of 3: 600 ns per loop 625 loops, best of 3: 1.42 µs per loop sage: K. = NumberField(x^3-3, 's', embedding=1.26) sage: a = 3/15*s**2 - 4/7*s + 2/3 sage: b = -1/2*s**2 + s - 13/5 sage: %timeit a < b 625 loops, best of 3: 49.6 µs per loop }}} Timings without the patch sage: K. = QuadraticField(-2) sage: a=3*s+2/4 sage: b=5/7*s+1/3 sage: a = 3*s+2/4 sage: b = 5/7*s+1/3 sage: %timeit a < b 625 loops, best of 3: 488 ns per loop sage: K.=NumberField(x^3-3, 's',embedding=1.26) sage: a = 3/15*s**2 - 4/7*s + 2/3 sage: b = -1/2*s**2 + s - 13/5 sage: %timeit a < b 625 loops, best of 3: 845 ns per loop }}}