Opened 10 years ago

Closed 10 years ago

#6458 closed defect (fixed)

[with patch, positive review] Inverse modulo an ideal in a relative number field

Reported by: davidloeffler Owned by: was
Priority: major Milestone: sage-4.1.1
Component: number theory Keywords:
Cc: Merged in: sage-4.1.1.alpha0
Authors: David Loeffler Reviewers: Nick Alexander
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

This adds a few lines to get inverse_mod working in the ring of integers of a relative field.

Attachments (2)

trac_6458-relative_ideal_inverse_mod.patch (2.2 KB) - added by davidloeffler 10 years ago.
patch against 4.1.alpha2
trac_6458-fix.patch (1.8 KB) - added by davidloeffler 10 years ago.
apply after previous patch

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by davidloeffler

patch against 4.1.alpha2

comment:1 Changed 10 years ago by davidloeffler

  • Summary changed from Inverse modulo an ideal in a relative number field to [with patch, needs review] Inverse modulo an ideal in a relative number field

comment:2 Changed 10 years ago by ncalexan

  • Authors set to David Loeffler
  • Reviewers set to Nick Alexander
  • Summary changed from [with patch, needs review] Inverse modulo an ideal in a relative number field to [with patch, needs work] Inverse modulo an ideal in a relative number field

These doctests don't actually assert that the results are correct. Could you add the few lines verifying that you're really getting a basis and really getting an inverse?

comment:3 Changed 10 years ago by ncalexan

Also, I get a doctest failure on sage.math. This could be transient -- this is with a slightly out of date sage build. But there's no way this will work on all architectures, so testing the property will be much better.

sage -t -long devel/sage/sage/rings/number_field/number_field_element.pyx
**********************************************************************
File "/scratch/ncalexan/sage-4.0.2.alpha1/devel/sage-main/sage/rings/number_field/number_field_element.pyx", line 3436:
    sage: OE(b - a).inverse_mod(17*b)
Expected:
    (-25*b + 26)*a + 51*b - 1
Got:
    (26*b - 25)*a - 51*b - 1

Changed 10 years ago by davidloeffler

apply after previous patch

comment:4 Changed 10 years ago by davidloeffler

  • Summary changed from [with patch, needs work] Inverse modulo an ideal in a relative number field to [with new patch, needs review] Inverse modulo an ideal in a relative number field

Good point; I have uploaded a second patch that adjusts the doctests as you suggest.

comment:5 Changed 10 years ago by ncalexan

  • Summary changed from [with new patch, needs review] Inverse modulo an ideal in a relative number field to [with patch, positive review] Inverse modulo an ideal in a relative number field

Beautiful.

comment:6 Changed 10 years ago by mvngu

David, the patch trac_6458-relative_ideal_inverse_mod.patch doesn't have your username. So I'm committing it in your name. Merged both patches in sage-4.1.1-alpha0. I can't close this ticket because I don't have the privilege to do so. Sorry, folks :-(

comment:7 Changed 10 years ago by mvngu

  • Merged in set to sage-4.1.1.alpha0
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.