Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is the code I got. I'm still novice with python stuff...

`def remove_face(SC,FACE):
    """Remove the Simplex FACE from the SimplicialComplex SC, by taking
    the facets of SC not containing FACE, union with
    link(FACE)*boundary(face)."""
    ffboundary=SimplicialComplex(FACE,FACE.faces()) # boundary
    link=SC.link(FACE)#link
    a=ffboundary.join(link,rename_vertices=False)#join
    b=Set([elem for elem in SC.facets() if FACE.is_face(elem)==False])
    c=a.facets().union(b)
    SC2=SimplicialComplex(SC.vertices(),c)
    return SC2`

There is a minor problem now in case that FACE is not a face of SC. Maybe an error can be added, but I think the algorithm is right, and the problem is in the way the link is computed.

The problem is that the link of a simplex not being a face in the complex is not the simplicial complex {()} (the irrelevant complex), but simply {} (the void complex). The link definition doesn't include the empty set in this case, so the answer is tecnically wrong.

If the link is void, the join would be void, and no faces are added or removed... Besides, if the link makes this difference, it can be used as a test for a simplex being a face (since {} is supposed to be false).

I tested the examples to compare results with sage documentation (here FACE must be a Simplex), but with real examples (a bit bigger), I didn't manage to wait for sage... Regards!

This is the code I got. I'm still novice with python stuff...

`def remove_face(SC,FACE):
    """Remove the Simplex FACE from the SimplicialComplex SC, by taking
    the facets of SC not containing FACE, union with
    link(FACE)*boundary(face)."""
    ffboundary=SimplicialComplex(FACE,FACE.faces()) # boundary
    link=SC.link(FACE)#link
    a=ffboundary.join(link,rename_vertices=False)#join
    b=Set([elem for elem in SC.facets() if FACE.is_face(elem)==False])
    c=a.facets().union(b)
    SC2=SimplicialComplex(SC.vertices(),c)
    return SC2`

There is a minor problem now in case that FACE is not a face of SC. Maybe an error can be added, but I think the algorithm is right, and the problem is in the way the link is computed.

The problem is that the link of a simplex not being a face in the complex is not the simplicial complex {()} (the irrelevant complex), but simply {} (the void complex). The link definition doesn't include the empty set in this case, so the answer is tecnically wrong.

If the link is void, the join would be void, and no faces are added or removed... Besides, if the link makes this difference, it can be used as a test for a simplex being a face (since {} is supposed to be false).

I tested the examples to compare results with sage documentation (here FACE must be a Simplex), but with real examples (a bit bigger), I didn't manage to wait for sage... sage, while my algorithm was about a second... Regards!

This is the code I got. I'm still novice with python stuff...

`def def remove_face(SC,FACE):
    """Remove the Simplex FACE from the SimplicialComplex SC, by taking
    the facets of SC not containing FACE, union with
    link(FACE)*boundary(face)."""
    ffboundary=SimplicialComplex(FACE,FACE.faces()) # boundary
    link=SC.link(FACE)#link
    a=ffboundary.join(link,rename_vertices=False)#join
    b=Set([elem for elem in SC.facets() if FACE.is_face(elem)==False])
    c=a.facets().union(b)
    SC2=SimplicialComplex(SC.vertices(),c)
    return SC2`
SC2

There is a minor problem now in case that FACE is not a face of SC. Maybe an error can be added, but I think the algorithm is right, and the problem is in the way the link is computed.

The problem is that the link of a simplex not being a face in the complex is not the simplicial complex {()} (the irrelevant complex), but simply {} (the void complex). The link definition doesn't include the empty set in this case, so the answer is tecnically wrong.

If the link is void, the join would be void, and no faces are added or removed... Besides, if the link makes this difference, it can be used as a test for a simplex being a face (since {} is supposed to be false).

I tested the examples to compare results with sage documentation (here FACE must be a Simplex), but with real examples (a bit bigger), I didn't manage to wait for sage, while my algorithm was about a second... Regards!