Skip to content

Commit

Permalink
Trac #25934: Problem displaying a number field (fractional) ideal
Browse files Browse the repository at this point in the history
With 8.3.rc1:
{{{
sage: K.<a> = NumberField(x^6 - x^5 - 5*x^4 + 4*x^3 + 6*x^2 - 3*x - 1)
sage: K.ideal(1,1)
}}}
takes a long time to return -- why?  Using %time it immediately shows
1ms for the second line but the prompt does not appear until *minutes*
later.  So it is the display of the ideal which is triggering something
long.  In a new session:
{{{
sage: K.<a> = NumberField(x^6 - x^5 - 5*x^4 + 4*x^3 + 6*x^2 - 3*x - 1)
sage: %time I=K.ideal([1,1])
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 1.08 ms
sage: %time I
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 10 µs
<long wait>
}}}

URL: https://trac.sagemath.org/25934
Reported by: cremona
Ticket author(s): John Cremona
Reviewer(s): Frédéric Chapoton, Samuel Lelièvre
  • Loading branch information
Release Manager committed Mar 1, 2021
2 parents 826e5c1 + 1e45e42 commit da639c3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sage/rings/number_field/number_field.py
Expand Up @@ -3475,6 +3475,16 @@ def ideal(self, *gens, **kwds):
Fractional ideal (i + 2)
sage: K.ideal(0)
Ideal (0) of Number Field in i with defining polynomial x^2 + 1
TESTS:
Check that :trac:`25934` is fixed::
sage: x = polygen(QQ)
sage: K.<a> = NumberField(x^6 - x^5 - 5*x^4 + 4*x^3 + 6*x^2 - 3*x - 1)
sage: K.ideal(1,1)
Fractional ideal (1)
"""
try:
return self.fractional_ideal(*gens, **kwds)
Expand Down

0 comments on commit da639c3

Please sign in to comment.