#14489: _S_class_group_and_units is mathematically incorrect
---------------------------------+------------------------------------------
Reporter: robharron | Owner: davidloeffler
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.10
Component: number fields | Resolution:
Keywords: S-class group | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Robert Harron | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by tscrim):
Hey Robert,
Replying to [comment:3 robharron]:
> (1) Re the doctests: the first doctest (which was already there) is an
example of the case len(S) == 0. The second doctest (which was already
there) is when S contains only principal ideals and so the J you come
across is necessarily already principal. Also, in the doctest I added, for
the second ideal (namely (19, 1/13*a^2^ - 45/13*a - 332/13)) the J you get
is principal. So, your second point is already covered. Should I add
comments to this effect in the docs?
No, this is likely clear to those in the field.
> (2) Re import: So, I have no real idea when to import in the module and
when to import in the function. Is there somewhere to read about that.
It's a matter of when the module with the class/function is loaded into
sage. If it's at the module level, it is imported when the module is
imported (which is anytime any part of a module is imported [at startup,
this is in an `all.py` file]). Thus there are two reasons not to import
something at the module level:
1. It is a very large import that is not happening otherwise and is
typically not needed until called. These large imports causes sage to take
longer to startup (ex. numpy is not imported at startup).
2. It would cause a circular dependency, in which case sage will fail to
start.
I don't know of a specific place offhand to read on this...
> I guess you're saying that in the case of the two functions at hand,
these are imported by sage when you boot it and so really are already
loaded and so I might as well import them at the module level?
Correct, this will make the function (marginally) faster each time it's
called.
Best,[[BR]]
Travis
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14489#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.