First time here? Check out the FAQ!

Ask Your Question
0

Obtaining a poset from a matrix

asked 1 year ago

klaaa gravatar image

I have an upper triangular matrix M with entries only 0 or 1 where all diagonal entries are 1. I want to use Sage to test whether M is the lequal_matrix of a finite poset and to obtain that poset via Sage if this is the case. Is there an easy way to do this? I did not find anything i the poset manual that seems to work. Thanks for any help!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 1 year ago

FrédéricC gravatar image

Like this

sage: m = matrix(ZZ,2,2,[1,1,0,1])
sage: Poset(DiGraph(m-1, loops=False))
Finite poset containing 2 elements
Preview: (hide)
link

Comments

Perhaps this needs to be enclosed into try: ... except: ... to handle cases when matrix does not define a poset.

Max Alekseyev gravatar imageMax Alekseyev ( 1 year ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 180 times

Last updated: Apr 30 '23