>> * Is it currently possible to construct a poset from a linear extension 
>> (basically by relabeling
>>   the nodes of the parent poset)? It might be nice to accept a linear 
>> extension as an input
>>   to the poset method as
>>
>>   Poset(linear_extension)
> 
> Just to make sure: what you want is, given a poset, to build a copy of
> it where the enumeration order is given by some other linear extension
> of it?
> 
> If yes, then maybe something like:
> 
>    P = Poset(...)
>    Q = P.enumerated_by(<some linear_extension of P>)

Yes, in my last e-mail, I already sent the code for this (what I called 
from_linear_extension
you call enumerated_by):

  P.from_linear_extension(lin_ext)

  def from_linear_extension(self, lin_ext):
      Hasse = self.hasse_diagram()
      p = Permutation([i.element for i in lin_ext]).inverse()
      Hasse.relabel(lambda i : p[i.element-1])
      return Poset((Hasse.vertices(),Hasse.edges(labels=False)), 
cover_relations = True)

>> * I have an implementation of tau_i and various generalizations of
>>   promotion operators on a poset. The easiest and fastest to
>>   implement these, is to do so on linear extensions and then pull
>>   them back to posets. Where should these methods go since there is
>>   no class for linear extensions?
> 
> Do you need a single linear extension of P, or a bunch of them?

Well, at the end it will give a graph on the set of all linear extensions.
Promotion (or the generalized promotions as well) for example, take as input a 
poset P
and out comes another poset (with its vertices relabeled). It is most
convenient to program this directly on the linear extension of P. But
in Sage there is no class for linear extensions and as far as I can see
no method that converts between linear extensions and actual posets.

The code above would make the conversion. Should this go in the init
file for posets, or be a method for posets as above?

My question is where shall I put the code that acts on the linear extensions?

> In the first case, is it a specific one, or not? Note that the current
> implementation of Posets guarantees that list(P) gives a linear
> extension of P.

I need methods that act on *any* linear extension of a poset P.
The final graph will be a graph on all linear extensions of P.

> In the second case: basically a linear extension is a list of the
> elements of P, in some order, right? What are the operations on it
> that you need for implementing your algorithms?

I already implemented my algorithms. I just do not know where to put them
in /combinat/posets.py since there is no class for linear extensions.
For their analogs on posets it is clear, but it is useful to have the helper
methods on linear extensions directly.

Best,

Anne

-- 
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.

Reply via email to