> bruhat_p_order = lambda p,q : p.bruhat_lequal(q)
> my_poset = Poset([perms, bruhat_p_order])
>
> It seems that when I create the poset, the elements are no longer
> permutations but "PosetElement"s, and I can't figure out how to
> "recover" the elements as permutations. I can't even coerce them back
> to permutations by writing Permutation(my_poset[i]).  Specifically, I
> am creating the poset in order to find all possible total orders of
> the poset.  Once I have the total orders, I'd like to be able to call
> on the elements again as permutations.
>
> Any help is much appreciated!

The following seems to work:

sage: perms = Permutations(5)
sage: bruhat_p_order = lambda p,q : p.bruhat_lequal(q)
sage: my_poset = Poset([perms, bruhat_p_order])
sage: sage: x = my_poset[5]; x
[1, 2, 4, 5, 3]
sage: type(x)
<class 'sage.combinat.posets.elements.PosetElement'>
sage: x.element
[1, 2, 4, 5, 3]
sage: type(x.element)
<class 'sage.combinat.permutation.Permutation_class'>

Here element is an attribute which contains the original element, a
permutation.
You can get this information with:

sage: sage.combinat.posets.elements.PosetElement?

Dan

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to