#16014: Improvements to discriminant computation
-------------------------------------+-------------------------------------
Reporter: gagern | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.2
Component: algebra | Resolution:
Keywords: discriminant | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/gagern/ticket/16014 | 66a8c198b7aa57f4567906baf964b30b88f4048f
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by pbruin):
This looks good and passes doctests. However, I'm wondering if you
couldn't be convinced to adopt John Cremona's
[https://groups.google.com/d/msg/sage-support/fABfhHyioa0/kPlhGN4Ri-EJ
proposal on sage-dev] to have a separate function
`generic_univariate_discriminant()` (or similar), which caches its output,
and hardcodes it for small degrees. This would be useful for two reasons:
- computing the universal discriminant takes a substantial amount of time
(several seconds for degree 7, several minutes for degree 8, probably
extremely long for higher degrees);
- it would make the `discriminant()` method cleaner and therefore more
attractive to add an `algorithm` flag and/or a more sophisticated
algorithm selection heuristic.
I would think `sage.rings.polynomial.polynomial_element` would be a
logical place for such a function, although `sage.rings.invariant_theory`
would also be defensible.
Here is a simple function to compute the universal discriminant:
{{{
#!python
def universal_discriminant(n):
r"""Return the discriminant of the 'universal' univariate polynomial
`a_n x^n + \cdots + a_1 x + a_0` in `\ZZ[a_0, \ldots, a_n][x]`."""
R = PolynomialRing(ZZ, n + 1, 'a')
S = PolynomialRing(R, 'x')
return S(list(R.gens())).discriminant()
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/16014#comment:5>
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.
For more options, visit https://groups.google.com/d/optout.