#5453: [with patch, needs review] Create a ring for working with polynomials in
countably infinitely many variables
---------------------------------+------------------------------------------
 Reporter:  mhansen              |       Owner:  mhansen   
     Type:  enhancement          |      Status:  assigned  
 Priority:  major                |   Milestone:  sage-3.4.2
Component:  commutative algebra  |    Keywords:            
---------------------------------+------------------------------------------

Comment(by SimonKing):

 Recall that the starting point of my implementation was that the stretch
 method of the dense implementation requires too many resources in some
 cases.

 However, my stretch implementation is ''slower'' than yours, as long as
 the stretch factor is small and as long as one uses {{{timeit}}} and not
 {{{time}}}.

 The reason is: The critical part of the dense stretch method is the
 creation of a large polynomial ring. Once this is done, the ring is re-
 used, and it is very fast. In contrast, the sparse stretch method only
 creates a small ring (faster), but this has to be repeated over and over
 again.

 Therefore one has:
 {{{
 sage: X.<x,y> = SymmetricPolynomialRing(QQ)
 sage: Y.<a,b> = InfinitePolynomialRing(QQ)
 sage: timeit('t=x[10].stretch(10)')
 625 loops, best of 3: 194 µs per loop
 sage: timeit('t=a[10].stretch(10)')
 625 loops, best of 3: 92.8 µs per loop
 sage: timeit('t=(x[10]*y[5]+x[100]*y[83]).stretch(500)')
 125 loops, best of 3: 2.29 ms per loop
 sage: time t=(a[10]*b[5]+a[100]*b[83]).stretch(500) # fails after 2:30
 minutes:
 ------------------------------------------------------------
 Unhandled SIGSEGV: A segmentation fault occured in SAGE.
 This probably occured because a *compiled* component
 of SAGE has a bug in it (typically accessing invalid memory)
 or is not properly wrapped with _sig_on, _sig_off.
 You might want to run SAGE under gdb with 'sage -gdb' to debug this.
 SAGE will now terminate (sorry).
 ------------------------------------------------------------
 }}}

 So again, this is an argument to include ''both'' implementation into
 Sage. That way, one can pick the method that is better for the respective
 application.

 But who will review our patches? I guess neither of us. Should we ping
 malb?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5453#comment:18>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to