Opened 13 years ago

Closed 13 years ago

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

Reported by: Owned by: David Loeffler William Stein major sage-4.1.1 number theory sage-4.1.1.alpha0 David Loeffler Nick Alexander N/A

### Description

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

### Changed 13 years ago by David Loeffler

patch against 4.1.alpha2

### comment:1 Changed 13 years ago by David Loeffler

Summary: Inverse modulo an ideal in a relative number field → [with patch, needs review] Inverse modulo an ideal in a relative number field

### comment:2 Changed 13 years ago by ncalexan

Authors: → David Loeffler → Nick Alexander [with patch, needs review] Inverse modulo an ideal in a relative number field → [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 13 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 13 years ago by David Loeffler

apply after previous patch

### comment:4 Changed 13 years ago by David Loeffler

Summary: [with patch, needs work] Inverse modulo an ideal in a relative number field → [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 13 years ago by ncalexan

Summary: [with new patch, needs review] Inverse modulo an ideal in a relative number field → [with patch, positive review] Inverse modulo an ideal in a relative number field

Beautiful.

### comment:6 Changed 13 years ago by Minh Van Nguyen

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 13 years ago by Minh Van Nguyen

Merged in: → sage-4.1.1.alpha0 → fixed new → closed
Note: See TracTickets for help on using tickets.