Re: [sage-combinat-devel] More LaurentPolynomialRing insanity
Thank you for the pointer, I will move the discussion there. S. * Nicolas M. Thiery [2015-11-03 17:04:31]: > On Tue, Nov 03, 2015 at 04:37:25PM +0100, VulK wrote: > > I just noted the following: > > > > sage: R = LaurentPolynomialRing(ZZ,'x,y') > > sage: T = R.remove_var('x') > > sage: T.inject_variables() > > Defining y > > sage: y in T > > True > > sage: y in R > > True > > > > As one should expect, now for a second try > > > > sage: R = LaurentPolynomialRing(ZZ,'x,y,z') > > sage: T = R.remove_var('x') > > sage: T.inject_variables() > > Defining y, z > > sage: y in T > > True > > sage: y in R > > False > > > > And of course, you try R(y), hell break loose. > > > > At this point, at least in my experience, there are more issues with > > LaurentPolynomialRing than features. Is there any plan to replace the > > implementation with something less bug ridden in the near future? > > > > Should I decide to invest time in rewriting it, would anyone here be > > interested to help? Do you have any suggestion/reference on how this should > > be done properly? > > Just a note: this would be better discussed on sage-devel. > > Cheers, > Nicolas > -- > Nicolas M. Thiéry "Isil" > http://Nicolas.Thiery.name/ > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-combinat-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-combinat-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.
[sage-combinat-devel] More LaurentPolynomialRing insanity
Dear all, I just noted the following: sage: R = LaurentPolynomialRing(ZZ,'x,y') sage: T = R.remove_var('x') sage: T.inject_variables() Defining y sage: y in T True sage: y in R True As one should expect, now for a second try sage: R = LaurentPolynomialRing(ZZ,'x,y,z') sage: T = R.remove_var('x') sage: T.inject_variables() Defining y, z sage: y in T True sage: y in R False And of course, you try R(y), hell break loose. At this point, at least in my experience, there are more issues with LaurentPolynomialRing than features. Is there any plan to replace the implementation with something less bug ridden in the near future? Should I decide to invest time in rewriting it, would anyone here be interested to help? Do you have any suggestion/reference on how this should be done properly? Thanks Salvatore -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.
[sage-combinat-devel] Fast polynomial powers
Dear all, As some of you might know I am trying to optimize the way in which cluster algebras are implemented in sage. In my current implementation one of the biggest bottleneck happens when I take powers of polynomials in n variables (n is usually much smaller than 10) with integer coefficients and quite high degrees (few hundreds). The way I am computing things now is, probably, the dumbest possible: sage: f in PolynomialRing(ZZ,'u0,u1,u2') True sage: f.degree() 159 sage: len(f.monomials()) 18105 sage: %time foo = f**2 CPU times: user 4min 30s, sys: 5 ms, total: 4min 30s Wall time: 4min 30 Is there some clever way to save some time here or it is just hopeless? Thanks S. -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.
[sage-combinat-devel] Re: Fraction field elements are not simplified
Dear All, here is a brief status update on this issue. TL;DR: Laurent Polynomial Ring does not provide a gcd implementation. Recall that we are in this situation: sage: L = LaurentPolynomialRing(LaurentPolynomialRing(ZZ,'t'),'x') sage: R = L.fraction_field() sage: R.inject_variables() Defining x sage: x.gcd(x) 1 This is the implementation of gcd called by x.gcd(x) @coerce_binop def gcd(self, other): P = self.parent() try: selfN = self.numerator() selfD = self.denominator() selfGCD = selfN.gcd(selfD) otherN = other.numerator() otherD = other.denominator() otherGCD = otherN.gcd(otherD) selfN = selfN // selfGCD selfD = selfD // selfGCD otherN = otherN // otherGCD otherD = otherD // otherGCD tmp = P(selfN.gcd(otherN))/P(selfD.lcm(otherD)) return tmp except (AttributeError, NotImplementedError, TypeError, ValueError): zero = P.zero() if self == zero and other == zero: return zero return P.one() clearly selfN is x and selfD is 1 as elements of L but sage: selfN.gcd(selfD) ... NotImplementedError: Univariate Laurent Polynomial Ring in t over Integer Ring does not provide a gcd implementation for univariate polynomials S. PS: of course this is not just a problem with units: sage: (x+1).gcd(x+1) 1 sage: (x+1).numerator().gcd(1) NotImplementedError: Univariate Laurent Polynomial Ring in t over Integer Ring does not provide a gcd implementation for univariate polynomials * Travis Scrimshaw [2015-10-10 05:57:20]: >I think I slightly misspoke about the gcd. See the details on >[1]http://trac.sagemath.org/ticket/16993. >Best, >Travis >On Friday, October 9, 2015 at 4:12:12 PM UTC-5, Travis Scrimshaw wrote: > >Hey Salvatore, >Â Â I would say this is the same problem as simplifying scalars of >fraction fields of polynomials over QQ, that gcd(x, x) = 1 rather than >x because x is a unit. I don't think we have a way around this >currently other than doing some kind of explicit coercion. >Best, >Travis >On Friday, October 9, 2015 at 1:40:22 PM UTC-5, Salvatore Stella wrote: > > Dear all, > I just noted the following odd behaviour: > sage: L = LaurentPolynomialRing(ZZ, 'x').fraction_field() > sage: L.inject_variables() > Defining x > sage: x/x > 1 > As one should expect but if we change the base ring then things get > messy: > sage: L = LaurentPolynomialRing(LaurentPolynomialRing(ZZ,'t'), > 'x').fraction_field() > sage: L.inject_variables() > Defining x > sage: x/x > x/x > sage: _.denominator() > x > The fact that x/x is printed out as x/x is still ok if somewhat > annoying. But > the return value of denominator() is definitely not what I would > expect. > Is this intentional? > Thanks > Salvatore > > References > >1. http://trac.sagemath.org/ticket/16993 -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.
[sage-combinat-devel] Fraction field elements are not simplified
Dear all, I just noted the following odd behaviour: sage: L = LaurentPolynomialRing(ZZ, 'x').fraction_field() sage: L.inject_variables() Defining x sage: x/x 1 As one should expect but if we change the base ring then things get messy: sage: L = LaurentPolynomialRing(LaurentPolynomialRing(ZZ,'t'), 'x').fraction_field() sage: L.inject_variables() Defining x sage: x/x x/x sage: _.denominator() x The fact that x/x is printed out as x/x is still ok if somewhat annoying. But the return value of denominator() is definitely not what I would expect. Is this intentional? Thanks Salvatore -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-combinat-devel] Root systems do not define variables correctly
Hi, I guess injecting simple roots would be my choice. If not possible, at least, it would be cleaner to remove inject_variables from the auto completion list for A. S. * Nicolas M. Thiery [2012-07-12 23:47:34]: > On Thu, Jul 12, 2012 at 11:08:54PM -0400, VulK wrote: > > I just noticed the following odd behaviour: > > > > > sage: L=RootSystem(['A',2]).root_lattice() > > > sage: L.inject_variables() > > > --- > > > ValueErrorTraceback (most recent call > > > last) > > > ValueError: variable names have not yet been set using > > > > I am running Sage Version 5.1, Release Date: 2012-07-09 with combinat queue > > both compiled from sources today (I noticed the same behaviour on an old 4.8 > > install and I upgraded to check if had already been addressed). > > I assume it will suffices to add _assign_names in the definition of > > root_lattice but I did not have time to check it. > > What would you want this method to do for root lattices? > > Nicolas > -- > Nicolas M. Thiéry "Isil" > http://Nicolas.Thiery.name/ > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-combinat-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sage-combinat-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
[sage-combinat-devel] Root systems do not define variables correctly
Hi, I just noticed the following odd behaviour: > sage: L=RootSystem(['A',2]).root_lattice() > sage: L.inject_variables() > --- > ValueErrorTraceback (most recent call last) > > /opt/sage/sage-5.1/ in () > > /opt/sage/sage-5.1/local/lib/python2.7/site-packages/sage/structure/category_object.so > in sage.structure.category_object.CategoryObject.inject_variables > (sage/structure/category_object.c:5146)() > > /opt/sage/sage-5.1/local/lib/python2.7/site-packages/sage/structure/category_object.so > in sage.structure.category_object.CategoryObject.variable_names > (sage/structure/category_object.c:4775)() > > ValueError: variable names have not yet been set using > self._assign_names(...) I am running Sage Version 5.1, Release Date: 2012-07-09 with combinat queue both compiled from sources today (I noticed the same behaviour on an old 4.8 install and I upgraded to check if had already been addressed). I assume it will suffices to add _assign_names in the definition of root_lattice but I did not have time to check it. Thanks Salvatore Stella -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
Re: [sage-combinat-devel] B-matrix class of finite type cluster algebras
Sorry I meant there are problem applying trac_6588-categories-root_systems-review-nt.patch S. * Christian Stump [2012-03-10 18:43:30]: > Dear Salvatore, > > > sage: S=ClusterSeed(['E',8]) > > sage: T=S.principal_extension() > > sage: T.b_matrix_class() > > that was a bug in our code (that was there actually from the beginning > on). I hope I fixed it; I pushed the changes, could you please recheck > that you get the right numbers (if that is actually possible!) in some > small examples like > > S=ClusterSeed(X) > T=S.principal_extension() > T.b_matrix_class() > > for X in types A and B in rank 2 and 3? > > Thanks for reporting, Christian > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-combinat-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sage-combinat-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
Re: [sage-combinat-devel] Re: problem installing
Here is a dirty fix for the problem: local/bin/sage-combinat 184c184 + non_version_guards = filter(lambda guard: re.match("^(sage_)?(\d+_)*(\d+)$", guard) is not None, hg_active_guards()) - non_version_guards = filter(lambda guard: re.match("^(sage_)?(\d+_)*(\d+)$", guard) is None, hg_active_guards()) Best VulK * Christian Stump [2011-08-14 13:12:03]: > > Current non version guards: > > Updated non version guards: > > Updating guards > > /opt/sage-4.7/sage -hg --config 'extensions.hgext.mq=' qselect -q -n > > /opt/sage-4.7/sage -hg --config 'extensions.hgext.mq=' qselect > > no active guards > > that's right, but the sage -combinat install usually takes care of > that itself, so there should not be anything to do... > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-combinat-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sage-combinat-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
Re: [sage-combinat-devel] Re: problem installing
It appear I have no guards selected!!! Do I understand this correctly? Current non version guards: Updated non version guards: Updating guards /opt/sage-4.7/sage -hg --config 'extensions.hgext.mq=' qselect -q -n /opt/sage-4.7/sage -hg --config 'extensions.hgext.mq=' qselect no active guards Best S. * Christian Stump [2011-08-14 12:59:38]: > > The complete log of the command is attached. > > what I see is that your guards are set wrong, but I don' know why: > > your log shows the line > > skipping sage-4.7.1.patch - guarded by ['+4_7_1'] > > but as your version of sage is 4.7, this patch (and the ones below) > should not be skipped. Could you please recheck that your guards are > right, with sage -combinat qselect. Does someone else see any other > issue? > > While it doesn't work, you can also run smaller things on the combinat > server (which is still in test phase) at sage.lacim.uqam.ca > > Best, Christian > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-combinat-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sage-combinat-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
Re: [sage-combinat-devel] Re: problem installing
Hi, sorry for my late reply: I re-installed sage from sources before testing the problem again. So my system is a dual processor x86_64 runs gentoo linux. I have all the prerequisites listed on that page and I have a fresh install of sage 4.7 (I have the install logs if you want). As I said sage -combinat install apparently fails because part of the patch trac_10335-permgroup_domain-mh.patch can't be applied The complete log of the command is attached. thanks * Christian Stump [2011-08-13 17:11:13]: > Hi, > > > I do not manage to install combinat because I can't apply one of the > > patches. > > sage: version 4.7 > > failing patch: trac_10335-permgroup_domain-mh.patch > > It works on other computers -- could you please try sage -combinat > install again, and completely post the output if the error still > occurs. Also: did you go through the prerequisites on > http://wiki.sagemath.org/combinat/MercurialStepByStep? > > Best, Christian > > -- > You received this message because you are subscribed to the Google Groups > "sage-combinat-devel" group. > To post to this group, send email to sage-combinat-devel@googlegroups.com. > To unsubscribe from this group, send email to > sage-combinat-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sage-combinat-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en. sage_-combinat_install.log.tar.bz2 Description: BZip2 compressed data
[sage-combinat-devel] problem installing
Hi all, I do not manage to install combinat because I can't apply one of the patches. sage: version 4.7 failing patch: trac_10335-permgroup_domain-mh.patch Best VulK -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.