There is an example in the official Reference Manual about
SimplicialComplex and Betti Numbers and Euler Characteristic.
S = SimplicialComplex(3, [[0,1], [1,2], [0,2]]) # circle
T = S.product(S) # torus
T
Simplicial complex with 16 vertices and 18 facets
and
T.euler_characteristic()
0
which is correct.
My problem is with the computation of Betti numbers :
T.betti()
{0: 0, 1: 2, 2: 1}
coherent with
T.homology()
{0: 0, 1: Z x Z, 2: Z}
For the torus (correct me if I am wrong), the 0-th Betti number should be 1.
This would agree with the formula given for the Euler Characteristic
in that case : X = B_0 - B_1 + B_2 = 0
Maybe I misunderstood something here...
Thanks for your kind answer...
Best regards
Philippe Saadé
NB : according to the source code of SimplicialComplex, the first
definition should be : S = SimplicialComplex(2, [[0,1], [1,2], [0,2]])
# circle
>> NB : according to the source code of SimplicialComplex, the first
>> definition should be : S = SimplicialComplex(2, [[0,1], [1,2], [0,2]])
>
> Any vertices which don't appear explicitly in simplices are ignored,
> so this is the same as
>
> SimplicialComplex(307, [[0,1], [1,2], [0,2]]) or SimplicialComplex
> (98, [[0,1], [1,2], [0,2]])
>
> or all other similar commands. As it says in the reference manual,
>
> The elements of the vertex set are not automatically contained in
> the simplicial complex: each one is only included if and only if it
> is a vertex of at least one of the specified facets.
>
> John
>
> -
I read that one too. My remark, again, was motivated by the point of
view of a newbie. My idea is that the examples in the docs should be
kept as simple as they can be.
If one reads "3", then one understands that it corresponds to the
"human" number of vertices (i.e. start counting at 1 and not 0).
In fact, here, "3" stands for "Lets take 4 vertices, but use only
3"... Misleading I think.
Lastly,
Sa = SimplicialComplex(3, [[0,1], [1,2], [0,2]]) # circle
Sa
Simplicial complex with vertex set (0, 1, 2, 3) and facets {(1, 2), (0,
2), (0, 1)}
so vertex 3 is still present in the list (from the point of view of __repr__)
But the most important thing I have to say : thanks for the
implementation : great work and it is nice to use it.
My remarks are minor ones...
Phil
>
> You can find suggested fixes here: <http://trac.sagemath.org/sage_trac/
> ticket/7323>
>
> John
>
Hi John.
Thanks for the patch !
I have an account on trac so i could review it but it would make a
cyclic reference...
By the way, since reduced homology is only supposed to change H_0, and
that if ususal homology group H_0 is of rank r, then the reduced
homology one is of rank r-1, wouldn't it be better to add 1 to the
"reduced Betti number B_0" you compute, so that T.betti() would just
really give all the real Betti numbers ?
Sorry to bother you with my questions...
Phil