#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.1
Component:  commutative algebra  |    Keywords:            
---------------------------------+------------------------------------------

Comment(by SimonKing):

 Replying to [comment:9 SimonKing]:
 > I suggest to use the method {{{change_ring()}}} of polynomial rings in
 the background. Then, {{{stretch()}}} could be implemented along these
 lines:
 ...

 It seems that indeed the {{{while}}} loop that I gave above is both faster
 and goes further when using my suggestion:
 {{{
 sage: R.<x1,y1>=QQ[]
 sage: p=x1
 sage: S=R.change_ring(names=['x2','y2'])
 sage: n=2
 sage: while(1):
 ....:     p=S(p)
 ....:     n=2*n
 ....:     S=S.change_ring(names=['x%d'%(n),'y%d'%(n)])
 ....:     print p
 ....:
 x2
 x4
 x8
 x16
 x32
 x64
 x128
 x256
 x512
 x1024
 x2048
 x4096
 x8192
 x16384
 x32768
 x65536
 x131072
 x262144
 x524288
 x1048576
 x2097152
 x4194304
 x8388608
 x16777216
 x33554432
 x67108864
 x134217728
 x268435456
 x536870912
 x1073741824
 x2147483648
 x4294967296
 x8589934592
 x17179869184
 x34359738368
 x68719476736
 x137438953472
 x274877906944
 x549755813888
 x1099511627776
 x2199023255552
 x4398046511104
 x8796093022208
 x17592186044416
 x35184372088832
 x70368744177664
 x140737488355328
 x281474976710656
 x562949953421312
 x1125899906842624
 x2251799813685248
 x4503599627370496
 x9007199254740992
 x18014398509481984
 x36028797018963968
 x72057594037927936
 x144115188075855872
 x288230376151711744
 x576460752303423488
 x1152921504606846976
 x2305843009213693952
 }}}

 Only at that point was a type error, because the next number is not an
 {{{int}}} anymore.

 So, my suggestions are:
  * An {{{InfinitePolynomialRing}}} should ''not'' have an underlying
 polynomial ring by itself.
  * Only the ''elements'' of an {{{InfinitePolynomialRing}}} should have an
 underlying polynomial ring.

 The advantage of my suggestion is that the rings become much smaller.

 Cheers,
      Simon

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