Processing math: 100%
Ask Your Question
1

Dual Cells and Face Poset

asked 12 years ago

DG44 gravatar image

updated 12 years ago

Hello.

I would like to create a procedure in Sage to find the dual cell of a simplex σ in a simplicial complex K. The dual cell D(σ,K) of σ is a subcomplex of the first barycentric subdivision of K. The vertex set is given by the barycentres of all cofaces of σ, and the simplices are joins of barycentres of the form ^σ0^σ1...^σs with σσ0...σs.

My plan of attack is to view K as a poset, then find the maximal increasing chains [σ0,...,σs] in K which satisfy σ0=σ . These chains would then be the maximal faces of the dual cell D(σ,K).

Creating the poset and finding the maximal chains of simplices is fine. However, if I have a maximal chain [σ0,...,σs] a problem occurs when checking if σ0=σ - Sage sees σ0 as just an element of the poset and not as simplex and σ as a simplex but not an element of the poset so the equality is never satisfied.

How can I correct this?

Thanks, Chris .

Preview: (hide)

Comments

What if you define the poset using 'facade=True'?

John Palmieri gravatar imageJohn Palmieri ( 12 years ago )

5 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

Okay, try this: change the last line of find_dual_cell to

return SimplicialComplex(dual_cell_facets)

It's always an option to create a simplicial complex without specifying the vertex set – it is then deduced from the list of facets – and in fact this will become the preferred way of doing things some time soon (after the patches here are merged). Anyway, with your original code, I get an error with Sage 5.4 (but not with a prerelease of Sage 5.5, which includes the relevant patches). By modifying that one line, it seems to work in Sage 5.4 as well.

  • I guess then you can delete the function find_cofaces and the one call to it in find_dual_cell.
  • I don't have the time to figure out why your original code fails, but at least I think we have a fix.
  • Would it help to be able to do sage: K.face_poset(options...) with options including facade=True? That would be an easy thing to add to Sage.
Preview: (hide)
link
0

answered 12 years ago

DG44 gravatar image

updated 12 years ago

This is completely the correct answer! How frustrating for me! When I try to run the example (on my Macbook Pro with Sage 5.4.1 and OS X 10.8.2)

sage: X = simplicial_complexes.Simplex(2)

sage: find_dual_cell(X, Simplex(X.vertices()[0]))

I get the error

sage: Traceback (click to the left of this block for traceback)...

sage: ValueError: The face ((0,), (0, 2), (0, 1, 2)) is not a subset of the vertex set.

I have created a worksheet at http://www.sagenb.org/home/pub/5038 that contains all of the above code (edit: public worksheets are currently disabled) . It still produces the same error!

Preview: (hide)
link
0

answered 12 years ago

If I use your code with K being a 2-simplex, it seems to work (unless I misunderstand what the dual cell is):

sage: X = simplicial_complexes.Simplex(2)
sage: find_dual_cell(X, Simplex(X.vertices()[0]))
Simplicial complex with 4 vertices and 2 facets
sage: Y = find_dual_cell(X, Simplex(X.vertices()[0]))
sage: Y.facets()
{((0,), (0, 1, 2), (0, 2)), ((0,), (0, 1), (0, 1, 2))}

or

sage: Y = find_dual_cell(X, Simplex([0]))
sage: Y.facets()
{((0,), (0, 1, 2), (0, 2)), ((0,), (0, 1), (0, 1, 2))}

It also seems to work if K is S1 or S2. If I try it with a 3-sphere, I get this:

sage: X = simplicial_complexes.Sphere(3)
sage: Y = find_dual_cell(X, Simplex(X.vertices()[0]))
sage: Y
Simplicial complex with 15 vertices and 24 facets

Is this wrong? What sort of answer are you expecting?

Preview: (hide)
link
0

answered 12 years ago

DG44 gravatar image

updated 12 years ago

Thank you! Problem solved :). I think it would be helpful to do

sage: K.face_poset(options...)

with options including facade=True in Sage.

Preview: (hide)
link
0

answered 12 years ago

DG44 gravatar image

updated 12 years ago

Thank you for your suggestion.

I only actually want to find the dual cells of vertices. I added the code "facade = True" to the existing algorithm which finds the face poset of a simplicial complex K (a warning for below- I have not done much programming before)

def find_face_poset(K):

from sage.combinat.posets.posets import Poset
from sage.misc.flatten import flatten
covers = {}

all_cells = flatten([list(f) for f in K.cells().values()])
for C in all_cells:
    if C.dimension() >= 0:
        covers[tuple(C)] = []
for C in all_cells:
    for face in C.faces():
        if face.dimension() >= 0:
            covers[tuple(face)].append(tuple(C))

return Poset(covers, facade = True)

I also created an algorithm to find the cofaces of a simplex σK:

def find_cofaces(K, sigma):

m = sigma.dimension()
cofaces = []
cofaces.append(sigma)
for i in range(m+1, K.dimension()+1):
    i_faces = K.n_faces(i)
    for tau in i_faces:
        if sigma.is_face(tau):
            if tau.dimension() == i :
                cofaces.append(tau)
            else:
                pass
        else:
            pass
return cofaces

and also an algorithm to find the dual cell of a vertex σ:

def find_dual_cell(K, sigma):

face_poset = find_face_poset(K)
maximal_chains = face_poset.maximal_chains()
dual_cell_vertices = find_cofaces(K, sigma)
dual_cell_facets = []
for tau in maximal_chains:
    if sigma.tuple() == tau[0]:
        dual_cell_facets.append(tau)
    else:
        pass
return SimplicialComplex(dual_cell_vertices, dual_cell_facets)

I played around with the example

K = simplicial_complexes.Sphere(3)

for sigma in K.n_faces(0): find_dual_cell(K, sigma)

When I get Sage to print dual_cell_vertices and dual_cell_facets (instead of returning SimplicialComplex(dual_cell_vertices, dual_cell_facets)), it seems to produce a correct result. But it never produces the correct simplicial complex! It gives me

Simplicial complex with vertex set (0, 1, 2, 3, 4) and 4 facets

Any help would be very much appreciated!

Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 777 times

Last updated: Nov 30 '12