ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 12 Sep 2019 13:43:16 -0500bug in basis or family?http://ask.sagemath.org/question/47854/bug-in-basis-or-family/ I am having trouble dealing with modules with infinite bases and I think I pin-pointed the issue to the fact that there are no checks on elements belonging on a family. I am not sure if this is a feature of Sage or a bug so I'll accept any explanation on this. An example will clarify the issue:
<code><pre>
sage: E = cartesian_product([{'L'}, NonNegativeIntegers()])
sage: ('L', 0) in E
True
sage: ('L', -2) in E
False
sage: M = CombinatorialFreeModule(QQ, E)
sage: B = M.basis()
sage: B[('L', -3)]
B[('L', -3)]
sage: B[('L', -3)] in M
True
</code></pre>
So I am not sure I can trust any code I'm writing with `CombinatorialFreeModule` cause I can make those checks, but I will have to go over the source to see if every method that I am calling makes these checks. Somehow if this is a feature I should get a warning or something in the docs isn't it?heluaniThu, 12 Sep 2019 13:43:16 -0500http://ask.sagemath.org/question/47854/Ascending tuples of integershttp://ask.sagemath.org/question/10822/ascending-tuples-of-integers/Hi everyone,
I'm trying to define the set of all tuples of ascending integers (any length, repetitions allowed). What is the best way to do this? Do I use Family()? I'd like to use this set enumerate the basis of a combinatorial free algebra.
Bonus question: Is it possible to add an extra label to each integer in the tuple?GonnemanTue, 10 Dec 2013 21:27:21 -0600http://ask.sagemath.org/question/10822/Constructor for InfiniteEnumeratedSet?http://ask.sagemath.org/question/8778/constructor-for-infiniteenumeratedset/Imagine I want to rewrite from scratch the "Permutations()" and "Permutations(n)" (for n integer) enumeratedsets and the coercion of the latter into the former. How do I do this?
(This is not the first time I am asking for the constructor of a class. The last time I was looking for [the constructor of a graded algebra](http://ask.sagemath.org/question/1103), and the answer was in some example code. I can't believe there is no documentation for these things!)
*PS.* I am not really rewriting permutations; I just want to know the constructor so that I can create enumeratedsets similar to permutations (currently, ordered rooted forests a la Loic Foissy).
**EDIT:** Maybe I should be more concrete. Say I want to encode permutations as n-tuples of integers from {1,2,...,n} for which a certain function returns true. I know how to get the n-tuples of integers from {1,2,...,n}, but I don't even know how to "filter" out the ones for which my function returns false, let alone make them into an EnumeratedSet.
**EDIT #2:** Thanks to John Palmieri, this question is partially solved: I was able to code the CombinatorialClass of ordered rooted forests on n vertices: [HTML file](http://mit.edu/~darij/www/Ordforst1.htm) / [SWS file](http://mit.edu/~darij/www/Ordforst1.sws). However, I still don't see how to get the CombinatorialClass (or EnumeratedSet or whatever; I don't understand the difference) of **all** ordered rooted forests, just as there is a class Permutation() of **all** permutations. This should be as easy as taking a disjoint union, but if I just take DisjointUnionEnumeratedSets(OForestsFamily), then the resulting enumerated set does not know how to test membership (unsurprisingly).darijgrinbergThu, 08 Mar 2012 15:43:19 -0600http://ask.sagemath.org/question/8778/