Since no one has answered this, you might want to email John Palmieri
(palmaieri at math dot washington dot edu) directly, since he is the
author of the simplicial complex module in sage.

-Marshall Hampton

On Aug 10, 10:41 pm, Rafael Villarroel <[email protected]> wrote:
> Hello all,
>
> Under friendly advice by Fidel Barrera, I have been trying to use Sage
> for my research since about two monts ago. I work with graphs and posets
> and simplicial complexes coming from them, and I had used GAP + GRAPE +
> SimplicialHomology for that. With Sage, I like mostly the fact that one
> can get pretty drawings of posets and graps "out of the box", and that
> there seems to be active work on simplicial complexes.
>
> Since before using Sage I knew no Python, I have been put off by all the
> different types of objects when using simplicial complexes in Sage. I
> have defined the following functions that seem to work, and I would
> appreciate any comments you may have that would help me improve when
> working with Sage.
>
> Best regards,
> Rafael
>
> # a free face is one that is contained properly in exactly one maximal face
> def is_free_face (S,s):
>     def f(x): return set(s)<=set(x)
>     return not (Simplex(s) in S.facets()) and len(filter(f,S.facets()))==1
>
> # we find (if it exists) a free face of the smallest dimension, and remove it
> def free_face_removed ( S ):
>     i = -1
>     S1 = deepcopy( S )
>     found = false
>     dim = S1.dimension()
>     faces = S1.faces()
>     while i < dim and not found:
>         j = 0
>         ifaces = list(faces[i])
>         while j < len(ifaces) and not found:
>             if is_free_face( S1 , ifaces[j] ):
>                 found = True
>                 print "removing ",ifaces[j]
>                 S1.remove_face( ifaces[j] )
>             else:
>                 j = j+1
>         i = i+1
>     return S1
>
> # remove all free faces
> def collapsed_complex ( S ):
>     S1 = S
>     S2 = free_face_removed( S )
>     while S1 <> S2:
>         S1 = S2
>         S2 = free_face_removed( S1 )
>     return S2
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to