#6046: [with patch, needs review] Implement local and global heights for number
field elements
---------------------------+------------------------------------------------
Reporter: cremona | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.0.1
Component: number theory | Keywords: number field height
---------------------------+------------------------------------------------
Comment(by cremona):
Replying to [comment:3 fwclarke]:
> Replying to [comment:2 cremona]:
>
> > Your comments and fixes for numerator/denominator ideals are *wrong*!
number field elements have numerators and denominators which are dependent
on the basis used to represent them, and are not what I meant or need --
as I thought my doctest made clear!
>
> I don't see how this can be. The functions I'm calling are not basis-
dependent.
> They are essentially the same as yours, but for ideals rather than
elements, and the code is nearly identical.
> E.g., for `denominator_ideal(self)` (leaving aside the non-zero check)
you do
> {{{
> K = self.number_field()
> one = K.ideal(1)
> return one / (one + K.ideal(self))
> }}}
> while I've suggested
> {{{
> return self.number_field().ideal(self).denominator()
> }}}
> and for a fractional ideal `self` the `denominator` function returns
> {{{
> try:
> return self._denom_ideal
> except AttributeError:
> pass
> self._denom_ideal = (self +
self.number_field().unit_ideal())**(-1)
> return self._denom_ideal
> }}}
>
> The case for using the ideal `denominator` and `numerator` functions is,
I think,
> (i) the general preference for not implementing the same thing twice;
> (ii) the fact that the functions in `number_field_ideal.py` cache their
output.
>
My mistake, apologies. I misread your patch and thought that you called
denominator() before ideal(), while you did te opposite, which I do not
argue with.
Now I am wondering how I did not notice that the functions existed
already! It is almost not worth implementing the denominator_ideal()
function, but as it is now there I guess we can keep it.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6046#comment:5>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---