[sage-devel] Re: Power series rings
> sage: K. = LaurentSeriesRing(QQ) > sage: R. = PowerSeriesRing(QQ) > 3. coercion to R does not work (R(u) fails trying to coerce to QQ). I guess this is the same sort of problem as what I reported in trac #5468. chris. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
I think so. But then you should be working in a ring of truncated power series (i.e. k[x]/(x^a)). This seems conceptually different from working in a ring of power series where you only know the elements up to a given precision On Mar 14, 9:53 pm, John Cremona wrote: > David says in the docstring for a possible log() function " TODO: > verify that the base ring is a QQ-algebra." Now I recall reading > (quite recent) papers of Morain et al on computing isogenies between > elliptic curves over finite fields where it is useful to be able to > take truncated logs of power series where the truncation occurs early > enough that division by the characteristic does not happen. Is it > possible to allow for that in a mathematically consistent way? > > John > > 2009/3/14 William Stein : > > > > > On Fri, Mar 13, 2009 at 5:00 PM, David Kohel wrote: > > >> Hi, > > >> I am finding problems, holes, or missing features in power series > >> rings > >> and Laurent series rings. > > >> sage: K. = LaurentSeriesRing(QQ) > >> sage: R. = PowerSeriesRing(QQ) > > >> 1. exp(t) is defined but exp(u) is not. > >> 2. log(1 - t) and log(1-u) -- I started filling in this gap (below) > >> for > >> Laurent series but ran into more problems. > >> 3. coercion to R does not work (R(u) fails trying to coerce to QQ). > > >> The style of implementations of source code look completely > >> independent. > >> I would like to have R == K.ring_of_integers() be defined and True > >> (maybe > >> if I call the variables the same). But the lack of coercion suggests > >> that > >> these where not designed together, as do the functions for creating > >> error > >> terms O(t^n). > > >> The names of the files hint at a design break: > > >> sage: type(t) > >> > >> sage: type(u) > >> > > >> Now there also exists a power_series_ring_element file, but it > >> implements > >> a class PowerSeries inheritted from PowerSeries_poly (in a separate > >> file). > >> There is also a power_series_mpoly, which must either be an attempt > >> at > >> multivariate power series or a sparse power series. > > >> Is there a reason for this split, and if so, why do Laurent series not > >> follow > >> the same dichotomy? > > > At least two different people probably implemented the code. You > > might start up sage and type > > > sage: hg_sage.browse() > > > or go to > > >http://hg.sagemath.org/sage-main/file/5c72dbb92d82/sage/rings > > > and start browsing around so you can see exactly who edited the files > > you're looking at and when. You can also do the following at the > > command line in the rings directory to see the history of any given > > file: > > > $ hg log laurent_series_ring.py |more > > > changeset: 11695:3e8e9cdd9715 > > user: Mike Hansen > > date: Tue Feb 24 09:13:31 2009 -0800 > > summary: Converting sage.rings.* docstrings to Sphinx > > > changeset: 8413:f4aeaf9e22c6 > > user: Martin Albrecht > > date: Sun Jan 20 16:44:08 2008 + > > summary: allow rational functions to be coerced into > > LaurentSeriesRings (fixes 1/3 of #1793) > > > changeset: 5481:1fb33b78a725 > > user: Robert Bradshaw > > date: Wed Jul 18 01:35:31 2007 -0700 > > summary: Fix mathematical error I stupidly introduced > > > You can do > > > $ hg export 8413 > > > to see the actual 8413 patch (say). > > >> I think I need to understand what is intended before hacking around > >> all > >> of these classes. > > >> Cheers, > >> David > > >> P.S. A first start with log -- is there a more efficient algorithm > >> already > >> implemented somewhere or does someone want to put in place a more > >> efficient algorithm? > > >> {{{ > >> def log > >> (self): > > >> """ > >> The logarithm of the power series t, which must be in a > >> neighborhood of 1. > > >> TODO: verify that the base ring is a QQ-algebra. > > >> """ > >> u = > >> self-1 > >> if u.valuation() <= > >> 0: > >> raise AttributeError, "Argument t must satisfy val(t-1) > > >> 0." > >> N = self.prec > >> () > >> if isinstance(N, > >> sage.rings.infinity.PlusInfinity): > >> N = self.parent().default_prec > >> () > >> u.add_bigoh > >> (N) > >> err = LaurentSeries(self.parent(), 0, 0).add_bigoh > >> (N) > >> return sum([ u**k/k + err for k in range > >> (1,N) ]) > >> }}} > > > -- > > William Stein > > Associate Professor of Mathematics > > University of Washington > >http://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
David says in the docstring for a possible log() function " TODO: verify that the base ring is a QQ-algebra." Now I recall reading (quite recent) papers of Morain et al on computing isogenies between elliptic curves over finite fields where it is useful to be able to take truncated logs of power series where the truncation occurs early enough that division by the characteristic does not happen. Is it possible to allow for that in a mathematically consistent way? John 2009/3/14 William Stein : > > On Fri, Mar 13, 2009 at 5:00 PM, David Kohel wrote: >> >> Hi, >> >> I am finding problems, holes, or missing features in power series >> rings >> and Laurent series rings. >> >> sage: K. = LaurentSeriesRing(QQ) >> sage: R. = PowerSeriesRing(QQ) >> >> 1. exp(t) is defined but exp(u) is not. >> 2. log(1 - t) and log(1-u) -- I started filling in this gap (below) >> for >> Laurent series but ran into more problems. >> 3. coercion to R does not work (R(u) fails trying to coerce to QQ). >> >> The style of implementations of source code look completely >> independent. >> I would like to have R == K.ring_of_integers() be defined and True >> (maybe >> if I call the variables the same). But the lack of coercion suggests >> that >> these where not designed together, as do the functions for creating >> error >> terms O(t^n). >> >> The names of the files hint at a design break: >> >> sage: type(t) >> >> sage: type(u) >> >> >> Now there also exists a power_series_ring_element file, but it >> implements >> a class PowerSeries inheritted from PowerSeries_poly (in a separate >> file). >> There is also a power_series_mpoly, which must either be an attempt >> at >> multivariate power series or a sparse power series. >> >> Is there a reason for this split, and if so, why do Laurent series not >> follow >> the same dichotomy? > > At least two different people probably implemented the code. You > might start up sage and type > > sage: hg_sage.browse() > > or go to > > http://hg.sagemath.org/sage-main/file/5c72dbb92d82/sage/rings > > and start browsing around so you can see exactly who edited the files > you're looking at and when. You can also do the following at the > command line in the rings directory to see the history of any given > file: > > $ hg log laurent_series_ring.py |more > > > changeset: 11695:3e8e9cdd9715 > user: Mike Hansen > date: Tue Feb 24 09:13:31 2009 -0800 > summary: Converting sage.rings.* docstrings to Sphinx > > changeset: 8413:f4aeaf9e22c6 > user: Martin Albrecht > date: Sun Jan 20 16:44:08 2008 + > summary: allow rational functions to be coerced into > LaurentSeriesRings (fixes 1/3 of #1793) > > changeset: 5481:1fb33b78a725 > user: Robert Bradshaw > date: Wed Jul 18 01:35:31 2007 -0700 > summary: Fix mathematical error I stupidly introduced > > You can do > > $ hg export 8413 > > to see the actual 8413 patch (say). > >> >> I think I need to understand what is intended before hacking around >> all >> of these classes. >> >> Cheers, >> David >> >> P.S. A first start with log -- is there a more efficient algorithm >> already >> implemented somewhere or does someone want to put in place a more >> efficient algorithm? >> >> {{{ >> def log >> (self): >> >> """ >> The logarithm of the power series t, which must be in a >> neighborhood of 1. >> >> TODO: verify that the base ring is a QQ-algebra. >> >> """ >> u = >> self-1 >> if u.valuation() <= >> 0: >> raise AttributeError, "Argument t must satisfy val(t-1) > >> 0." >> N = self.prec >> () >> if isinstance(N, >> sage.rings.infinity.PlusInfinity): >> N = self.parent().default_prec >> () >> u.add_bigoh >> (N) >> err = LaurentSeries(self.parent(), 0, 0).add_bigoh >> (N) >> return sum([ u**k/k + err for k in range >> (1,N) ]) >> }}} >> > >> > > > > -- > William Stein > Associate Professor of Mathematics > University of Washington > http://wstein.org > > > > --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
Dear David, On Fri, Mar 13, 2009 at 05:00:55PM -0700, David Kohel wrote: > > Hi, > > I am finding problems, holes, or missing features in power series > rings > and Laurent series rings. > > sage: K. = LaurentSeriesRing(QQ) > sage: R. = PowerSeriesRing(QQ) ... +1 for making all of those, and also LazyPowerSeriesRing, consistent. > P.S. A first start with log -- is there a more efficient algorithm > already implemented somewhere or does someone want to put in place a > more efficient algorithm? Far from being an expert there, so just my 1/2 cent ... I guess we would want to use a newton iteration. Ideally, things would be done as for lazy power series: have a general tool to define a power series implicitly, with newton iteration. With this tool tool all the usual functions (inverse, log, power, exp, sin, ...) can be implemented in two lines of code each. This further reduces their complexity to that of the multiplication, which is optimal. So all the optimization efforts could be focused on the newton iteration and multiplication). I am not 100% sure it applies perfectly to Laurent series though. Best, Nicolas -- Nicolas M. Thiéry "Isil" http://Nicolas.Thiery.name/ --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
On Fri, Mar 13, 2009 at 5:00 PM, David Kohel wrote: > > Hi, > > I am finding problems, holes, or missing features in power series > rings > and Laurent series rings. > > sage: K. = LaurentSeriesRing(QQ) > sage: R. = PowerSeriesRing(QQ) > > 1. exp(t) is defined but exp(u) is not. > 2. log(1 - t) and log(1-u) -- I started filling in this gap (below) > for > Laurent series but ran into more problems. > 3. coercion to R does not work (R(u) fails trying to coerce to QQ). > > The style of implementations of source code look completely > independent. > I would like to have R == K.ring_of_integers() be defined and True > (maybe > if I call the variables the same). But the lack of coercion suggests > that > these where not designed together, as do the functions for creating > error > terms O(t^n). > > The names of the files hint at a design break: > > sage: type(t) > > sage: type(u) > > > Now there also exists a power_series_ring_element file, but it > implements > a class PowerSeries inheritted from PowerSeries_poly (in a separate > file). > There is also a power_series_mpoly, which must either be an attempt > at > multivariate power series or a sparse power series. > > Is there a reason for this split, and if so, why do Laurent series not > follow > the same dichotomy? At least two different people probably implemented the code. You might start up sage and type sage: hg_sage.browse() or go to http://hg.sagemath.org/sage-main/file/5c72dbb92d82/sage/rings and start browsing around so you can see exactly who edited the files you're looking at and when. You can also do the following at the command line in the rings directory to see the history of any given file: $ hg log laurent_series_ring.py |more changeset: 11695:3e8e9cdd9715 user:Mike Hansen date:Tue Feb 24 09:13:31 2009 -0800 summary: Converting sage.rings.* docstrings to Sphinx changeset: 8413:f4aeaf9e22c6 user:Martin Albrecht date:Sun Jan 20 16:44:08 2008 + summary: allow rational functions to be coerced into LaurentSeriesRings (fixes 1/3 of #1793) changeset: 5481:1fb33b78a725 user:Robert Bradshaw date:Wed Jul 18 01:35:31 2007 -0700 summary: Fix mathematical error I stupidly introduced You can do $ hg export 8413 to see the actual 8413 patch (say). > > I think I need to understand what is intended before hacking around > all > of these classes. > > Cheers, > David > > P.S. A first start with log -- is there a more efficient algorithm > already > implemented somewhere or does someone want to put in place a more > efficient algorithm? > > {{{ > def log > (self): > > """ > The logarithm of the power series t, which must be in a > neighborhood of 1. > > TODO: verify that the base ring is a QQ-algebra. > > """ > u = > self-1 > if u.valuation() <= > 0: > raise AttributeError, "Argument t must satisfy val(t-1) > > 0." > N = self.prec > () > if isinstance(N, > sage.rings.infinity.PlusInfinity): > N = self.parent().default_prec > () > u.add_bigoh > (N) > err = LaurentSeries(self.parent(), 0, 0).add_bigoh > (N) > return sum([ u**k/k + err for k in range > (1,N) ]) > }}} > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
I didn't really mean "don't implement them" -- just don't do it hastily and be sure you know what you are doing of you do! Of course, everything should be implemented John On 16/11/2007, William Stein <[EMAIL PROTECTED]> wrote: > > On Nov 16, 2007 2:07 AM, John Cremona <[EMAIL PROTECTED]> wrote: > > Even before getting to Laurent series, multivariate power series are > > harder to define than you might think, so I would avoid implementing > > them at this point unless you have a specific need for them! You need > > to be really careful since K[[x]][[y]], K[[y]][[x]] and K[[x,y]] are > > not all the same. > > I just want to counter with: Please *do* implement them!Numerous > people involved with Sage have procrastinated implementing > multivariate power series rings more times than I can count at this point. > We need somebody unafraid to just do it. > > William > > > There are probably people on the list more knowledgeable than me about > > this, but I thought it might be worth while posting a warning! > > > > John > > > > On 16/11/2007, David Roe <[EMAIL PROTECTED]> wrote: > > > Hey all, > > > At some point in the near future I may try to bring the implementation of > > > power series rings more into line with the p-adics. The single variable > > > case seems straightforward, but a something popped up for me when thinking > > > about the multivariable case. > > > > > > What is the appropriate analogue of laurent series? Is the key point for > > > laurent series that we allow bounded negative exponents? Or that it's a > > > field? Because allowing bounded negative exponents is not enough to > > > always > > > have inverses: x + y has no inverse if we require the exponents of x and y > > > to be bounded away from negative infinity. > > > David > > > > > > > > > > > > > > > > -- > > John Cremona > > > > > > > > > > > > > -- > William Stein > Associate Professor of Mathematics > University of Washington > http://wstein.org > > > > -- John Cremona --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
On Nov 16, 2007 2:07 AM, John Cremona <[EMAIL PROTECTED]> wrote: > Even before getting to Laurent series, multivariate power series are > harder to define than you might think, so I would avoid implementing > them at this point unless you have a specific need for them! You need > to be really careful since K[[x]][[y]], K[[y]][[x]] and K[[x,y]] are > not all the same. I just want to counter with: Please *do* implement them!Numerous people involved with Sage have procrastinated implementing multivariate power series rings more times than I can count at this point. We need somebody unafraid to just do it. William > There are probably people on the list more knowledgeable than me about > this, but I thought it might be worth while posting a warning! > > John > > On 16/11/2007, David Roe <[EMAIL PROTECTED]> wrote: > > Hey all, > > At some point in the near future I may try to bring the implementation of > > power series rings more into line with the p-adics. The single variable > > case seems straightforward, but a something popped up for me when thinking > > about the multivariable case. > > > > What is the appropriate analogue of laurent series? Is the key point for > > laurent series that we allow bounded negative exponents? Or that it's a > > field? Because allowing bounded negative exponents is not enough to always > > have inverses: x + y has no inverse if we require the exponents of x and y > > to be bounded away from negative infinity. > > David > > > > > > > > > > -- > John Cremona > > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
That looks like a good reference. I was thinking of the remark in Ian Connell;s (free online) lecture notes on elliptic curves, available from http://www.math.mcgill.ca/connell/public/ECH1/, where he says (bottom of first page of Chapter 2) The pitfall to avoid here is that the isomorphic rings $A((T_1))((T_2))$ and $A((T_2))((T_1))$ cannot be identified in the same way as $A[[T_1]][[T_2]]=A[[T_2]][[T_1]]$ since, for example, $\sum_{i=0}^{\infty}T_1^{-i}T_2^i$ is a member of the first ring, but not the second. On 16/11/2007, Georg Muntingh <[EMAIL PROTECTED]> wrote: > > I think you want the multivariate Laurent series to form a field. For > x + y to have an inverse, you should additionally make a choice of an > ordering x < y or y < x to decide what its series expansion looks > like. The best definition might therefore be the iterated Laurent > series, as described in Chapter 2 of this PhD thesis: > http://arxiv.org/pdf/math/0405133. > This might also be the easiest to implement. > > > -- John Cremona --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
Even before getting to Laurent series, multivariate power series are harder to define than you might think, so I would avoid implementing them at this point unless you have a specific need for them! You need to be really careful since K[[x]][[y]], K[[y]][[x]] and K[[x,y]] are not all the same. There are probably people on the list more knowledgeable than me about this, but I thought it might be worth while posting a warning! John On 16/11/2007, David Roe <[EMAIL PROTECTED]> wrote: > Hey all, > At some point in the near future I may try to bring the implementation of > power series rings more into line with the p-adics. The single variable > case seems straightforward, but a something popped up for me when thinking > about the multivariable case. > > What is the appropriate analogue of laurent series? Is the key point for > laurent series that we allow bounded negative exponents? Or that it's a > field? Because allowing bounded negative exponents is not enough to always > have inverses: x + y has no inverse if we require the exponents of x and y > to be bounded away from negative infinity. > David > > > > -- John Cremona --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~--~~~~--~~--~--~---
[sage-devel] Re: Power series rings
I think you want the multivariate Laurent series to form a field. For x + y to have an inverse, you should additionally make a choice of an ordering x < y or y < x to decide what its series expansion looks like. The best definition might therefore be the iterated Laurent series, as described in Chapter 2 of this PhD thesis: http://arxiv.org/pdf/math/0405133. This might also be the easiest to implement. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~--~~~~--~~--~--~---