Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to plot O(P) of a Poset P in sage?

Hello,

I just installed sage. I want to use it to do some things with Posets for my Modern ALgebra Class. For example, I want to use it to compute and plot the O(P) of a poset P. (The Poset of the order ideals of P).

1- Where I can find examples of how to construct Posets? I know that in the references they are some examples, but is there some type of tutorial with Posets or pdf with examples?

2- How I can plot O(P)? I know that there is a method called P.directed_subsets('down') to compute the down sets of P. The problem is that this method returns a List... So I can't plot a hasse diagram of it... For example:

 P = Poset((divisors(12), attrcall("divides")), facade=True)
 A = P.directed_subsets('up')
 sorted(list(A))
 [[], [1, 2, 4, 3, 6, 12], [2, 4, 3, 6, 12], [2, 4, 6, 12], [3, 6, 12], [4, 3, 6, 12], [4, 6, 12], [4, 12], [6, 12], [12]]

3- I dont understand the order_ideals method. What are the parameters of this function??

Thanks!!

Note: As you see, I am very new here, some insight of how to work with sage is appreciated!

click to hide/show revision 2
retagged

How to plot O(P) of a Poset P in sage?

Hello,

I just installed sage. I want to use it to do some things with Posets for my Modern ALgebra Class. For example, I want to use it to compute and plot the O(P) of a poset P. (The Poset of the order ideals of P).

1- Where I can find examples of how to construct Posets? I know that in the references they are some examples, but is there some type of tutorial with Posets or pdf with examples?

2- How I can plot O(P)? I know that there is a method called P.directed_subsets('down') to compute the down sets of P. The problem is that this method returns a List... So I can't plot a hasse diagram of it... For example:

 P = Poset((divisors(12), attrcall("divides")), facade=True)
 A = P.directed_subsets('up')
 sorted(list(A))
 [[], [1, 2, 4, 3, 6, 12], [2, 4, 3, 6, 12], [2, 4, 6, 12], [3, 6, 12], [4, 3, 6, 12], [4, 6, 12], [4, 12], [6, 12], [12]]

3- I dont understand the order_ideals method. What are the parameters of this function??

Thanks!!

Note: As you see, I am very new here, some insight of how to work with sage is appreciated!