ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 28 Nov 2012 01:49:45 -0600Dual Cells and Face Posethttps://ask.sagemath.org/question/9578/dual-cells-and-face-poset/Hello.
I would like to create a procedure in Sage to find the dual cell of a simplex $\sigma$ in a simplicial complex $K$. The dual cell $D(\sigma, K)$ of $\sigma$ is a subcomplex of the first barycentric subdivision of $K$. The vertex set is given by the barycentres of all cofaces of $\sigma$, and the simplices are joins of barycentres of the form $\widehat{\sigma_0} \widehat{\sigma_1} ... \widehat{\sigma_s}$ with $\sigma \leq \sigma_0 \leq ... \leq \sigma_s$.
My plan of attack is to view K as a poset, then find the maximal increasing chains $[\sigma_0,..., \sigma_s]$ in K which satisfy $\sigma_0 = \sigma$ . These chains would then be the maximal faces of the dual cell $D(\sigma, K)$.
Creating the poset and finding the maximal chains of simplices is fine. However, if I have a maximal chain $[\sigma_0,..., \sigma_s]$ a problem occurs when checking if $\sigma_0 = \sigma$ - Sage sees $\sigma_0$ as just an element of the poset and not as simplex and $\sigma$ as a simplex but not an element of the poset so the equality is never satisfied.
How can I correct this?
Thanks,
Chris .DG44Wed, 28 Nov 2012 01:49:45 -0600https://ask.sagemath.org/question/9578/Compute the centroid of a polytopehttps://ask.sagemath.org/question/8092/compute-the-centroid-of-a-polytope/Does SAGE have a way to compute the center of mass of a polytope? I tried using polymake's centroid method, but that returned an error because the dimension of my polytope is not equal to the ambient dimension. I've read the manual and looked at the available functions but can't seem to find a SAGE command to do this. Does it exist?
EDIT: By request here's some sample _polymake_ code that fails (I'm not sure why this would be useful unless SAGE is using polymake under the hood):
polytope > $q=permutahedron(3);
polytope > print $q->CENTROID;
polymake: WARNING: could not compute 'CENTROID' probably because of unsatisfied preconditions:
precondition : DIM, AMBIENT_DIM ( CENTROID, VOLUME : VERTICES, TRIANGULATION.FACETS )
I'm guessing the error occurs because the ambient dimension of this polytope is 4 but the actual dimension of the polytope is 3; this is the same reason polymake tells me the volume of q is 0.adkWed, 27 Apr 2011 08:50:26 -0500https://ask.sagemath.org/question/8092/