Macaulay2 » Documentation
Packages » AbstractSimplicialComplexes :: randomAbstractSimplicialComplex
next | previous | forward | backward | up | index | toc

randomAbstractSimplicialComplex -- create a random abstract simplicial complex

Description

Create a random abstract simplicial complex with vertices supported on a subset of $[n] = \{1,\dots ,n\}$.

i1 : K = randomAbstractSimplicialComplex(4)

o1 = AbstractSimplicialComplex{-1 => {{}}                                           }
                               0 => {{1}, {2}, {3}, {4}}
                               1 => {{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}}
                               2 => {{1, 2, 3}, {1, 2, 4}}

o1 : AbstractSimplicialComplex

Create a random simplicial complex on $[n]$ with dimension at most equal to r.

i2 : L = randomAbstractSimplicialComplex(6,3)

o2 = AbstractSimplicialComplex{-1 => {{}}                                                                                                                    }
                               0 => {{1}, {2}, {3}, {4}, {5}, {6}}
                               1 => {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {3, 4}, {3, 5}, {3, 6}, {4, 5}, {4, 6}, {5, 6}}
                               2 => {{1, 2, 3}, {1, 2, 5}, {1, 2, 6}, {1, 3, 4}, {1, 4, 6}, {2, 3, 6}, {2, 4, 6}, {2, 5, 6}, {3, 4, 5}, {3, 5, 6}, {4, 5, 6}}

o2 : AbstractSimplicialComplex

Create the random complex $Y_d(n,m)$ which has vertex set $[n]$ and complete $(d − 1)$-skeleton, and has $m$ $d$-dimensional faces, chosen at random from all $\binom{\binom{n}{d+1}}{m}$ possibilities. Such random simplicial complexes appear in lots of different contexts including in the article Cohen-Lenstra heuristics for torsion in homology of random complexes by M. Kahle, F. H. Lutz, A. Newman, and K. Parsons [Exp. Math. vol. 29, no. 3 (2020)]. By default, there is a chance that the output may have fewer than $m$ faces. To avoid this, set the Verify option to true.

i3 : N = randomAbstractSimplicialComplex(6,3,2)

o3 = AbstractSimplicialComplex{-1 => {{}}                                                                                                                   }
                               0 => {{1}, {2}, {3}, {4}, {5}, {6}}
                               1 => {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {3, 4}, {3, 5}, {3, 6}, {4, 5}, {4, 6}, {5, 6}}
                               2 => {{2, 3, 4}, {3, 5, 6}, {4, 5, 6}}

o3 : AbstractSimplicialComplex
i4 : tally apply(1000, i ->  #(randomAbstractSimplicialComplex(5,3,2))_2)

o4 = Tally{1 => 13 }
           2 => 282
           3 => 705

o4 : Tally
i5 : tally apply(1000, i -> #(randomAbstractSimplicialComplex(5,3,2,Verify=>true))_2)

o5 = Tally{3 => 1000}

o5 : Tally

See also

Ways to use randomAbstractSimplicialComplex:

  • randomAbstractSimplicialComplex(ZZ)
  • randomAbstractSimplicialComplex(ZZ,ZZ)
  • randomAbstractSimplicialComplex(ZZ,ZZ,ZZ)

The source of this document is in AbstractSimplicialComplexes.m2:687:0.