Processing math: 12%

First time here? Check out the FAQ!

Ask Your Question
1

Obtaining a simplicial complex associated to a poset with the help of Sage

asked 4 years ago

klaaa gravatar image

updated 4 years ago

I want to associate to a finite poset a simplicial complex Δ(P) and study the homology(with coefficients in the rational numbers or a finite field) and the topological type of this simplicial complex using Sage. I have not yet used sage for this and wanted to ask whether there is an easy method to do this.

Let P be a a finite poset with at least two elements and for pP define two subsets as follows:

J(p):= { gP|p } and I(p):= { g \in P | g \leq p }.

For a subset S of P (we view P also as set of its vertices) we then define

J(S):= \bigcap\limits_{p \in S}^{}{J(p)} and I(S):= \bigcup\limits_{p \in S}^{}{I(p)}.

We set J( \emptyset)=P, J(P)=\emptyset and I(\emptyset)=\emptyset, I(P)=P.

Then the simplicial complex \Delta(P) is defined as the set of all subsets S \subseteq P with J(S^c) \subseteq I(S^c), where fore a subset S \subseteq P we denote by S^c the complement of S in P.

For example when the poset P is a chain with n-elements then \Delta(P) should have topological type of the (n-2)-sphere.

I can obtain the sets J(p) and I(p) for elements but not for subsets in Sage, but I would think there is an easy trick.

Here is an example in Sage for a given poset P :

P=posets.BooleanLattice(2)

display(P)

p=P[2]

I=[u for u in P if P.is_lequal(u,p)]

J=[u for u in P if not P.is_lequal(p,u)]

display(I)

display(J)

Thanks for any help.

Preview: (hide)

Comments

Please add the code you have so far, with an example P.

rburing gravatar imagerburing ( 4 years ago )

I added a small example for the Boolean lattice on how to obtain J(p) and I(p).

klaaa gravatar imageklaaa ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

FrédéricC gravatar image

updated 4 years ago

something like this maybe (not tested)

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    JSc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_ISc(g) for g in JSc)
Preview: (hide)
link

Comments

Thank you very much, but it seems to not work for every subset. For example here it works:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) for g in Jsc)

P=posets.BooleanLattice(2)
U = Subsets(P)
T=U[2]
display(T)
test_subset(P, T)

but for the same poset P with another subset it does not work and gives an error (see next comment)

klaaa gravatar imageklaaa ( 4 years ago )

Here it gives an error:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) for g in Jsc)

P=posets.BooleanLattice(2)
U = Subsets(P)
T=U[1]
display(T)
test_subset(P, T)
klaaa gravatar imageklaaa ( 4 years ago )

There was a typo "Isc" versus ISc.

FrédéricC gravatar imageFrédéricC ( 4 years ago )

Thank you very much again. It seems to work now. I combined it and obtained the simplicial complex as follows:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    JSc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_ISc(g) for g in JSc)

P=posets.ChainPoset(4)
P=P.relabel()
U = Subsets(P)
G=[t for t in U if test_subset(P, t)==true]
GG=[list(r) for r in G]
display(GG)
S=SimplicialComplex(GG)
display(S)
phi, M = S.algebraic_topological_model(QQ)
M.homology()
klaaa gravatar imageklaaa ( 4 years ago )

Do you know whether I calcuate the homology the right way over the rational numbers QQ? It seems I have to use the strange command

phi, M = S.algebraic_topological_model(QQ)

and I do not quite know why I need to write the phi before the M.

Also do you know whether there is a command to check whether the simplicial complex is topologically homeomorphic to a sphere?

klaaa gravatar imageklaaa ( 4 years 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: 4 years ago

Seen: 355 times

Last updated: Oct 07 '20