#9492: add computation of swinnerton-dyer polynomials to sage
---------------------------+------------------------------------------------
Reporter: was | Owner: jason
Type: enhancement | Status: new
Priority: minor | Milestone: sage-4.5.1
Component: misc | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Comment(by was):
I'm at a Singular conference, so I decided to try this problem using
Singular polynomial quotient rings. It's pretty good, though it doesn't
beat interval arithmetic speed-wise.
{{{
def sdpoly6(n):
R = PolynomialRing(QQ,n+1,names='x')
x = R.gens()
v = primes_first_n(n)
I = R.ideal([ x[i]^2-v[i] for i in range(len(v)) ])
S = R.quotient(I)
x = S.gens()
C = cartesian_product_iterator([[-1,1]]*n)
f = prod([ x[-1] + sum(s[i]*x[i] for i in range(n)) for s in C])
return f
}}}
Some timings:
{{{
sage: time a = sdpoly6(8)
Time: CPU 0.71 s, Wall: 0.71 s
sage: time a = sdpoly6(9)
Time: CPU 3.44 s, Wall: 3.47 s
sage: time a10 = sdpoly6(10)
Time: CPU 29.03 s, Wall: 29.19 s
}}}
Very impressive for something non-numerical, IMHO...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9492#comment:6>
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 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.