Ticket #6458 (closed defect: fixed)

Opened 14 months ago

Last modified 14 months ago

[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: Author(s): David Loeffler
Report Upstream: Reviewer(s): Nick Alexander
Merged in: sage-4.1.1.alpha0 Work issues:

Description

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

Attachments

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

Change History

Changed 14 months ago by davidloeffler

patch against 4.1.alpha2

Changed 14 months 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

Changed 14 months ago by ncalexan

  • reviewer 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
  • author set to David Loeffler

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?

Changed 14 months 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 14 months ago by davidloeffler

apply after previous patch

Changed 14 months 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.

Changed 14 months 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.

Changed 14 months 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 :-(

Changed 14 months ago by mvngu

  • status changed from new to closed
  • resolution set to fixed
  • merged set to sage-4.1.1.alpha0
Note: See TracTickets for help on using tickets.