Some fast computations for finite posets using FLINT matrices - Combinatorics

Skip to content
Back to top
View this page
Edit this page

# Some fast computations for finite posets using FLINT matrices

sage.combinat.posets.hasse_cython_flint.chain_poly(positions)

  Return the chain polynomial of a poset.

  INPUT:

  - `positions` – a list of sets of integers describing the poset, as given by the lazy attribute `_leq_storage` of Hasse diagrams

  OUTPUT: a Flint polynomial in one variable over \(\ZZ\).

  EXAMPLES:

  Sage

      sage: from sage.combinat.posets.hasse_cython_flint import chain_poly
      sage: D = [{0, 1}, {1}]
      sage: chain_poly(D)
      3  1 2 1
      sage: P = posets.TamariLattice(5)
      sage: H = P._hasse_diagram
      sage: D = H._leq_storage
      sage: chain_poly(D)
      12  1 42 357 1385 3133 4635 4758 3468 1778 612 127 12

  Python

      >>> from sage.all import *
      >>> from sage.combinat.posets.hasse_cython_flint import chain_poly
      >>> D = [{Integer(0), Integer(1)}, {Integer(1)}]
      >>> chain_poly(D)
      3  1 2 1
      >>> P = posets.TamariLattice(Integer(5))
      >>> H = P._hasse_diagram
      >>> D = H._leq_storage
      >>> chain_poly(D)
      12  1 42 357 1385 3133 4635 4758 3468 1778 612 127 12

sage.combinat.posets.hasse_cython_flint.coxeter_matrix_fast(positions)

  Compute the Coxeter matrix of a poset by a specific algorithm.

  INPUT:

  - `positions` – a list of sets of integers describing the poset, as given by the lazy attribute `_leq_storage` of Hasse diagrams

  OUTPUT: a dense matrix

  EXAMPLES:

  Sage

      sage: from sage.combinat.posets.hasse_cython_flint import coxeter_matrix_fast
      sage: D = [{0,1},{1}]
      sage: coxeter_matrix_fast(D)
      [ 0 -1]
      [ 1 -1]
      sage: P = posets.TamariLattice(5)
      sage: H = P._hasse_diagram
      sage: D = H._leq_storage
      sage: coxeter_matrix_fast(D)
      42 x 42 dense matrix over Integer Ring (...)

  Python

      >>> from sage.all import *
      >>> from sage.combinat.posets.hasse_cython_flint import coxeter_matrix_fast
      >>> D = [{Integer(0),Integer(1)},{Integer(1)}]
      >>> coxeter_matrix_fast(D)
      [ 0 -1]
      [ 1 -1]
      >>> P = posets.TamariLattice(Integer(5))
      >>> H = P._hasse_diagram
      >>> D = H._leq_storage
      >>> coxeter_matrix_fast(D)
      42 x 42 dense matrix over Integer Ring (...)

sage.combinat.posets.hasse_cython_flint.moebius_matrix_fast(positions)

  Compute the Möbius matrix of a poset by a specific triangular inversion.

  INPUT:

  - `positions` – a list of sets of integers describing the poset, as given by the lazy attribute `_leq_storage` of Hasse diagrams

  OUTPUT: a dense matrix

  EXAMPLES:

  Sage

      sage: from sage.combinat.posets.hasse_cython_flint import moebius_matrix_fast
      sage: D = [{0,1},{1}]
      sage: moebius_matrix_fast(D)
      [ 1 -1]
      [ 0  1]
      sage: P = posets.TamariLattice(5)
      sage: H = P._hasse_diagram
      sage: D = H._leq_storage
      sage: moebius_matrix_fast(D)
      42 x 42 dense matrix over Integer Ring (...)

  Python

      >>> from sage.all import *
      >>> from sage.combinat.posets.hasse_cython_flint import moebius_matrix_fast
      >>> D = [{Integer(0),Integer(1)},{Integer(1)}]
      >>> moebius_matrix_fast(D)
      [ 1 -1]
      [ 0  1]
      >>> P = posets.TamariLattice(Integer(5))
      >>> H = P._hasse_diagram
      >>> D = H._leq_storage
      >>> moebius_matrix_fast(D)
      42 x 42 dense matrix over Integer Ring (...)