sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.21k stars 421 forks source link

class for rook boards (Young shapes, diagram of a permutation) #14127

Open 9eb6871c-2ac8-4b0d-b341-7dabbbb8a726 opened 11 years ago

9eb6871c-2ac8-4b0d-b341-7dabbbb8a726 commented 11 years ago

Add a class for a Board (subset of entries in [0,1,..,r-1] x [0,1,...,s-1] ). Examples are

And procedures to generate:

References

Component: combinatorics

Keywords: days45, rook placement, Rothe diagram, Young diagram, Le diagram

Author: ahmorales

Reviewer: chrisjamesberg

Issue created by migration from https://trac.sagemath.org/ticket/14127

jhpalmieri commented 11 years ago
comment:1

You should make sure to provide an interface to simplicial_complexes.ChessboardComplex(r,s): your Board class could have a simplicial_complex method (or something similar) which returns the complex. Actually, you could do this:

    def _simplicial_(self):
        """
        Return simplicial complex version of ...
        """
        from sage.homology.examples import simplicial_complexes
        return simplicial_complexes.ChessboardComplex(self.r, self.s)  # or whatever

    simplicial_complex = _simplicial_

The point behind having a _simplicial_ method is that if B is an instance of the Board class, you can then call SimplicialComplex(B) and it will call this method.

You also might be able to improve the implementation of the ChessboardComplex or the matching function in the same file, and that would be greatly appreciated.

Edit: I guess the _simplicial_ method would be more appropriate on the class of all Boards, not for a single board. Anyway...