Re: [sage-combinat-devel] ClassicalCrystalOfAlcovePaths?
Indeed. The problem was hidden because of a lazy import. But the object actually does not exist (and the deprecation is tested nowhere)! Vincent 2014-12-19 17:23 UTC+01:00, William Stein wst...@gmail.com: Hi, Somebody (mateon1) reported this bug in Sage on gitter [1]: There is a mystery thing in the global namespace of Sage on startup called ClassicalCrystalOfAlcovePaths. As far as I can tell, doing *anything* with this global object just bombs. ClassicalCrystalOfAlcovePaths? ClassicalCrystalOfAlcovePaths(inputs), etc. Of course using ClassicalCrystalOfAlcovePaths functionality as documented here works: https://github.com/sagemath/sage/blob/master/src/sage/combinat/crystals/alcove_path.py [1] https://gitter.im/sagemath/cloud -- William Stein Professor of Mathematics University of Washington http://wstein.org -- 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] Set_object_enumerated
Hi, I am refactoring subset / subword at #10534. The elements are right now of type Set_object_enumerated. But I really do not like it since: sage: from sage.sets.set import Set_object_enumerated sage: Set_object_enumerated((Set(()), Set((2, {{2}, {}} sage: Set_object_enumerated((Set(()), Set((1, {{}, {1}} In particular, if we start enumerating the subsets of the subsets it become really ugly. Do you mind if I open a ticket to - set the category of Set_object_enumerated to FiniteEnumeratedSets() or EnumeratedSets() - fix the print order - set rank / unrank to what it should be An alternative would have been to use FiniteEnumeratedSet but it has UniqueRepresentation and hence is not suitable for that purpose. Vincent -- 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] Re: redesign combinatorial statistics
It seems that actually nobody read my initial post on that thread... so let me repeat There are two disjoint tasks: - add semantic to Map and Morphism (Sage) - gather the list of meaningful maps (Sage/FindStat) First of all, most of us agree that we need more semantic at the level of maps. Note that Morphism is already a way of providing semantics as it tells that the map preserves some structure. It will not hurt me too much to have aliases satistics and combinatorial_map for whatever they are. But the semantic has to be implemented at the level of maps not at the level of methods. As Vivianne agreed: combinatoral_map is currently an empty class whose purpose is to tag some methods as being of the good kind. The only semantic added is that method is actually a map. Secondly, there is the thing at what FindStat is good: gathering the set of meaningful maps from Parent A to Parent B. I will not develop on the technical part underlying this question as it was already discussed. But it would be good to have the infrastructure and some of the information in Sage. In other words, a function which register maps {{{ sage: my_map = build_map_from_method(domain, range, category=X, method_name='toto', injective=True) sage: register_map(my_map) }}} In some places, a decorator might be the way to proceed. Vincent -- 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] Re: redesign combinatorial statistics
Hi Christian, 2014-05-28 11:32 UTC+02:00, Christian Stump christian.st...@gmail.com: It seems that actually nobody read my initial post on that thread... so let me repeat I did -- but didn't really have any qualified contribution... But the semantic has to be implemented at the level of maps not at the level of methods. could you explain what you mean there (maybe using your example of the number of descents of a permutation). A method ( = a Python function) is not a Sage Map ( = a Python object that model a mathematical function). I would like first to convert the method into a map {{{ from sage.categories.map import Map class NumberOfDescents(Map): def __init__(self): Map.__init__(Permutations(), NonNegativeIntegers()) def _call_(self, p): return Integer(p.number_of_descents()) }}} The above example is already non-trivial since it specifies a domain and a codomain (which is different from the parent of the image of an element): {{{ sage: nod = NumberOfDescents() sage: p = Permutation([3,2,1]) sage: nod(p) 3 sage: nod(p).parent() is NN False }}} The second step would be to think how to add semantic to the map. Part of is already managed by the axioms/categories (for example a Morphism between GradedSets preserve the grading). But there is nothing for injectivity/surjectivity or more subtle properties. It would make more sense to register actual maps as above. Vincent -- 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] Re: redesign combinatorial statistics
Hi Christian, 2014-05-28 15:21 UTC+02:00, Christian Stump christian.st...@gmail.com: The second step would be to think how to add semantic to the map. Part of is already managed by the axioms/categories (for example a Morphism -- How do you think more semantic should be implemented? As a dict with some conventions for keys and values? Here I am not sure. As Simon pointed out we do not want to start having tons of informations attached to maps... but for most of them I would be in favor of methods (some of them my be trivial as return True and some others might involve computations). -- What if I want to give properties that depend on input parameter like the length of the permutation? Say I look at the map from Permutations(n) to itself given by composition with the long cycle (1..n), and now want to add the semantic information that it has order n? In that very particular case, I would implement a generic class InteriorAutomorphism (that is an element of the group of the automorphisms of a given group). Then the order would simply be obtained through the method .order() that exists for any group element. Then it is up to you to see which of these interior automorphisms you want to add to your database. -- Is there a way to implement your ideas such that the lines of code I need to touch in order to turn a method into a map is right where the method is implemented? decorator is exactly the kind of objects design to do that. Vincent -- 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] Re: redesign combinatorial statistics
Hi Paul, 2014-05-28 17:42 UTC+02:00, Paul-Olivier Dehaye paul-olivier.deh...@math.uzh.ch: I agree 100% with your summary, Simon, except that 1) Nathann will have to say himself whether he agrees or not; Please at some point stop the flame. 2) A decision should be made whether it is valid to introduce lots of empty methods and classes simply for the semantic decorators that will be added. It is not. Could you give an example of what you are thinking about ? In my mind it would be seomthing like the natural injection ZZ - QQ... but this is already there {{{ sage: QQ.convert_map_from(ZZ) Natural morphism: From: Integer Ring To: Rational Field }}} So there is no need to create an empty method .as_rational() on each integer. If you want a trivial function in your database then implement it as a Morphism. Or better as Simon said: put in the database what is needed to actually build the Morphism. Vincent -- 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-devel] Re: [sage-combinat-devel] Re: redesign combinatorial statistics
Hi Vivianne, 2014-05-28 19:32 UTC+02:00, Viviane Pons vivianep...@gmail.com: I think we all agree on this idea now (that the decorator should not wrap the method), so there is no point in keeping the argument. Still, I have asked a few questions on which I'd like you guys opinions: - what's the best way to store this information? Nathan and Simon mentioned database, would this be a run time database? Or something persistent? I am not sure a real database (e.g. sql or similar) would be the best. The real question is how many maps you would like to handle ? If the answer is below 5 I would go for a pure Python datastructure (dict, set and so). - Where to put the method to get the maps, right now it is a function hidden in some folder. I would like people to be able to see it when they're on the object, but it seems silly to add it manually to the object and yet, it shouldn't be on every object... For me, it would makes sense on parents directly {{{ sage: Permutations().known_maps_to(Partitions()) [...] }}} And in the methods known_maps_to and known_maps_from there should be pointer on how to feed the database with more maps. But I would charge the elements with that. Vincent -- 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] redesign combinatorial statistics
Hello everyone, I like what statistics try to do but I do not like the way it works. Please tell me where I am wrong and where I am right. I can provide some proof of concepts as soon as most of you agreed on the design. Please: critics are welcome. I think that there are two disjoint tasks: - add semantic to Map and Morphism - gather the list of meaningful maps First of all, I think that most of us agree that it would be nice to have more semantics at the level of maps (especially injectivity/surjectivity/bijectivity, commutation relations with other maps, etc). Note that Morphism is already a way of providing semantics as it tells that the map preserves some structure. It will not hurt me too much to have an alias satistics for maps from a countable set to the non-negative integers or combinatorial_maps for maps between two countable sets but the work has to be done at the level of maps. Let me notice that right now, combinatoral_map is just an empty class whose purpose is to tag some methods as being of the good kind. The only semantic added here is that method is actually a map. Secondly, there is the thing at what the current FindStat is good: gathering the set of meaningful maps from Parent A to Parent B. The set of maps from/to somebody might be registered somewhere else in the same way that conversion/coercions are handled. I think that such thing must be flexible enough to be tuned by users (especially by the FindStat project). The function to do the job might looks like {{{ build_map_from_method(domain, range, category=X, method_name='toto', injective=True, register=True) }}} In some places, a decorator might be a way to proceed. Once that done, we can add some generic stuff at the level of parents like {{{ sage: Partitions().known_maps_to(Permutations()) sage: Graphs().known_maps_from(Posets()) }}} and start playing with compositions of such maps as it is done in FindStat. That being said we do not want to register all computable maps on startup. So we have to find the good balance between interesting maps as the number of descents in a permutation and uninteresting maps as the polynomial map 57*n^2 - 18*n +3 from {-12, 1, 42, 2243} to the integers. Vincent -- 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] Re: sum(Composition([1,2,3])) # broken
I would rather deprecate the `.sum()` of Composition. If you want to concatenate composition, use `+`. There is also a mistake here, `__add__` is implemented instead of `_add_`. Vincent 2014-05-20 10:57 UTC+02:00, Nathann Cohen nathann.co...@gmail.com: Please help me follow you : You want to define a + and * operatorsfor Combinations, in such a way that Combination.sum() is not necessary anymore, which in turn means that sum(Combination([1,2,3])) would return 6 ? Nathann On 20 May 2014 10:16, Simon King simon.k...@uni-jena.de wrote: Hi Nicolas, On 2014-05-19, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote: On Mon, May 19, 2014 at 04:01:52PM +, Simon King wrote: Multiplication? I always think of words as elements of a free group, of course multiplicatively written. Hence, concatenation of words w1,...,wn would be prod([w1,w2,...,wn]). Indeed. `+` works too for concatenation of words, which is consistent with Python strings. But sum does not. Oh well. The reason is that the sum(...) function starts the summation with zero, unless told to be differently. However, 0 is not coerced to the empy word, or to strings for that matter. If it would, summation would work. sage: W = Words(range(27)) sage: a = W([randint(0,26) for _ in range(10)]) sage: sum([a,a,a]) BOOM TypeError: unsupported operand type(s) for +: 'int' and 'FiniteWord_list' sage: sum([a,a,a],a) word: 20,17,5,14,2,14,5,9,4,21,20,17,5,14,2,14,5,9,4,21,20,17,5,14,2,14,5,9,4,21,20,17,5,14,2,14,5,9,4,21 sage: sum(['a','a','a']) BOOM TypeError: unsupported operand type(s) for +: 'int' and 'str' sage: sum(['a','a','a'],'a') BOOM # O dear... TypeError: sum() can't sum strings [use ''.join(seq) instead] Nonetheless, I think multiplicative notation should be enabled as well, as a courtesy to group theorists... But it is all not easy. I stated above, one should coerce 0 to the empty word. But then, written multiplicatively, one would coerce 1 to the empty word as well. Not very nice. Specifically if you really think of words being additive, and 5*a should be a+a+a+a+a, and not empty_word*a. Perhaps one should better say that W has a single operator (either + or *, but not both), and if + is chosen, then 5+a should not be defined, but 5*a should be a+a+a+a+a. Or if * is chosen, then 5+a and 5*a should not be defined, but a^5 should be it. In other words, one shouldn't try to coerce NN into W, but one should think of W as endowed with an NN action. And at the end of the day, I'd say that sum([a,a,a]) is a misuse of the sum() function. Best regards, Simon -- You received this message because you are subscribed to a topic in the Google Groups sage-combinat-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-combinat-devel/PDPkJc_PBSE/unsubscribe . To unsubscribe from this group and all its topics, 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. -- 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] Re: sum(Composition([1,2,3])) # broken
Hi, More fun: there are occurrences of sum(self) in the file compositions.py. But here this sum is intended to actually sum the elements. It is fine, because preparser is turned off and sum is the builtin sum there! I agree with Nathan that .sum must be changed. IMHO I would - remove sum from the element Composition - move the sum from the category CommutativeAdditiveMonoids to AdditiveMagmas - Turn the parent Compositions into an additive monoid That way, the old behavior of sum can still be used through {{{ sage: Compositions().sum([Composition([3,2,1]), Composition([1,2])]) [3, 2, 1, 1, 2] }}} Vincent 2014-05-20 11:34 UTC+02:00, Nathann Cohen nathann.co...@gmail.com: I have no idea what you are talking about. I was talking about the (Python builtin?) function sum(), and I don't think it makes use of Combination.sum(). Sorry, I mean Composition, not Combination. And sum(Composition([1,2,3])) does call Composition.sum. Nathann -- 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.
Re: [sage-combinat-devel] sum(Composition([1,2,3])) # broken
Hi, Not because of Composition but because of sum sage: import __builtin__ sage: __builtin__.sum(Composition([1,2,3])) 6 Vincent 2014-05-19 16:26 UTC+02:00, Nathann Cohen nathann.co...@gmail.com: Hello everybody ! Today I come with this : sage: sum(Composition([1,2,3])) ... TypeError: sum() takes exactly 1 argument (0 given) Some code of mine which uses Composition expected to see 3+2+1=6 there, but all I got was an exception. Looks like you are not allowed to change the meaning of .sum(), which is what Composition does. Nathann -- 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.
Re: [sage-combinat-devel] Should the element of a Parent be Elements ?
Hi Nathann, This is one very special case where the Parent/Element relation is broken. First of all FiniteEnumeratedSet is not the parent of its elements (it is a facade): sage: F = FiniteEnumeratedSet([1, Partition([2,1]), Permutation([3,2,1])]) sage: F {1, [2, 1], [3, 2, 1]} sage: F[0].parent() Integer Ring sage: F[1].parent() Partitions sage: F[2].parent() Standard permutations FiniteEnumeratedSet is aimed to not modify the input it gets. So if you feed it with Python objects which are not elements it will not complain and you have to go with that. With Stepan we implemented a TotallyOrderedFiniteSet which has an option for having the behaviour you expected sage: T = TotallyOrderedFiniteSet([1, Partition([2,1]), Permutation([3,2,1])], facade=False) sage: T[0] 1 sage: T[0].parent() {1, [2, 1], [3, 2, 1]} Cheers, Vincent 2014-04-30 9:02 UTC+02:00, Nathann Cohen nathann.co...@gmail.com: Here is the problem I met today: sage: F = FiniteEnumeratedSet((a,b,c)); F {'a', 'b', 'c'} sage: isinstance(F,Parent) True sage: F[0] 'a' sage: F[0].parent() --- AttributeErrorTraceback (most recent call last) ipython-input-15-142f29211c68 in module() 1 F[Integer(0)].parent() AttributeError: 'str' object has no attribute 'parent' S sometimes you write code that applies to parents, and sometimes the elements know what their parents are, sometimes they don't 1) Is that normal ? 2) If not, what do we do against it ? Have fun ! Nathann -- 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.
Re: [sage-combinat-devel] sage-combinat poster
Graphs are not part of Combinat. ;-) It would be nice to have (part of) http://steinertriples.fr/ncohen/tut/LP_examples/ on the poster !! -- 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/groups/opt_out.
Re: [sage-combinat-devel] Volunteers for a Sage presentation/tutorial at CARI 2014?
Hello, Is the conference in french ? (the title is in english but most information are in french) I am interested but the themes of the conference looks far from Sage capabilities: theme 1: Complex Systems Modelling theme 2: Scientific Computing and Parallelism theme 3: Signal, Image, Speech and Multimedia theme 4: Artificial Intelligence Computer-based Collaborative Environment theme 5: Software Engineering and Information Systems: Models, Methods and Applications theme 6: Computer networks, Telecom, Embedded Systems, Distributed Systems and Mobility I will start writing a project if others show up and would be happy if anybody has suggestions fitting into the themes. Best, Vincent 2014/1/21, Nicolas M. Thiery nicolas.thi...@u-psud.fr: Hello, The upcoming CARI 2014 African Conference on Research in Computer Science and Applied Mathematics will occur in Senegal next October. Would anyone be interested in presenting Sage (20-23 October) or organizing a tutorial (16-18 October)? The submission deadline is January 31st. http://www.cari-info.org/index.php?option=com_contentview=articleid=85Itemid=64 The delay is short, but maybe the organizers would accept a preliminary project description. I got the information from my dad who is likely to be there to present his regular booth on open source scientific software; he further mentioned that the local Dakarlug mailing list is very active. Some other food for thoughts: - The Agence Universitaire de la Francophonie is a partner of CARI http://www.cari-info.org/index.php?option=com_contentview=articleid=49Itemid=81 - AIMS is Sage friendly and has a location in Dakar http://www.aims-senegal.sn/ Cheers, Nicolas -- Nicolas M. Thiéry Isil nthi...@users.sf.net 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality
How do you define multiplication ?! If it is concatenation then uv = u... 2014/1/5, Darij Grinberg darijgrinb...@gmail.com: Oops, I've just realized that you *can* multiply infinite words, though I'm not sure if this has ever been used. (No, you cannot take their shuffle product.) On Sun, Jan 5, 2014 at 4:29 PM, Nathann Cohen nathann.co...@gmail.com wrote: Okay, I just created an element manually instead of calling an_element(). Nathann On 5 January 2014 15:59, Nathann Cohen nathann.co...@gmail.com wrote: You are right. Infinite words don't belong into an algebra; you cannot multiply them. Barring hack reasons, the change is correct. HMmm... And what do you think of Shuffle Algebras on infinite words ? Is this one correct or not ? It looks okay to me.. But if you tell me that it is not for yet another reason it will make my debugging *much* easier :-P Nathann -- You received this message because you are subscribed to a topic in the Google Groups sage-combinat-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-combinat-devel/zdN44XJZu5s/unsubscribe. To unsubscribe from this group and all its topics, 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/groups/opt_out. -- 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/groups/opt_out. -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality
Concatenation product is well defined but not well implemented in Sage. If u is infinite then uv = u for any (finite or infinite) word v. It is not a free monoid anymore. That being said, you can build the algebra on finite words, the one on infinite words (which is really stupid) and the one on all words. I guess only the first one matters. The shuffle algebra is not well defined on infinite words (the product becomes an infinite sum). So please turn infinite=False in both situations. Vincent 2014/1/5, Nathann Cohen nathann.co...@gmail.com: H... I just had Nicolas on the phone who told me that both can be changed to finite words only. Aand he had Florent around to confirm. I also think that the concatenation product is not well defined. And I actually wrote that in the patch already :-/ On the other hand I did not touch the Shuffle Product. Well, tell me what you think ^^; Nathann On 5 January 2014 19:09, Darij Grinberg darijgrinb...@gmail.com wrote: Huh? I thought shuffle does not work (because ... sh ... would be a sum of infinitely many identical words), but uv is well-defined (and equals u when u is infinite)? On Sun, Jan 5, 2014 at 7:08 PM, Christian Stump christian.st...@gmail.com wrote: Yes, but it's associative, so it works... (Except I don't expect it to have much of a use.) can you be more specific? How is the product uv defined? I see that you have a shuffle product defined, but I don't see that you have concatenation... Thanks, Christian -- 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/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups sage-combinat-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-combinat-devel/zdN44XJZu5s/unsubscribe . To unsubscribe from this group and all its topics, 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/groups/opt_out. -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: About Free Algebras, infinite Words and equality
Thank you for your work !! 2014/1/5, Nathann Cohen nathann.co...@gmail.com: I just edited ticket #12867. Thank you for your help :-) Nathann -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: Gray code
Hi, As there would be a lot of Gray code, it makes sense to have a dedicated sage/combinat/gray_codes/. I would be happy to see Gray codes as I do have one project related to it [1]. Sympy gray codes are implemented in pure Python and only concern subsets. It would be nice in Sage to not use GrayCode only for subsets !! Best Vincent [1] http://ask.sagemath.org/question/232/iterator-for-conjugacy-classes-of-sn 2013/12/5, P Purkayastha ppu...@gmail.com: You can just hook up the sympy code or use that directly: http://docs.sympy.org/dev/modules/combinatorics/graycode.html On 12/05/2013 05:52 AM, Nathann Cohen wrote: Helloo everybody ! I got an email from a Sage user who wants to enumerate something, and I'd need to generate a Gray Code in order to make it faster. And it looks like Sage cannot do that from my google searches. I would like to list all the subsets of a Set in a Gray Ordering. Actually, I would like to know which bit changes at each step. Aand well. Is there anywhere ? If it is not in Sage yet 1) that is shameful for us 2) where would you like to see it if I implement it ? I warn you, there will be bitwise C operations somewhere and a Python class above to expose it :-P Thanks ! Nathann P.S. : If you answer this message, *PLEASE* also answer on sage-devel. -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Infinite binary words -- Category of uncountable sets
Hi, RR in Sage *is* countable and *is not* the set of real numbers. Nevertheless it is not iterable (I do not know why). Currently there is only finite versus infinite for sets. I agree with you, it would be nice to have a category to deal with by essence non iterable sets such as Words(2). Best Vincent 2013/12/3, Nathann Cohen nathann.co...@gmail.com: Helloo everybody ! For once I come here to ask something about categories ! There is an alternative patch for #12867 which is waiting for a review, and modifies the object Words(2), i.e. the set of all (finite or infinite) binary words. There was an __iter__ method on that, while this set is... uncountable. Which the patch removes. And so I wondered if there was some category for uncountable sets, from which could be inherited the function that I am about to write : def __iter__(self): raise ValueError(This set is uncountable) Or something like that. I also wondered if it would make sense to differentiate NN, RR for cardinalities. It would be col if .cardinality() could also differentiate between countable and uncountable. Oh. And of course I guess that you will also have an advice on whether we should be able to iterate over uncountable sets. My opinion on the matter is that we shouldn't, unless somebody wants to implement a __iter__ method for RR :-P Nathann -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Infinite binary words -- Category of uncountable sets
I would say that I am not a specialist of categories. There are many enhancements introduced by #10963. In particular, when you create a category you can do Sets().Finite() or Sets().Infinite() in a cleaner way. I guess we would like something like InfiniteCountable() (as a synonym of Infinite()) and InfiniteUncoutable() ? It might be tricky as for example EnumeratedSets().InfiniteUncountable() should not exist... the part of category for InfiniteUncoutable() might provide - the good infinity for cardinality() in order that {{{Words(2).cardinality() == NN.cardinality()}}} is False. - the error for __iter__ 2013/12/3, Nathann Cohen nathann.co...@gmail.com: Yoo ! RR in Sage *is* countable and *is not* the set of real numbers. Nevertheless it is not iterable (I do not know why). sage: RealField() Real Field with 53 bits of precision Oh. Right. Precision. :-P Currently there is only finite versus infinite for sets. I agree with you, it would be nice to have a category to deal with by essence non iterable sets such as Words(2). Oh. So there is none ? Do you know how to create it ? (I still know nothing about categories). What could we put inside ? This exception for __iter__, what else ? Nathann -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: [sage-devel] cartesian products
Salut Nicolas, Thanks for taking care of it. I would like cartesian products to be smarter about iteration... especially when one of the factor is infinite. I have a working implementation of the iterator that you can use on the sage-combinat misc repo. Best, Vincent 2013/11/15, Nicolas M. Thiery nicolas.thi...@u-psud.fr: Salut Vincent, On Thu, Nov 14, 2013 at 10:43:19PM -0500, Vincent Delecroix wrote: For me it is a bug: the behavior of cartesian_product (not CartesianProduct) is not symmetric... {{{ sage: C1 = cartesian_product([FiniteEnumeratedSet('abc'),ZZ]) The cartesian product of ({'a', 'b', 'c'}, Integer Ring) sage: C1 sage: C1.an_element() ('a', 1) }}} but {{{ sage: cartesian_product([ZZ,FiniteEnumeratedSet('abc')]) Traceback (most recent call last): ... AttributeError: type object 'sage.rings.integer_ring.IntegerRing_class' has no attribute 'CartesianProduct' }}} And by the way, why CartesianProduct still exist ? Thanks for the report! I would be happy to fix that if I know what to do. I just created #15425 for this, with pointers towards what should be done. Please add there any further bug/feature of cartesian products I may have missed. Cheers, Nicolas -- Nicolas M. Thiéry Isil nthi...@users.sf.net 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/groups/opt_out. -- 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/groups/opt_out.
[sage-combinat-devel] cartesian products
Hi, For me it is a bug: the behavior of cartesian_product (not CartesianProduct) is not symmetric... {{{ sage: C1 = cartesian_product([FiniteEnumeratedSet('abc'),ZZ]) The cartesian product of ({'a', 'b', 'c'}, Integer Ring) sage: C1 sage: C1.an_element() ('a', 1) }}} but {{{ sage: cartesian_product([ZZ,FiniteEnumeratedSet('abc')]) Traceback (most recent call last): ... AttributeError: type object 'sage.rings.integer_ring.IntegerRing_class' has no attribute 'CartesianProduct' }}} And by the way, why CartesianProduct still exist ? I would be happy to fix that if I know what to do. Best, Vincent -- 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/groups/opt_out.
[sage-combinat-devel] group and algebra homomorphisms
Hello, If you have time, please have a look at http://ask.sagemath.org/question/3157/group-algebramatrix-space-homomorphism It seems impossible to define a morphism of group between a symmetric group and a matrix group (and similarly at the level of algebras). Best Vincent -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: group and algebra homomorphisms
Great! Thanks Travis! I posted your answer on ask.sagemath.org as well. 2013/11/2, Travis Scrimshaw tsc...@ucdavis.edu: Hey Vincent, Well, I can solve the question by using reduced expressions from the Coxeter presentation: sage: S3 = SymmetricGroup(3) sage: SGA = GroupAlgebra(S3, QQ) sage: MS = MatrixSpace(QQ,2) sage: mtx = [MS([[0,-1],[1,-1]]), MS([[1,-1],[0,-1]])] sage: phi = SGA.module_morphism(lambda x: MS.prod(mtx[i-1] for i in x.reduced_word()), codomain=MS) # -1 for indexing sage: H = Hom(S3, MG) sage: psi = H(lambda x: MG.prod(MG.gen(i-1) for i in x.reduced_word())) sage: kappa = SGA.module_morphism(lambda x: MS(psi(x)), codomain=MS) # An alternative implementation which induces from the group morphism sage: elt = SGA.gen(0) + SGA.gen(1); elt (1,2) + (1,2,3) sage: kappa(elt) [-1 -1] [ 0 0] There is a more subtle issue of defining a group morphism by generators, the group elements have to know how to express themselves in terms of the generators. If there was a function for doing that, then the above approach would work. For the symmetric group (perhaps even finite groups) at least, one might be able to brute force it, i.e. construct the corresponding Cayley graph and take a minimal length path from the identity: sage: G = S3.cayley_graph(generators=S3.gens()) sage: path = G.shortest_path(S3.one(), prod(S3.gens())); path [(), (1,2,3), (2,3)] sage: labels = [G.edge_label(path[i], path[i+1]) for i in range(len(path)-1)]; labels [(1,2,3), (1,2)] sage: map(lambda x: list(S3.gens()).index(x), labels) [0, 1] Although it might be worthwhile to wrap all of the above in some method on finite (semi)group elements reduced_word_on_generators(S3.gens()) (or some other name that doesn't necessarily conflict with reduced_word()). Best, Travis -- 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/groups/opt_out. -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: Inversion of matrix...
Hi Nicolas B., T. Monteil get the same problem in #10063 when he fixes the determinant. He used something like {{{ try: test = my_ring.is_field() except AttributeError: test = False }}} Vincent 2013/9/4 Nicolas Borie nicolas.bo...@univ-mlv.fr: On 03/09/2013 22:48, Simon King wrote: PS: - I recommend to *try* (no guarantee it will work) to create a new type of action A (inherit from sage.categories.action.Action). You need to implement its _call_ and _repr_name_, and I think that's all what is to do (but perhaps you'll find other examples of Action in Sage, so, try to learn from existing code). Typically, the _call_ method of the action A._call_(a,b) will rely on methods of a and b (in our application, a is element of the base ring and b is a matrix). And then, let MatrixSpace._get_action_ return A. Hello Simon et al, This way works ! But it overwrite the scalar multiplication for the other usuals ring. I just did a drafty implementation to check the coercion catch it... I also learn a lot about action, thanks for all your pointers Simon. For information, my drafty way to did it was exactly how Simon suggested but not in a very efficient way and using a new diagonal_matrix (should be homothétie in French but I doesn't know in English) : *** +def _get_action_(self, S, op=operator.mul, self_on_left=True): +r + +if self.has_coerce_map_from(self.base_ring()): +return None +if S == self.base_ring(): +return ActionFromBaseRing(self.base_ring(), self) +return None + +from sage.categories.action import Action + +class ActionFromBaseRing(Action): +r + +def _call_(self, elem, mat): +r + +P = mat.parent() +return P.diagonal_matrix(elem)*mat + *** I have now a scalar multiplication which is *really more* generic ( but ok, I should multiply each entries by the right scalar after having generated a copy ). However, I really think that polish Sage matrix spaces and matrices is a very hard job. I already fix two small problems, here is a status of Sage with this new action concerning some rings coming from Combinat: *** sage: C = AlgebrasWithBasis(QQ).example(); C An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field sage: SF = SymmetricFunctions(QQ).schur(); SF Symmetric Functions over Rational Field in the Schur basis sage: SFx.y = PolynomialRing(SF, 'y') sage: Cz.z = PolynomialRing(C, 'z') sage: Id = identity_matrix(C, 2); C.an_element()*Id [B[word: ] + 2*B[word: a] + 3*B[word: b] 0] [ 0 B[word: ] + 2*B[word: a] + 3*B[word: b]] sage: Id = identity_matrix(SF, 2); SF.an_element()*Id [2*s[] + 2*s[1] + 3*s[2] 0] [ 0 2*s[] + 2*s[1] + 3*s[2]] sage: Id = identity_matrix(SFx, 2); SFx.an_element()*Id [s[]*y 0] [0 s[]*y] sage: Id = identity_matrix(Cz, 2); Cz.an_element()*Id [B[word: ]*z 0] [ 0 B[word: ]*z] *** Let us try to call the adjoint of the identity matrix : Free algebra with 3 generators : *** sage: Id = identity_matrix(C, 2); sage: Id.adjoint() --- AttributeErrorTraceback (most recent call last) ipython-input-39-8ec4e1fe1f2c in module() 1 Id.adjoint() /home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.adjoint (sage/matrix/matrix2.c:40809)() /home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix._adjoint (sage/matrix/matrix2.c:40996)() /home/nborie/sage/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.charpoly (sage/matrix/matrix2.c:11016)() /home/nborie/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6888)() /home/nborie/sage/local/lib/python2.7/site-packages/sage/structure/misc.so in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)() AttributeError: 'FreeAlgebra_with_category' object has no attribute 'is_field' *** Schur functions : *** sage: Id = identity_matrix(SF, 2); sage: Id.adjoint() --- TypeError Traceback (most recent call last)
Re: [sage-combinat-devel] Re: groupoids
Hi Simon, The implementation of FreeSmallCategory in #12630 is somewhat related to what I need. I do not understand why the FreeSmallCategory can be a Magma ? The composition is not defined everywhere... Multiplication of paths *is* defined everywhere. That's why the FreeSmallCategory of #12630 contains an element called invalid path. I see. Thanks. Did you discuss the pros and cons of - adding an extra element NotAPath (your invalid path) but having a multiplication defined everywhere - having a partial multiplication I do not like the extra element in my case because in all algorithm I will need to check that (recall that I want morphisms from the set of paths to other set of paths). In my case, I want it to be a groupoid because I do have inversion, but in your case you don't and it looks like a monoidoid (?) There has been a decision on the name on a different thread on sage-combinat-devel, and I wouldn't like to change it again. Sure. I was not discussing the name but the category here. I guess that your FreeSmallCategory has some special features dedicated to Quiver and it has no meaning to change it. Nevertheless, it is still possible to factorize code. Best, Vincent -- 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/groups/opt_out.
[sage-combinat-devel] groupoids
Hi, I found that sage.categories.groupoid exists but somewhat confusing (no explanation of what it should be and the example is even more obscure). First of all I would have name the module sage.categories.groupoids. What I want to do is to define the set of paths in a graph and this for me is a groupoid (where the inversion is defined everywhere but not the composition). Does anybody knows what was the purpose of sage.categories.groupoid ? It seems to be used in an essential way in sage.categories.action but nowhere else. Best, Vincent -- 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/groups/opt_out.
Re: [sage-combinat-devel] Re: groupoids
Thanks Simon. 2013/7/4 Simon King simon.k...@uni-jena.de: Hi Vincent, On 2013-07-04, Vincent Delecroix 20100.delecr...@gmail.com wrote: What I want to do is to define the set of paths in a graph Directed graph aka quiver? Then you might look at #12630, which is makign progress towards being ready for review (which would be followed by a Cython version for paths in a quiver). An undirected graph is a directed graph in which arrows go both ways. And quiver was not exactly my purpose. I aim to consider simplicial maps between graphs (vertices are map to vertices and edges are map to paths). The natural domain of such maps is the set of paths (where the paths of zero length are in bijection with the set of vertices). Those maps are useful (if not necessary) to study automorphisms of free groups. Is there in #12630 a class Paths built as a groupoid ? Actually I found that such thing yet exists but only for acyclic graph in sage.combinat.graph_path. Vincent -- 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/groups/opt_out.
Re: [sage-combinat-devel] A one-day event to know more about the laws of free software in Paris ! (french)
Le 3 mars 2013 09:05, Nathann Cohen nathann.co...@gmail.com a écrit : Y'a quelqu'un que ca botte ? C'est plutôt super génial comme programme !!! Ca me botte mais je ne serai pas là. Dommage. Vincent -- Forwarded message -- From: Durand-Barthez Manuel manuel.durand-bart...@enc.sorbonne.fr Date: 2013/3/2 Subject: Formation Droit des logiciels To: manuel.durand-bart...@enc.sorbonne.fr Droit des logiciels ; principes généraux et licences du logiciel libre. Formation d'une journée, gratuite pour toute personne émargeant à la Recherche ou à l'Enseignement supérieur, quelle que soit la tutelle ministérielle. Intervenant : François PELLEGRINI, chercheur au Laboratoire bordelais de recherche en informatique, professeur à l'ENSEIRB. Durée : 6 heures, le 28 mai 2013 à la Sorbonne. Détails et inscription (sans frais mais obligatoire) sous le lien : http://urfist.enc.sorbonne.fr/sygefor/stage/297 -- Manuel DURAND-BARTHEZ URFIST Paris 17 rue des Bernardins F-75005 PARIS Phone: 33(0)1.43.26.01.55. Fax: 33(0)1.56.24.97.33. manuel.durand-bart...@enc.sorbonne.fr http://urfist.enc.sorbonne.fr -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[sage-combinat-devel] combinat installation fails on sage-5.7
Hi, Just to let you know, sage -combinat install still failed to apply on sage-5.7 {{{ applying trac_12895-subcategory-methods-nt.patch patching file sage/categories/category_singleton.pyx Hunk #3 FAILED at 277 1 out of 3 hunks FAILED -- saving rejects to file sage/categories/category_singleton.pyx.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir errors during apply, please fix and refresh trac_12895-subcategory-methods-nt.patch Abort }}} Comparing the .rej (see below) with the patch, it seems that everything related to sage/categories/category_singleton.pyx fails to apply. Best, Vincent --- category_singleton.pyx +++ category_singleton.pyx @@ -257,32 +278,41 @@ class Category_singleton(FastHashable_cl sage: MyRingsSingleton() Category of my rings singleton -Note that when calling :class:`Category_singleton` directly -then there is no cache used:: +Instanciating :class:`Category_singleton` triggers an assertion error:: -sage: Category_singleton() is Category_singleton() -False +sage: Category_singleton() +Traceback (most recent call last): +... +AssertionError: class 'sage.categories.category_singleton.Category_singleton' is not a direct subclass of class 'sage.categories.category_singleton.Category_singleton' -You must **never** subclass a subclass of :class:`Category_singleton`. -Otherwise, the instance the sub-sub-class may become identical with -the instance of the sub-class:: +Instantiating a subclass of a subclass of :class:`Category_singleton` +also triggers an assertion error:: -sage: class MyStuff(Category_singleton): pass +sage: class MyStuff(Category_singleton): +... def super_categories(self): return [Sets()] +sage: class MySubStuff(MyStuff): pass +sage: MySubStuff() +Traceback (most recent call last): +... +AssertionError: class '__main__.MySubStuff' is not a direct subclass of class 'sage.categories.category_singleton.Category_singleton' + +even if ``MyStuff`` has already been instanciated:: + sage: MyStuff() Category of my stuff -sage: class MySubStuff(MyStuff): pass sage: MySubStuff() -Category of my stuff +Traceback (most recent call last): +... +AssertionError: class '__main__.MySubStuff' is not a direct subclass of class 'sage.categories.category_singleton.Category_singleton' cdef FastHashable_class obj -if cls.__mro__[1] is not Category_singleton: -# Actually this type error is invisible. But it makes sure that -# the __classcall__ for Category_singleton is not overridden -# when someone is calling it. -raise TypeError, %s is not a direct subclass of %s%(cls,Category_singleton) -obj = UniqueRepresentation.__classcall__(cls) +assert cls.__mro__[1] is Category_singleton, \ +%s is not a direct subclass of %s%(cls,Category_singleton) +obj = super(Category_singleton, cls).__classcall__(cls) obj._hash = Py_ssize_tvoid *cls -return ConstantFunction(obj) +cls._set_classcall(ConstantFunction(obj)) +obj.__class__._set_classcall(ConstantFunction(obj)) +return obj #@lazy_class_attribute #def __hash__(cls): -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-combinat-devel] queue broken on 5.7
Hello, The sage -combinat install failed for my sage-5.7 freshly installed with applying trac_12895-subcategory-methods-nt.patch patching file sage/categories/category_singleton.pyx Hunk #3 FAILED at 277 1 out of 3 hunks FAILED -- saving rejects to file sage/categories/category_singleton.pyx.rej patch failed, unable to continue Best, Vincent -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[sage-combinat-devel] #14065 failed to apply on crystals.py
Hi, I use sage-5.7.beta4 and combinat does not apply {{{ application de trac_14065-combinatorial_object_cmp-ts.patch patching file sage/categories/crystals.py Hunk #1 FAILED at 518 1 out of 3 hunks FAILED -- saving rejects to file sage/categories/crystals.py.rej }}} Best Vincent -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[sage-combinat-devel] Re: #14065 failed to apply on crystals.py
Ooops. My mistake... a qselect problem 2013/2/17 Vincent Delecroix 20100.delecr...@gmail.com: Hi, I use sage-5.7.beta4 and combinat does not apply {{{ application de trac_14065-combinatorial_object_cmp-ts.patch patching file sage/categories/crystals.py Hunk #1 FAILED at 518 1 out of 3 hunks FAILED -- saving rejects to file sage/categories/crystals.py.rej }}} Best Vincent -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-combinat-devel] import_statements and #12543
Ok. Thanks for all your answers, it now needs review. 2013/1/26 Florent Hivert florent.hiv...@lri.fr: On Sat, Jan 26, 2013 at 04:22:27PM +0100, Nicolas M. Thiery wrote: On Sat, Jan 26, 2013 at 02:13:10PM +0100, Vincent Delecroix wrote: It is now a long time since the import_statements is in the queue (last discussion was [1] in May 2012) and I would like to move my patch (import_statements-vd.patch) to the trac server. Does anybody encounter some problems or have further suggestions ? Anne you own the ticket #12543 (opened in February 2012) and it seems that it is a good ticket to put the patch in. What do you think ? It's been working great for me. Let's get it in Sage! +1 Florent -- 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. Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- 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. Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[sage-combinat-devel] import_statements and #12543
Hi all, It is now a long time since the import_statements is in the queue (last discussion was [1] in May 2012) and I would like to move my patch (import_statements-vd.patch) to the trac server. Does anybody encounter some problems or have further suggestions ? Anne you own the ticket #12543 (opened in February 2012) and it seems that it is a good ticket to put the patch in. What do you think ? Best, Vincent [1] http://groups.google.com/group/sage-combinat-devel/browse_thread/thread/bfa63a8a39747c53/da08bfb8714ef869 -- 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. Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-combinat-devel] Rank and unrank for large FiniteEnumeratedSets
2012/12/13, Nicolas M. Thiery nicolas.thi...@u-psud.fr: Hi Andrew! On Wed, Dec 12, 2012 at 05:37:19PM -0800, Andrew Mathas wrote: I have being trying to find the right idiom for look-up and reverse look ups in large enumerated sets. Prior to sage, I simply would have made a large list of the elements in the enumerated set and then just used __getitem__ (implictly) and index(). I thought that in sage here might be an approved and efficient way of doing this but instead I have been surprised. Consider: sage: parts=Partitions(50) sage: parts.category() Category of finite graded enumerated sets sage: mu=parts.unrank(204225);mu [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] sage: parts.rank(mu) 204225 which looks fine except that unrank is very quick whereas rank is very slow. Certainly, rank() could be made more efficient by caching the result )although what to do if the object has multiple parents), but I don't see any way of making unrank() faster until you create a list of elements. Here are the timing for this example: sage: %timeit Partitions(50).unrank(204225) 625 loops, best of 3: 13.7 Aus per loop sage: %timeit Partitions(50).rank(mu) 5 loops, best of 3: 3.66 s per loop Actually, this is a slight lie: initially, rank and unrank both just run through the iterator until they hit their match -- and this is slow -- but after doing something like Partitions(50)[50], in the background Partitions(50)._list has been created and unrank() has been replaced by _list[ rank] whereas rank() is still using the iterator. The culprit seems to be __getitem__ which is initially defined as try: return super(Parent, self).__getitem__(n) except AttributeError: return self.list()[n] With other (ungraded?) enumerated sets such as StandardTableaux(10) the iterator is always used, and this is slow. I think that the behaviour of Partitions(n) above is a bug, but I am getting side-tracked. The question that is want to ask is: If I have a (large but not hugely large) enumerated set for which I will be doing frequent rank() and unrank() calls what is the recommended way of playing with it? My inclination now is just to turn the enumerated set into a list, as _list[2832] and _list.index(mu) are as efficient as you get. Does anyone know of a better way? Short answer for now: if you have a finite enumerated set S and you do S.list(), then this list is cached and used for most other operations (counting, unranking, and probably random generation as a side effect). It would be natural to extend this feature to ranking by building a reverse dictionary (possibly with some level of lazyness, so that the dictionary only gets built if unranking is actually used). I actually did it in #8920 and removed as it appears that it slows down everything as to test my_object in my_dictionnary the object my_object needs to be hashable and you have to catch the error. Perhaps I did it the wrong way... any advice is welcome. Best, Vincent -- 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: sage.sets.disjoint_set and sage.combinat.set_partitions
Hi Travis, Thanks for the pointer. But I still don't understand why it is not called SetPartition (with no s). Disjont-set intends to be a *data structure* and not a mathematical object. My objection is mainly about the naming convention. Best, Vincent 2012/12/6 Travis Scrimshaw tsc...@ucdavis.edu: Hey Vincent, I found this ticket #5039 in which it mentions in the combinat queue (although it seems like it got integrated into sage at some point...), they created the data structure known as a disjoint set. From my understanding (a quick browse of source code), the SetPartitions is the list of all set partitions of a given set, whereas DisjointSet is a data structure which focuses on merging of its sets and getting representatives from each set (see disjoint set's wikipedia page). However, this needs a different name; perhaps UnionFindSet or FindMergeSet? Hope that clarifies things. Best, Travis On Wednesday, December 5, 2012 8:44:23 AM UTC-8, Vincent Delecroix wrote: Hello, I do not understand the purpose of sage.sets.disjoint_set (which moreover has nothing to do with disjoint set) ! As far as I understand it is a duplicate of set partitions with some special features. Am I right ? Best, Vincent -- You received this message because you are subscribed to the Google Groups sage-combinat-devel group. To view this discussion on the web visit https://groups.google.com/d/msg/sage-combinat-devel/-/qFWLQXLHdHEJ. 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: facade initialisation
Vincent: the behavior described in the second example on the ticket is what it should be. The parent should override facade_for if it uses facade=True. On the other hand, if you find it useful, you may change the default implementation of facade_for to return a more meaningful example and/or add appropriate cross references in the documentation. Ok. What should return facade_for if there are infinitely many of them ? A tuple does not fit. It may be an iterator but the default constructor then fails. And I think that an AttributeError is not what it should be, I would prefer a NotImplementedError: parents for which ThisParent is a facade for are unknown (see sage.categories.facade_sets) For the first example: probably it's category.join that should be improved, but that will do for now. It does not as I need it ;-) As far as I understand, the problem comes from parent.pyx where it is written category = Category.join((category, Sets().Facades())) You prefer that I allow argument of Category.join to be a tuple of tuples of tuples of tuples of categories ? (one may safely use a flatten) Many thanks for clarification, Cheers, Vincent -- 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: facade initialisation
2012/12/6 Nicolas M. Thiery nicolas.thi...@u-psud.fr: On Thu, Dec 06, 2012 at 10:27:27AM +0100, Vincent Delecroix wrote: Ok. What should return facade_for if there are infinitely many of them ? A tuple does not fit. It may be an iterator but the default constructor then fails. Only the future will tell if there is a good use of facade_for when there are infinitely many of them. That's why I left it as is. I understand. And I think that an AttributeError is not what it should be, I would prefer a NotImplementedError: parents for which ThisParent is a facade for are unknown (see sage.categories.facade_sets) Sounds reasonable. I will. For the first example: probably it's category.join that should be improved, but that will do for now. It does not as I need it ;-) As far as I understand, the problem comes from parent.pyx where it is written category = Category.join((category, Sets().Facades())) You prefer that I allow argument of Category.join to be a tuple of tuples of tuples of tuples of categories ? (one may safely use a flatten) As I said, in principle this would be the right fix, but please stick to the workaround in Parent.__init__ since since Category.join is under heavy refactoring. Do you have a patch for that ? When do you want it to be finalized ? We are working together with Setpan on words/language categorification and we want it to be soon ready and reviewed (as each new version of Sage introduces many files to be updated and many hours lost). If you have a relatively final beta version, we may use it in top of our work instead of modifying Parent. Cheers, Vincent -- 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] facade initialisation
Dear facade lovers, I just upload on trac a patch about the initialisation of facade sets at #13801. One of the smallest patch I never write... which corrects two errors. Please, send comments. Best, Vincent -- 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] sage.sets.disjoint_set and sage.combinat.set_partitions
Hello, I do not understand the purpose of sage.sets.disjoint_set (which moreover has nothing to do with disjoint set) ! As far as I understand it is a duplicate of set partitions with some special features. Am I right ? Best, Vincent -- 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: facade initialisation
An example in sage.sets.finite_enumerated_set. But an example is not an explanation ;-) 2012/12/6 Travis Scrimshaw tsc...@ucdavis.edu: What is the reason why facade=True is allowable by Parent? It seems like we always want to pass in the parent(s) which our facade parent is acting for. On Wednesday, December 5, 2012 8:23:01 AM UTC-8, Vincent Delecroix wrote: I just upload on trac a patch about the initialisation of facade sets at #13801. One of the smallest patch I never write... which corrects two errors. -- 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] Permutations... again.
Saluut, Here's how you can get an infinite loop in two lines with Permutation. sage: p = Permutation([(1,10,11,13,9,3,16,0,22),(8,2,15,18,24,26,20,21,4),(5,6,17,12,25,7,23,14,19)]) sage: p.to_cycles() Of course it has to be because my permutation goes from 0 to n-1 while the code expects 1-n. It is all very nice. Now, if the code does not work, we should just refuse to build the corresponding permutations, and say it only works with integers. Otherwise it has to be fixed quicjky or all this code is totally useless. An other nice feature {{{ sage: Permutation([-1,1]) [-1, 1] sage: Permutation([-1,1]).to_cycles() [(1, -1, False)] }}} By the way : is there any r%$$$%$ reason why Permutations (with a terminal s) does not contain Permutation object but LISTS ? sage: list(Permutations([a,b,c])) [['a', 'b', 'c'], ['a', 'c', 'b'], ['b', 'a', 'c'], ['b', 'c', 'a'], ['c', 'a', 'b'], ['c', 'b', 'a']] sage: map(type,list(Permutations([a,b,c]))) [type 'list', type 'list', type 'list', type 'list', type 'list', type 'list'] Permutations are the possible permutations of a (multi)set and should not be considered as bijection (as the permutations in the python library itertools). In particular, the following does work {{{ sage: Permutations('aabb').list() [['a', 'a', 'b', 'b'], ['a', 'b', 'a', 'b'], ['a', 'b', 'b', 'a'], ['b', 'a', 'a', 'b'], ['b', 'a', 'b', 'a'], ['b', 'b', 'a', 'a']] }}} In particular, the parent Permutations does *not* contains Permutation. A bit confusing, but I think that's it! I know, it would be slower otherwise. But it is bad code. This kind of things should be done with an optional flag if you need it. +1 Cheers, Vincent -- 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] Partition options and cleanup patch
Granted: there should be an abstract class for word-like objects (or more possibly generally objects with labels), and this method should be implemented there. But in the mean time just leave it there. Note that the terminology is not uniform. Among others * evaluation * Parikh vector * Abelianization * number of occurences of letters * ... see [1] It would be nice that we have a convention for that. Should we put all of .evaluation(), .parikh_vector() and .abelianization() in the namespace of a word-like object ? Which one should be the prefered one ? [1] http://wiki.sagemath.org/LanguagesAndTilings#Parikh_vector.2C_evaluation.2C_abelianization Best, Vincent -- 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] Global options for elements set by their parents
Hi, For string representation, I think that it sould be a matter of the parent via a _repr_element_ method. This method is yet used in some classes. The issue may be fixed with the modification of Element.__repr__ as def __repr__(self): if self.__custom_name: return self.__custom_name if hasattr(self._parent, '_repr_element_'): return self._parent._repr_element_(self) return self._repr_() If two parents with the same Element class would like two different representations it is natural to implement them inside the parent (otherwise Element will be full of methods like _repr_v1_, _repr_v2_, ...). What do you think ? Best, Vincent -- 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] SearchForest and post_process...
Hi, Thanks to Nicolas the Little, Sage has a SearchForest class. It is a very nice tools to iterate through sets defined by a recursive choice tree. Unfortunately, currently due to the name someone who doesn't know that it exists has no chance to find it. It seems that there is an agreement that the mane should be changed but we didn't yet find a good one. Let me describe a little what it does (please refer to the doc for more informations and examples): The enumerated set is mostly described by two data: - roots which are the starting nodes of the recursive generation - children with compute the immediate successors of a node in the generation tree. There are many examples of languages that may be built along those lines (words on {a,b,c} that does not contain any square, smooth words, ...). I was able to build word on {a,b,c} without squares in 2 lines and 1 minute... so I love it. Thanks to Nicolas the little! {{{ is_square = lambda w: len(w)%2 == 0 and w[:len(w)/2] == w[len(w)/2:] children = lambda w: [v for v in [w+'a',w+'b',w+'c'] if not any(is_square(v[i:]) for i in xrange(-2,-len(v)-1,-2))] }}} And then {{{ sage: S = SearchForest(roots = [''], children = children) sage: list(S.elements_of_depth(4)) ['abac', 'abca', 'abcb', 'acab', 'acba', 'acbc', 'babc', 'baca', 'bacb', 'bcab', 'bcac', 'bcba', 'caba', 'cabc', 'cacb', 'cbab', 'cbac', 'cbca'] sage: S.elements_of_depth_iterator(100).next() 'abacabcacbabcabacabcacbacabacbabcabacabcacbabcabacbabcacbacabacbabcabacabcacbabcbacabacbabcabacabcac' }}} But for more complicated languages, to build words of length n+1 we need in general more than the words of length n... ie we have to store extra computation for each word of length n. As far as I understand, removing extra computation may be an example of post_process ? Here are some proposal for search forest: - TreeGeneratedSet - ForestGeneratedSet - RecursivelyGeneratedSet - ChoiceTree - ChoiceForest ... For naming convention, I would like to see Recursive and I don't understand why there is a Search in the name ? It is more an exhaustion than a search, isn't it ? Cheers, Vincent -- 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] slice
Hello, I do have a question linked to categorification of sage.combinat.words (trac #12224), Subwords (trac #10534) and graded sets (trac #10193). For object like integer partition, compositions or words, it make sense to take slices. In the current implementation we do have quite different behavior for slices and parents {{{ sage: p = Partition([3,2,2,1]) sage: type(p[1:5]) type 'list' sage: p.parent() Partitions of the integer 8 sage: c = Composition([1,3,2,1,3]) sage: type(c[1:5]) type 'list' sage: c.parent() Compositions of non-negative integers sage: w = Word([1,3,3,1,2,1]) sage: type(w[1:5]) class 'sage.combinat.words.word.FiniteWord_list' sage: w.parent() Free monoid over {1, 2, 3} # this is the new implementation!! }}} Note that for partitions, slice with negative step is not defined. I would like that p[1:5] returns a partition and p[5:1:-1] returns an error (or a list). For such objects, it is possible to consider factors, subwords, shuffle product... but it is quite hard to have a common implementation for all of them (shuffle product needs to work for compositions and words). It would be nice to have a sort of protocol for sliceable elements in Sage in order to allow functorial construction as Subwords or ShuffleProduct. * Do we need that a slice like p[1:5] returns an object of the same family ? * Is it interesting to make Subwords(Partition([3,2,1,1])) work ? * What should be the default parent of Partition([3,2,1]), Composition([3,2,3,1]) or Word([1,2,1,2,3]) ? We have many choices. As an example, for Partition([3,2,1]) have four natural parents * partitions * partitions of 6 * partitions of length 3 * partitions of 6 of length 3 * Does slice make sense for other Sage objects ? Best, Vincent -- 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] Parent with facade
Hello, There is a weirdness in the initialization of Parent with a facade. Consider the following example class MySet(Parent): def __init__(self): Parent.__init__(self, category=(FiniteEnumeratedSets(), Monoids())) The category of an instance of MySet is just a join of the two categories. When I add a facade argument to the initialization of Parent as in class MyFacadeSet(Parent): def __init__(self): Parent.__init__(self, category=(FiniteEnumeratedSets(), Monoids()), facade=FreeMonoid(2, 'ab')) I got the error AttributeError: 'tuple' object has no attribute 'is_subcategory'. It is few lines in Parent.__init__ but I suspect that some ticket solves the problem yet. Does anybody know what should I do? Best, Vincent -- 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] queue for sage-5.3.beta2
Hi Anne, Your patch applying trac_8920-alphabet-vd.patch patching file sage/combinat/words/finite_word.py Hunk #2 FAILED at 129 1 out of 23 hunks FAILED -- saving rejects to file sage/combinat/words/finite_word.py.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir errors during apply, please fix and refresh trac_8920-alphabet-vd.patch Sorry for that. I'm still on 5-3.beta1! I temporarily disabled it before rebasing on sage-5.3.beta2 that I'm currently compiling. Best, Vincent -- 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] int and Integers
Hi, I'm working on #8920 about factorization of codes between alphabets and sets. I got problems with the following behavior:: {{{ sage: int(2) in IntegerRange(1,3) False sage: int(2) in Integers() True sage: int(2) in NonNegativeIntegers() True sage: int(2) in PositiveIntegers() False }}} It breaks many test in sage.combinat.*. Note that if we adopt the strict convention (ie int(2) not in Integers/IntegerRange/...) then it will be impossible to do the following {{{ sage: W = Words(positive integers) sage: W([int(1), int(2)]) word: 12 }}} I have two options * modify all files in sage.combinat.* in order to fit the new implementation * make PositiveIntegers and IntegerRange accepts silently Python int Cheers, Vincent -- 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] Re: int and Integers
Quick update : I really don't like the following (which comes from the default sage.structure.parent.__contains__) {{{ sage: Zmod(12)(5) in ZZ True }}} 2012/8/16, Vincent Delecroix 20100.delecr...@gmail.com: Hi, I'm working on #8920 about factorization of codes between alphabets and sets. I got problems with the following behavior:: {{{ sage: int(2) in IntegerRange(1,3) False sage: int(2) in Integers() True sage: int(2) in NonNegativeIntegers() True sage: int(2) in PositiveIntegers() False }}} It breaks many test in sage.combinat.*. Note that if we adopt the strict convention (ie int(2) not in Integers/IntegerRange/...) then it will be impossible to do the following {{{ sage: W = Words(positive integers) sage: W([int(1), int(2)]) word: 12 }}} I have two options * modify all files in sage.combinat.* in order to fit the new implementation * make PositiveIntegers and IntegerRange accepts silently Python int Cheers, Vincent -- 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: int and Integers
Thanks Simon. The default behaviour of x in P for any parent P in Sage is: x in P = P(x)==x is True (and does not raise an error) This default behavior is very badly suited. In parallel to my second mail, I found the more striking example {{{ sage: R = Zmod(5) sage: i = ZZ(3) sage: j = R(3) sage: i in R and j in ZZ True sage: i == j True sage: 1/i in R False sage: 1/i == 1/j False }}} I definitely think that Zmod(5)(3) in ZZ should return False. Remarks that it is true as a subset as Zmod(5)(3) is the set of integers equal to 3 mod 5. In other words 3 in Zmod(5)(3) should returns True but it returns an error. I think that's a mess. P should at least know that it is a subset of ZZ. Hence, its embedding into ZZ should be registered as a coercion. And it should be able to convert a positive python int. It is easy to create an embedding into ZZ and modify the __contains__ method. Then many things work well. Note that P is a facade and hence it is normal that its elements have a parent different from P. But is there a canonical way to tell that a Parent is a subset of another Parent? Best, Vincent -- 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] Newbie review question
Hi Andrew, 2012/7/30, Andrew Mathas andrew.mat...@gmail.com: I want to review a few patches but I am confused by one point. The wiki says that the patch should apply cleanly to the *latest development release*. What is confusing me is that the patches in the queue, and those on trac, are typically applied on top of other patches so I would have guessed that quite often they will not apply cleanly to the release version with no patches applied. For example, this just happened when I tried to apply Jason Bandlow's patch trac_9265_tableaux_categories_jb.patch. On the other hand, this patch does apply cleanly from the queue. Question: do you bounce the patch back to the author in this situation? Similarly, when you are writing patches how do you avoid this? Dependencies should be used in trac (it is one of the field in the definition of the ticket and consists an a (possibly empty) sequence of patches). An example at [1]. When a patch is ready in sage-combinat it should apply cleanly on the top of the needs-review part of the series file. Then, if needed, you specify on the trac ticket that your patch needs to be applied after some others in the dependencies field. [1] http://trac.sagemath.org/sage_trac/ticket/10132 Best Vincent -- 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] import statement strange behaviour
By the way, you haven't pushed your latest changes. Right ;-) done. -- 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] import statement strange behaviour
Potential workarounds: - Accept things as they are: that's just a corner case, it's easy for the user to fix the name after the import - Accept strings like cached_method as input as well as names for those cases I like it better. But that way there is no better method than parsing for finding its module! - Find some heuristic for those cases (usually the lower case is preferred to the upper case?) Nope. It really depends. Some funny guy may write integer_ring = IntegerRing() somewhere. Anyway, we should not waste too much time on that. +1 The last version of the patch seems better (it corrects the from 'sage.all import ZZ' into 'from sage.rings.integer_ring import ZZ' but keeps the problem of CachedMethod vs cached_method). Note that the option verbose should perhaps be True by default? I'm waiting for more feedback before creating a ticket. Best, Vincent -- 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] subshifts of finite type
Hi Michael, Since I am new to SAGE development Welcome ;-) just created a ticket #12996 for a patch including a class with support for one-dimensional shifts of finite type which should eventually make its way into sage/dynamics/symbolic. Very cool! The first data structure for set of infinite words! I hope that I will have enough time to start a part of the review next week. Best, Vincent -- 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] import statement strange behaviour
2012/5/20, Nicolas M. Thiery nicolas.thi...@u-psud.fr: On Sun, May 20, 2012 at 11:07:16AM +0200, Vincent Delecroix wrote: Hello, On Fri, May 18, 2012 at 07:36:51AM -0700, Frédéric Chapoton wrote: trying to test my own files on sage 5.0, it seems that it takes many import statements. Some of them behave strangely : sage: import_statements(euler_phi) from sage.rings.arith import Number of positive integers =n but relatively prime to n sage: import_statements(QQ) from sage.rings.rational_field import Rational Field Now with import_statements-vd.patch applied {{{ sage: import_statements(euler_phi) from sage.rings.arith import euler_phi sage: import_statements(QQ) from sage.all import QQ }}} The hack is very weak (uses find and grep from the shell) but mainly works. Feel free to improve. Thanks! Now that I think about it, here is a variant to recover the name under which the object is stored in its module: sage: module = sys.modules[euler_phi.__module__] sage: [key for key in module.__dict__ if module.__dict__[key] == euler_phi] ['euler_phi'] Of course it's not robust if the object has an alias in this module. And if the object is stored in a module while its class is defined in a different module. In particular sage: sage: module = sys.modules[ZZ.__module__] sage: [key for key in module.__dict__ if module.__dict__[key] == ZZ] [] Do the following is more safe? 1) treat the case of the object being a module itself 2) try to see if the object is defined in the same module as its class (what Nicolas suggested) 3) make a lazy search using globals() and find/grep (what I wrote in the patch) the case of euler_phi is done with 2) while the case of ZZ is done with 3). Remains the problems of aliases... any concrete example? Vincent -- 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] import statement strange behaviour
Dear all, I push a last version of import_statements. Use it and break it... (good luck :-) The implementation uses mainly sys.modules (thank you Nicolas for that pointer). In the case the object is an instance of a class, the final check is done using sage_getsource/re instead of find/grep. If you run tests there is a very nice error: sage: import_statements(ZZ, verbose=True) Expected: [...] sage.all [...] from sage.all import ZZ Got: [...] __main__ [...] from sage.all import ZZ which looks like a bug as the behavior of the tester should be what we get in the command line version of Sage? Once the import statement is determined, can we try to evaluate it and raise an error if it doesn't work? This would at least catch syntax errors like this: from sage.rings.rational_field import Rational Field +1 Cheers, Vincent -- 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] import statement strange behaviour
When there are several names, I think we should return the one that agrees with the name that was given by the user. I really don't know how we can obtain the name used inside the function. We should somewhat access the stack of calls of the console (as the calls import_statement(CachedFunction) and import_statements(cached_function) are semantically the same). What you would expect from the following non-examples sage: z_not_ZZ = ZZ sage: import_statements(z_not_ZZ) and the trickier sage: import_statements(1) and the even trickier sage: f = lambda x: return cached_function sage: import_statements(f()) remove sage.all from the list of modules. If someone wants to import ZZ, they should not do it with: from sage.all import ZZ but instead with from sage.integer_ring import ZZ We can add an exception for it (and even remove sage.all from the list of modules ?). But then, why is there ZZ = IntegerRing() in the file all.py? Simply removing sage.all from the available modules leads to sage: import_statements(ZZ) from sage.coding.linear_code import ZZ More generally, there are many files where it is written ZZ = IntegerRing(). I think this should be avoided. Are there some coding coventions about instanciations within modules? Best, Vincent -- 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] Permutations and trac ticket #8392
2012/5/16, Nicolas M. Thiery nicolas.thi...@u-psud.fr: On Tue, May 15, 2012 at 11:19:11PM -0700, Travis Scrimshaw wrote: So the old permutations patch was sufficient (minus a few doc-strings tests which were in #9831 that is no longer in the queue), and I couldn't produce an error with WeightedIntegerVectors. However there is still the previously noted conflict with improve_constructors_of_iet-vd.patch, and I'd like to just copy/paste that code into this patch (its simple and elegant). Yet the queue produces duplicate code when the vd.patch is applied. So does anyone know if I'd be safe to just remove this from the vd.patch, otherwise who should I contact about this? From `hg log`, this patch hasn't changed since september 2011. So yes, that sounds safe. I guess Vincent Delecroix will even be pleased not to have to handle this hunk anymore (Vincent: please complain if not!). Please. Do it. No problem on my side. Cheers, Vincent -- 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] problem in words
Hi Martin, hi Nicolas, 2012/3/15, Nicolas M. Thiery nicolas.thi...@u-psud.fr: Hi Martin, hi Vincent, On Thu, Mar 15, 2012 at 08:43:47AM +0100, Martin Rubey wrote: I was using lrcalc, and noticed that supplying the weight keyword does not work, not even the doctest: (this is on sage 4.8) lrcalc.lrskew([3,2,1], [2], weight=[3,1]) gives 1 not in alphabet. I found that the problem is that the row_word of a skew tableau expects its entries to be from ZZ, while lrcalc uses int's. If this is not known, how should it be fixed? Should we convert the entries of the tableau returned by lrcalc to ZZ's or only when computing the row_word? For the record, this only appears when alphabet-vd.patch is applied. Without it, the doctest pass (4.8, 5.0): Sorry for this. The reason is: {{{ sage: 1 in IntegerRange(5) True sage: int(1) in IntegerRange(5) False }}} and that alphabet-vd.patch now makes IntegerRange a default for alphabet over integer. I don't know what to do... Cheers, Vincent -- 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] posets (#10998) and sets from iterator (#12518)
Hi, There was in sage-combinat queue a patch of Mike that add to Permutation a decorator @combinatorial_class_from_iterator for burhat_succ and bruhat_pred in order to return a CombinatorialClass and not a list. In #12518, I replaced it with @set_from_method which should be the new version of combinatorial_class_from_iterator as it use the category framework and no more CombinatorialClass. But then #10998 used bruhat_succ as if it was a list and create an error when calling. On sage-5.0.x with both patches applied (beware that #10998 is merged in sage-5.0.beta7): {{{ sage: SymmetricGroupBruhatOrderPoset(3) Traceback (most recent call last): ... TypeError: unhashable type: 'dict' }}} I see three possible fixes: * remove the wrapper for bruhat_pred and bruhat_succ (I just add them in order to be complient with Mike's patch) * use p.bruhat_succ().list() to send data to Posets (in sage.combinat.posets.poset_examples.py) * make Poset accept FiniteEnumeratedSets in the same way it accepts lists and tuples Cheers, Vincent -- 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] [sage-devel] Bug with Schubert polynomials?
Hello, Sage is not saying anything. But, there seem to be a fix in sage-combinat : sage: perm = Permutation([1,2,1]) --- ValueErrorTraceback (most recent call last) ... ValueError: the list l (=[1, 2, 1]) must contain each integer of {1,...,n} It's me (improve_constructors_of_iet-vd.patch). But, I don't know if it's a good idea as it slows down everything. In PermutationGroupElement, there is a check options wich is set to True by default. This may be an issue. Cheers, Vincent -- 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] error raised by unrank
Hello, Here is a question about conventions for enumerated sets: In sage.sets.finite_enumerated_sets unrank raise an IndexError: tuple index out of range if the index is out or a TypeError: tuple indices must be integers, not str if the argument is not coercable into an integer. While, the implementation ._unrank_from_list from the category raise a ValueError: the value must be between %d and %d inclusive. I think we should specify a convention, at least for the error. Which one ? To fit with Python, the IndexError/TypeError seems well adapted. Cheers, Vincent -- 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: cores and partitions
2012/3/1, Anne Schilling a...@math.ucdavis.edu: Now Mike pointed out further that whether an element needs to be typed or not to be in the set is rather arbitrary: sage: [3,1,2] in Compositions() True sage: [1,2,3,4] in Words() False sage: [1,0,1,0] in DyckWords() True sage: [[1,2],[3]] in Tableaux() True sage: [1,2,3,4] in LyndonWords() True sage: [[1,2,3],[4,5]] in SetPartitions(5) True sage: [1,2,3,4] in Permutations(4) True On that question, the default implementation in sage.parent.Parent.__contains___ is a bit curious: to test whether x is in P, it first does y = P(x). If it leads to a TypeError or ValueError then False is returned, otherwise, it returns the value of x == y. We definitely needs two methods for testing whether x is in P: 1) strong element checking: x should be an instance of Element and has parent P or has a Parent with a natural coercion to P (not valid for facade) 2) permissive type checking: returns True if P(x) is allowed We have to choose whether 'sage: x in P' does 1) or 2). The default Parent implementation is actually between them. Should a convention be adopted for all parents ? Only for parent in the Sets() category ? Cheers, Vincent -- 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] cardinality of infinite enumerated set
2012/2/23, Nicolas M. Thiery nicolas.thi...@u-psud.fr: On Wed, Feb 22, 2012 at 03:12:39PM +, Vincent Delecroix wrote: Actually the methods are removed in trac_10963-more_functorial_constructions-nt.patch But then, I get a problem when I build a parent which is an infinite enumerated set as it does not inherit the cardinality method... The above patch moves this implementation of cardinality to Sets().Infinite() where it belongs (see Sets.Infinite in sets_cat.py). This category did not exist before. In principle, your parent should still inherit it. Doesn't it? I'm not able to reproduce the example where .cardinality() was lost... Hence, everything seems to work. Thanks, Vincent -- 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] facade and coercion
Hi, What do you think about {{{ sage: ZZ.has_coerce_map_from(NN) False }}} Despite of the fact that {{{ sage: NN.facade_for() (Integer Ring,) }}} Cheers, Vincent -- 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] IntegerRange and IntegerVectors
Hello, Sorry, me again! I am refactoring the code of lyndon_words to fit the new word implementation. I do not have a problem except for int/Integer incompatibilities. More precisely, I do not understand {{{ sage: Integer(1) in IntegerRange(0,4) True sage: int(1) in IntegerRange(0,4) False }}} because of {{{ sage: v = IntegerVectors(3).an_element() sage: map(type, v) type 'int' }}} What is reasonable : that int(1) in IntegerRange(5) returns True or that IntegerVectors are vectors of Sage integers? Cheers, Vincent -- 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] lazy enumerated set
Finally I implemented two decorators : one for functions and one for methods and everything seems to work. The last version is in sage-combinat queue. I have to write down documentation but the ticket should be finalized today. If you have any remark on naming convention, architecture, possible improvement... Cheers, Vincent -- 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] Sage-Combinat on Sage 5.0.beta4 and updated sage-combinat script
2012/2/18, Nicolas M. Thiery nicolas.thi...@u-psud.fr: Hi Florent, Vincent, All my edits in the series file to carefully craft guards on the patches that are already merged in 5.0 got discarded in one of the recent merge! I reinstated them, so the queue should work again ... That should be me! I made small changes at various places in series. I appoligize. I'm a bit stuck by the procedure after hg merge. vi opens with three windows. The one on the left is clearly what remains at the end, the one in the middle should be the one from the update and the one on the right the original. Is that true ? Vincent -- 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] lazy enumerated set
I get trouble with TestSuite which only works when elements of the set have parents. In particular it does not work in the following case {{{ sage: from sage.sets.set_from_iterator import EnumeratedSetFromIterator sage: E = EnumeratedSetFromIterator(graphs, category=InfiniteEnumeratedSets()) sage: TestSuite(E).run() }}} Actually the above example leads to an infinite loop. If E is not the parent of the element generated by E, and a fortiori if those element have no parent, then you should mark your enumerated set as a facade: sage: E = EnumeratedSetFromIterator(graphs, ... category=InfiniteEnumeratedSets().Facade()) It is yet a facade! I wrote an implementation of the decorator for functions (which works!) but I'm not sure about what to do for the case of methods. Any idea ? As soon as the decorator is ready, the ticket will need review. I currently don't see the problem. Can you be more specific ? With the current implementation the following works sage: @set_from_iterator ... def f(n): return xsrange(n) but not the following sage: class A(): ... @set_from_iterator ... def f(self,n): ... return xsrange(n) In sage.misc.cachefunc there are some specific issues about method vs functions. But we are in a simpler case. I get a new problem with the documentation. What should expect the user asking the documentation/code of a decorated @set_from_iterator ? The documentation/code of EnumeratedSetFromIterator or the documentation/code of the function from which the set is built ? Cheers, Vincent -- 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] queue pb on sage-5.0
Hi, Trying to apply the combinat queue on sage-5.0.beta2 I get applying trac_10963-more_functorial_constructions-nt.patch patching file sage/categories/commutative_additive_monoids.py Hunk #1 FAILED at 2 1 out of 2 hunks FAILED -- saving rejects to file sage/categories/commutative_additive_monoids.py.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir errors during apply, please fix and refresh trac_10963-more_functorial_constructions-nt.patch Vincent -- 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] lazy enumerated set
2012/2/16, Vincent Delecroix 20100.delecr...@gmail.com: 2012/2/11, Nicolas M. Thiery nicolas.thi...@u-psud.fr: On Sat, Feb 11, 2012 at 12:05:49PM +0100, Florent Hivert wrote: Together with the language-team, we decided to implement a LazyEnumeratedSet (see my patch in the queue) which takes as input an iterable (finite or infinite) and mimic a set which contains the element of the iterable. It is very useful when we do not want to implement a specific class... What do you think of it ? On the other hand, I'm a bit disappointed as it is not possible to pickle an iterator and hence my new class does not pass the TestSuite. Any idea ? I think this is a good idea to have this feature for the casual user but that it should not be used in the code. The reason are: 1 - The set will not be picklable; 2 - The usage of tee is likely to leak a lot of memory; 3 - For programmer, I don't think it is a big save compared to subclass and implementing the Cardinality and __iter__ methods. Please have a look it some methods couldn't be lifted in the category EnumeratedSet. If you agree, as a consequence, you should add a big warning at the beginning of the file. Finally, may I suggest the alternative name EnumeratedSetFromIterator ? We discussed this with Vincent over the phone: I pointed him to the combinatorial_class_from_iterator decorator implemented in class_from_iterator.patch; he volunteered to refactor it as enumerated_set_from_iterator. Note that, as a decorator over an existing function which produces an iterator, it's picklable. I think it's reasonable to use it in code for implementing little functions that returns a set, the main use of which will be to iterate over. This is now #12518. Following Florent, I removed ._cardinality attribute and simplify everything. I also add an implementation of a cache which allows the iterator to be used only once (see sage.misc.iter_with_cache). I get trouble with TestSuite which only works when elements of the set have parents. In particular it does not work in the following case {{{ sage: from sage.sets.set_from_iterator import EnumeratedSetFromIterator sage: E = EnumeratedSetFromIterator(graphs, category=InfiniteEnumeratedSets()) sage: TestSuite(E).run() }}} Actually the above example leads to an infinite loop. I wrote an implementation of the decorator for functions (which works!) but I'm not sure about what to do for the case of methods. Any idea ? As soon as the decorator is ready, the ticket will need review. Trying to put my patch a little bit higher in the queue, I noticed the presence of the patch class_from_iterator.patch (which does not commute with mine as I basically deprecate what it did). There is no author, if there is no candidate for the ownership I will simply remove it... Vincent -- 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] lazy enumerated set
Hello, Together with the language-team, we decided to implement a LazyEnumeratedSet (see my patch in the queue) which takes as input an iterable (finite or infinite) and mimic a set which contains the element of the iterable. It is very useful when we do not want to implement a specific class... What do you think of it ? On the other hand, I'm a bit disappointed as it is not possible to pickle an iterator and hence my new class does not pass the TestSuite. Any idea ? Cheers, Vincent -- 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] Re: Alphabet and FiniteEnumeratedSets
One more, One item on the todo list is the migration from CombinatorialClass to FiniteEnumeratedSet and InfiniteEnumeratedSet. What happens to the following functions * rank(self, elt) * unrank(self, i) * __getitem__ = unrank They are not implemented for IntegerRange as I would expect. Best, Vincent -- 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] Alphabet and FiniteEnumeratedSets
Hello, I'm working on refactorization of sage.combinat.words (#12224) and I have two general questions of design. 1) The class Alphabet (in sage.combinat.words.alphabet) does nothing more or less than EnumeratedSets (in sage.sets.finite_enumerated_sets). It is considered as a basis for the free monoid named Words in sage.combinat.words.words. I suggest to remove it and that Words will be built on an EnumeratedSet. Does anyone see an obstruction to that ? 2) There is a speed question about whether or not expanding an inverse dictionnary for FiniteEnumeratedSet. I mean a dictionnary {elt nb i - i}. It is critical for words (and I hope for other purposes) to test quickly whether an element is contained in a FiniteEnumeratedSet. For a set of size 100 there is a factor 10 of efficiency: {{{ sage: l = range(100) sage: s = set(l) sage: timeit('0 in l') 625 loops, best of 3: 333 ns per loop sage: timeit('123 in l') 625 loops, best of 3: 5.8 µs per loop sage: timeit('0 in s') 625 loops, best of 3: 360 ns per loop sage: timeit('123 in s') 625 loops, best of 3: 338 ns per loop }}} Storing the inverse dictionnary will speed up the rank function as well. Cheers, Vincent -- 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] class functions and group actions
Hello, I'm looking at what I would like to do in Cernay, and I found new things about groups and group actions... but perhaps some of the stuff is implemented somewhere. I will complete the wiki on that topic just before the begining of the week. If you have any comment, please do. 1) The sage.groups.class_function.ClassFunction wraps the corresponding GAP's object. The class is nice because we are in particular able to decompose any class function as a sum of characters! But a bad point is that the class function is not an element of an algebra. In particular we can neither multiply a class function by a scalar nor add two class functions! * In Sage, should we consider the class functions with coefficients in R as the dual of the center of R[G] ? * Somebody knows how does the relation between group algebra and characters work in GAP ? 2) If G is a finite group and O x G - G a finite G-action, then there is a natural permutation character associated to it (pi(g) = # nb of fixed point of g). The functions is quite generic and may be put very high in the hierarchy. Where ? Which name is the best adapted ? O.character() ? 3) The SymmetricGroup is currently implemented as a right action. But it appears that I need the natural diagonal action of G x G on (G / H) x (H \ G) (first factor acts on left and second factor on the right). Is there a way to handle that or is still in the todo list ? Cheers, Vincent -- 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] min-part, max-part
Dear compositions lover, I found a weird bug which perhpas needs a ticket : it is not possible to send a composition for argument inner/outer of Compositions as in : {{{ sage: c = Composition([2,2,1]) sage: C1 = Compositions(5,outer=c); C1 Compositions of the integer 5 satisfying constraints outer=[2, 2, 1] sage: C1.list() --- TypeError Traceback (most recent call last) ... TypeError: 'Composition_class' object is not callable sage: C2 = Compositions(5,outer=list(c)); C2 Compositions of the integer 5 satisfying constraints outer=[2, 2, 1] sage: C2.list() [[2, 2, 1]] }}} What do you think ? Cheers, Vincent -- 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] min-part, max-part
Hello, I think we should record such things for the week at Cernay during which we intend to speak about basic object in combinatorics. Feel free to create a wiki page about weirdness in basics objects of combinatorics. I will also try to add some comments about integer vectors. I think you are clearly right about the fact that inner/outer can be elements of the parent as the feature is related to a (partial) order relation between elements. Good idea. But somebody decided to make a wiki page for Cernay in rst format... I do not know how to make a link to another wiki page ? help ! Cheers, Vincent -- 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] enumerated sets with grading
Dear all, I'm currently implementing factorial languages which are just a set of words which stable under taking factors. Such object for sure should be a parent and the associated words its elements. Moreover, I suspect that a the good category would be FiniteEnumeratedSet or InfiniteEnumeratedSet (?). But there is an important structure which is omitted : a word has a length. Hence my set is graded and the number of objects of fixed length is finite (looks like Partitions() or Permutations()). Is there a plan for a category for it ? Are there standard names for * iterator over object of length n (in Words it is iterate_by_length()) * the function n - cardinality of word of length n (in language theory, a standard name seems to be pattern complexity) * generating functions Also, the behavior of FiniteEnumeratedSet/InfiniteEnumeratedSet is not well adapted to the following * it seems natural to me that L[n] should return the set of words of length n (?) * __iter__ should just go through the iterate_by_length(n) for n from 0 to ... Any advice or pointers through existing objects in Sage are welcome. Cheers, Vincent -- 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] Sage-Combinat meeting in Cernay
Dear sage-combinat lovers and Cernay organizers, From the poll (I appologize that I vote twice) it seems that the week from 6/2 to 10/2 has the best possible audience (8 people). http://nuages.domainepublic.net/cd7d/vote/ For my organization (and the one of Stepan), I would like a week to be fixed. Is this possible in the next few days ? Cheers, Vincent -- 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] Sage coding sprint in Orsay
2011/11/24 Florent Hivert florent.hiv...@lri.fr: I'm thinking about organizing a small one-week coding sprint around January-February in the south-west of Paris. Following the *-combinat tradition I plan to reserve the Guest house at Cernay-la-Ville: [...] - Refactoring of the combinatorics infrastructure (factories, Cythonizing partitions, compositions...) Cool ! And I would like to add for combinatorics infrastructure : - implementations of Gray codes (for much faster generation) - iterator for conjugacy class of the symmetric group (the call to Gap takes hours) And I would like to emphasize that there are Cythonization problems with iterators... - Categories (Morphisms, functorial constructions, optimization, coercion ?) - who is interested ? I am. - what is the preferred week ? Any time in January or the first week of February. - any thematic suggestion, Depending on the audience (Thierry Monteil ? Samuel Lelièvre ? Timo Jolivet ?), I would like to start the migration of - flat surfaces (quadratic differentials, topolgoy stuff, origamis, ...) - language and symbolic dynamics - tilings Some of it is ready and documented and only needs review. Nicolas Borie will you be there ? If you do, I would like to hear about the code in Sage (and more generally about algorithms) for generating things up to isomorphism (like graphs, Integer vectors and co.). Cheers, Vincent -- 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] Multiple databases and sage
Hello, I am currently participating in a sage-based project that aims to integrate a lot of number theory databases [...] I am very interested in the project since I have the problem of interfacing databases in Sage from various sources (in particular, one sounds number theoretical: the database of congruence subgroups of Cummins and Pauli). I expect these to be very common problems when trying to integrate mathematical data from various sources into sage, regardless of the area of mathematics. Some participants of the sage-combinat project are pushing for the concept of Categories [...] I think that similarly the problems I have described in the first paragraph could be partly solved from a new concept of MathematicalDatabases [...] I am not one of the master of the categorical stuff in Sage, but as far as I know there are yet some Python library that intends to interact with databases in an object oriented manner. They are designed in such way that (after the configuration step) you can manipulate the data regardless of the implementation of the database. It separates three concepts communication with database (and you never take care of this), representation in database and the Python object that you manipulate (and which is built from an entry in the database). I know sqlalchemy, but after few research I found the Zope Object Database. I do not know if this of any help. Is there a page to see yhe advancement/questions/problems of your project ? Best, Vincent -- 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: Ribbon graphs
Hello Bruce, I am now reading Chapter I of Lando and Zvonkin so I have a much better idea of your interests. Cool! But beyond ramified covers of the sphere (as in [LZ]) and Strebel differentials (as in the paper [MP] mentioned by Tom), I used ribbon graph as a topological object : a graph embedded in a surface. In particular they define a simplicial structure from which we may define a complex with a derivation which gives homology groups of the surface (as well as Poincare duality). The latter is the main part of what I have implemented and from which I'm able to compute what is called the spin-parity of a translation surface (see [KZ]) which depends only on some angle data between each half-edge. I allow boundary points which I have not seen; but you did mention partial permutations. I will have a look at your code and see if I can figure out what you have implemented. In a sense I do not allow boundary point, but it depends on what you mean by boundary point. Every permutation I consider are defined on a subset of {0,1,...,n} and I call it partial if the domain (which equals the range) is not {0,1,...,n}. The terminology I used is perhaps misleading... In your definition, a boundary point correspond a half-edge which is not glued to another half-edge, isn't it ? But, you can think of it as a fixed point for the involution defining the edges. My question is does the other two permutations (the vertex permutation and face permutation) are well defined on these boundary points ? In other words, does these half-edges are embedded in the surface ? [LZ] Lando, Zvonkine, Graphs on Surfaces and Their Applications, Springer [MP] Mulase, Penkava, http://arxiv.org/abs/math-ph/9811024 [KZ] Kontsevich,Zorich, http://arxiv.org/abs/math/0201292 Best, Vincent -- 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: Ribbon graphs
As far as I understand, your index.html should be built from the source. But I read the source and I find it not well documented from the point of vue of programmer. I'm really interested in your code as I implement similar stuff and it would be time saving to merge our classes. Moreover, I could help to submit your code to Sage. 1) You wrote : A Ribbon graph is a finite set with an involution and a bijection. You did not precise that the involution is without fixed point ? Is that volunteer ? In the book I mentionned, the author even authorize any permutations. This is useful from the point of vue of Grothendieck's dessin d'enfants as a Ribbon graph also encode a ramified covering of the sphere over three points. 2) The advantage I get from the representation with three permutations (s,a,f) (s for vertices, a for edges and f for faces) is that it is immediate to get the inverse. Moreover, it emphasize a duality (s,a,f) - (f^-1, a^-1, s^-1) which corresponds to the standard duality of embedded graphs. But perhaps, it is out of your interest (but your function anti (which is NOT documented) seems to do that operation). 3) As I mentionned, I only deal with subsets of {0,1,...,n-1} where you seem to be interested in more general subsets. The way permutations are actually implemented with Sage suggest that the base class deal with subsets of {0,1, ..., n-1} and a derived class could use a permutation with domain (which is just a mapping from {0,1, ..., n-1} to a subset of size n). But on the other hand, there are very standard operations which consists to remove edges and it is very natural in that context tu use partial permutation. 4) Your main class halfedge contains two mysterious arguments IsI and decorations. What are they ? 5) If you intend to put your code inside Sage, I find the way classes/functions are implemented is not clear. Why join is a function and not a method (as union for Python set) ? Moreover, in Sage, there is a convention that any class should be denoted in Wiki syntax as MyFavoriteClass and functions should use lower case with underscore as my_favorite_function (There are counterexample inside Sage). In your case, you should be much more precise in the choosen names : Embedding should become for example RibbonGraphEmbedding or similar. I have many more comments, but I would like to have more specifications in each of the methods (and not more example). I want to understand what is implemented (and how) and not what the code can do. Cheers, Vincent -- 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: Ribbon graphs
You can find the file where I implemented RibbonGraphs at the following address http://iml.univ-mrs.fr/~delecroi/ribbon_graph.py (it is not really in sage-combinat by default because of a guard) I had two main goals: * implement a generic structure in order to compute topological invariant of an oriented surface (chain complex associated to the ribbon graph, intersection matrix, ...) * implement a class for surfaces with a flat metric. Each face is a polyhedron embedded in R^2 and the edges that are glued should be parallel with same length and with opposite normal vectors. For now, it is used in sage-combinat at an intermediate step : computation of the spin parity of a translation surface. Vincent -- 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] the queue was broken, so i disabled several patches
Salut Christian, I had to disable all patches inside iet and translation surfaces as they didn't apply. Could you please have a look and solve it. You did well. But everything applies fine at home (with sage-4.7.1). Which version are you running ? I should have put some guards relative to the version. Best, Vincent -- 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] unrooted planar trees
Salut Florent, dear trees developer, Florent, I see your nice patches about trees which I will use in a next future. More precisely, I would like to iterate through unrooted planar trees (planar = cyclic ordering at each node). * do your patches stable enough that I can open a new one just after them ? * does anybody have references for the problem I'm interested in ? Cheers, Vincent -- 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] Sage-Combinat queue rebased for 4.7.1 alpha2
Hi, On Thu, Jun 02, 2011 at 11:24:09PM +0200, Vincent Delecroix wrote: I get problem with the sage-combinat queue on sage-4.7.1.alpha0. Which version should I use to be able to use the queue ? The queue needed some rebase. I just worked on this, and it now applies both on 4.7 and 4.7.1 alpha2. I haven't check on earlier versions. Feedback welcome! Thanks for the rebase. Just for feedback : the patches apply on my sage-4.7.1.alpha2 Best, Vincent -- 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] rejection on 4.7.1.alpha0
Hello, I get problem with the sage-combinat queue on sage-4.7.1.alpha0. Which version should I use to be able to use the queue ? vd@chezmoi$ hg qpush application de trac_10998-categories-posets-nt.patch patching file sage/misc/sageinspect.py Hunk #1 FAILED at 651 1 out of 1 hunks FAILED -- saving rejects to file sage/misc/sageinspect.py.rej Cheers, Vincent -- 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] Rebasing trac_10534-generation_of_subsets_and_set_partitions-vd-rebased.patch on top of trac_11118-finite_enumset_list_cache-fh
Salut Nicolas, 2011/4/26 Nicolas M. Thiery nicolas.thi...@u-psud.fr: Salut Vincent, I just rebased your patch trac_10534-generation_of_subsets_and_set_partitions-vd.patch [...] Rationale: with #10534, TestSuite checks that cardinality returns an Integer. So I had to fix Subsets(...).cardinality() accordingly, which created a little conflict. I let you fix the new cardinality methods in 8. That's nice to have more tests. For the current problem, not all cardinalities (of subsets) are actually Integer... I will push a new version of the patch in few times (and write that it depends on 10534 on trac). I also add some TestSuite to the degenrate guys: Subsets([],0), Subsets([1,2],8), ... to see (and it works). On the other hand, are there any convention for the place to put the TestSuite tests? I remember that test like loads(dums(O)) == O are better suited to be in the __init__ (because hidden to the user). What do you think about TestSuite(O) ? Vincent -- 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] updated series file
Hello, skipping separatrix_diagram-vd.patch - guarded by '-4_7_1' applying translation_surface_homology-vd.patch unable to find 'sage/dynamics/flat_surfaces/separatrix_diagram.py' for patching That's normal because translation_surface_homology-vd.patch depends on separatrix_diagram-vd.patch... It seems that the series file is now correct. Does it ? Vincent -- 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: Big cleanup in partitions and permutations
Hello Florent, There are 20 lines at the begining of the patch improve_constructors_of_iet-vd.patch which modify permutation.py (the __init__ method). See the following thread http://groups.google.com/group/sage-combinat-devel/browse_thread/thread/354f6e841ae5cc58 Cheers, Vincent -- 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] Question(s) about Integer vectors mod permgroup
Hello Nicolas (the little), I'm widely interested in your class for exhaustive generation of vectors modulo permgroup ! Thank you for this nice patch. My need are a bit more general: 1) iteration of couples (vector, stabilizer of the vector) 2) iteration through vectors such that the stabilizer is trivial Remark: there is a trivial way to implement 2) from 1), but there are certainly more efficient procedures. Do you think that 1) and 2) are one minute tasks from what you've done ? one hour ? few days ? Do you have any hint for their implementations ? Cheers, Vincent PS : My interest comes from isomorphism free generation of arithmetic curves in Teichmueller spaces (or origamis if you do not want to be snob ;-). -- 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] Question(s) about Integer vectors mod permgroup
1) iteration of couples (vector, stabilizer of the vector) It depend on what kind of information you want in `stabilizer of the vector`. If you want it to be a sage or gap permutation group, it can be very very painful (especially for speed...). The orbit is `very easy` to get, for more, there is some work to be done. More precisely, before processing, I make the list of subgroups up to conjugation. Then I want to be able to sort the vectors depending on the conjugacy class of the stabilizer (I do not care about the class of the group). 2) iteration through vectors such that the stabilizer is trivial As Florent wanted in the design of SearchForest a post_processing, 2) is relatively simple to do: First apply the patch in the combinat queue.. and test : [...] Ok. This is exactly what I'm looking for ! Thank you. A new question : is this the faster option ? Do we need to compute the orbit explicitely to get the answer to is the stabilizer trivial ? ? The typical input that i will give to the iterator corresponds to vectors of length around 20 and sum around 30... I need fast generation. Thank you again, Vincent -- 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] Rewriting subword.py, subset.py, set_partition_ordered and set_partition.py
Hello ! I'm rewriting subword, subset, set_partition_ordered and set_partition in order to * correct many bugs (as example sage: Subwords([1,2,3], 0).last()) * improve documentation (in many case write the documentation) * have admissibe time (eg not infinite) for iterations through elements by call to itertools.combinations, itertools.chain, etc * improve cardinality computation by calling binomial, multinomial, ... This now trac #10534 which almost needs review In a next future, it is possible for me to make the migration from CombinatorialClass to FiniteEnumeratedSet for all of them. That will be a great improvement, and I am super glad someone it taking up the task! I just hope this is not going to eat up too much of your research time! It seems hard to do the migration... (not straightforward). After many attempts, I decided to report it to another programming session. I get the following problems * there is no multiset object * What is the category of Subwords(w) for a word w which contains repetead letters ? enumerated multiset ? * how a Set S can be an Element of a guy ? (as for Subsets(S)) Cheers, Vincent -- 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] Rewriting subword.py, subset.py, set_partition_ordered and set_partition.py
Hello Florent, hello others, I'm rewriting subword, subset, set_partition_ordered and set_partition in order to * correct many bugs (as example sage: Subwords([1,2,3], 0).last()) * improve documentation (in many case write the documentation) * have admissibe time (eg not infinite) for iterations through elements by call to itertools.combinations, itertools.chain, etc * improve cardinality computation by calling binomial, multinomial, ... In a next future, it is possible for me to make the migration from CombinatorialClass to FiniteEnumeratedSet for all of them. The questions are * does somebody (Florent) starts this yet ? * are there any tricky things by replacing the class CombinatorialClass in the category framework ? There is nothing on the wiki, so I hope that the answer is no ! Cheers, Vincent -- 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] guards for 4_6_1
The four patches below do not apply on 4_6_1, so I decided to temporarily to guard them with a +4_6_1 * trac_10333-lrcalc-mh.patch * coxeter3-mh.patch * coxeter3-iterator.patch * trac_8360_semigroupe-interface-nt.patch It will be push in few minutes Vincent -- 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] queue broken
Sorry, Due to conflict with trac_8898 the combinat queue is currently broken... wait few minutes before pull and push. Vincent -- 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] Re: queue broken
Due to conflict with trac_8898 the combinat queue is currently broken... wait few minutes before pull and push. This conflict is resolved and should work on sage-4.6.1. But application de trac_9065-facade_parents-nt.patch patching file sage/categories/enumerated_sets.py Hunk #1 FAILED at 108 Hunk #2 FAILED at 117 2 out of 2 hunks FAILED -- saving rejects to file sage/categories/enumerated_sets.py.rej patching file sage/categories/sets_cat.py Hunk #2 FAILED at 198 1 out of 5 hunks FAILED -- saving rejects to file sage/categories/sets_cat.py.rej l'application du patch a échoué, impossible de continuer (essayez avec -v) patch failed, rejects left in working dir des erreurs se sont produites durant l'application, veuillez corriger puis rafraîchir trac_9065-facade_parents-nt.patch -- 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.