ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 11 Apr 2019 08:50:27 +0200Constructing all NE-lattice paths from $(0,0)$ to $(m,n)$https://ask.sagemath.org/question/46087/constructing-all-ne-lattice-paths-from-00-to-mn/If I consider only [Dyck Paths](http://mathworld.wolfram.com/DyckPath.html), I can do write something like this:
DWS=DyckWords(3).list()
for D in DWS:
print(D.height())
to obtain the height of all Dyck paths of length $3$. However, I would like to do the same thing but using [$NE$-lattice paths](https://en.wikipedia.org/wiki/Lattice_path#North-East_lattice_paths) from $(0,0)$ to $(m,n)$. Is there an easy way to do this in Sage?joakim_uhlinThu, 11 Apr 2019 08:50:27 +0200https://ask.sagemath.org/question/46087/DyckWords: workaround for from_ordered_tree?https://ask.sagemath.org/question/34763/dyckwords-workaround-for-from_ordered_tree/** MuPAD-Combinat knows (according to the docs)
for Dyck words the canonical bijection from
ordered trees with n+1 nodes to Dyck words of size n such that if a tree
t has t_1,...,t_k as childs then f(t) = [1,f(t_1),0,...,1,f(t_k),0].
* fromOrderedTree
– canonical bijection from ordered trees to Dyck words
combinat::dyckWords::fromOrderedTree(ordered tree t)
Returns the Dyck word corresponding to the ordered tree t.
* toOrderedTree
– canonical bijection from Dyck words to ordered trees
combinat::dyckWords::toOrderedTree(Dyck word w)
Returns the ordered tree corresponding to the Dyck word w.
** SageMath-Combinat knows
* to_ordered_tree()
* from_ordered_tree() NotImplementedError: TODO
What a pitty! My question is: What is a quick workaround for this missing function?
EDIT:
Since it is so easy as tmontail in his answer shows then I do not
understand why it is not implemented. At least a hint in the docs
seems appropriate.Peter LuschnyWed, 07 Sep 2016 12:18:22 +0200https://ask.sagemath.org/question/34763/