Opened 8 years ago

Closed 8 years ago

#17121 closed enhancement (fixed)

LatticePoset: Add meet_irreducibles, faster is_distributive

Reported by: jmantysalo Owned by:
Priority: major Milestone: sage-6.4
Component: combinatorics Keywords:
Cc: ncohen Merged in:
Authors: Jori Mäntysalo Reviewers: Nathann Cohen
Report Upstream: N/A Work issues:
Branch: 8b68cdb (Commits, GitHub, GitLab) Commit: 8b68cdb1290ca3fa5e160debc322f5d9e86086af
Dependencies: Stopgaps:

Status badges

Description

Finite lattice posets now has join_irreducibles() and join_irreducibles_poset(). Add meet_irreducibles() and meet_irreducibles_poset().

is_distributive() is now based on formal definition. It can just check that lattice is graded and that number of both meet- and join-irreducibles equals to rank (=height-1) of the lattice.

Change History (12)

comment:1 Changed 8 years ago by jmantysalo

Branch: u/jmantysalo/latticeposet__add_meet_irreducibles__faster_is_distributive

comment:2 Changed 8 years ago by jmantysalo

Authors: Jori Mäntysalo
Cc: ncohen added
Commit: 0ee134c54632d9950ac65d9ce47e54c0fab0e483
Status: newneeds_review

New commits:

0ee134cMuch better is_distributive(). Added two little functions.

comment:3 Changed 8 years ago by ncohen

Reviewers: Nathann Cohen
Status: needs_reviewneeds_work

Hello !

1) meet_irreducibles: you write len(self.upper_covers()) which calls upper_covers_iterator which iterates over all out-neighbors of a vertex of the HasseDiagram before relabelling them as !Poset elements. Why ? All you want to do is check that the outdegree of those points if 1. You could work on the diagram directly.

2) Please add the new functions to the index.

3) You cannot use $ for latex code there. Use ` instead. In order to check that the doc compiles correctly run sage -b && sage -docbuild reference/combinat html and look at the html files produced.

4) Use () instead of \ to wrap code on multiple lines.

Nathann

comment:4 Changed 8 years ago by jmantysalo

1: But posets.py says "This internal data structure is subject to change at any point. Do not break encapsulation!" But I can do that of course; then I'll also change join_irreducibles.

2: Uh, of course.

3: OK. But then http://www.sagemath.org/doc/developer/coding_basics.html#latex-typesetting needs correcting.

4: OK.

comment:5 Changed 8 years ago by git

Commit: 0ee134c54632d9950ac65d9ce47e54c0fab0e483b3e1bcad805e3cff946ee95bc225534a583ea248

Branch pushed to git repo; I updated commit sha1. New commits:

b3e1bcaMinor corrections.

comment:6 Changed 8 years ago by jmantysalo

Status: needs_workneeds_review

3: It seems that $ works in me. Could you check it? 2: There is no index where to add... So, more work to poset documentation project.

As of 1, I did not do that for now; this is direct copy from join_-counterparts. Point 4 is done, but long line of == is still quite hard to read.

Also this same time I removed totally unused argument from cover_relations. Is this OK to do in ticket title saying nothing about it?

comment:7 in reply to:  4 Changed 8 years ago by ncohen

Yo !

1: But posets.py says "This internal data structure is subject to change at any point. Do not break encapsulation!" But I can do that of course; then I'll also change join_irreducibles.

Lost computations for political reasons. This code never ceases to amaze me :-P

3: OK. But then http://www.sagemath.org/doc/developer/coding_basics.html#latex-typesetting needs correcting.

Oh. If it is written in the developper's manual then the nazis can do nothing against you. Good ! :-D

Nathann

comment:8 in reply to:  6 Changed 8 years ago by ncohen

2: There is no index where to add... So, more work to poset documentation project.

Oh, no index for lattices. Right, sorry for my remark !

As of 1, I did not do that for now; this is direct copy from join_-counterparts. Point 4 is done, but long line of == is still quite hard to read.

As you wish. Remember that there is some time there to save if you have time problems later on.

Also this same time I removed totally unused argument from cover_relations. Is this OK to do in ticket title saying nothing about it?

I don't mind. It will depend on the reviewers, though.

I will run all tests on a machine to check that removing this keyword does not break anything somewhere.

Nathann

comment:9 Changed 8 years ago by tscrim

The dollar-sign $ does work, but it is (strongly?) recommended that you use the backticks ` instead. I think there are still issues with the notebook's documentation when using dollar-signs.

comment:10 Changed 8 years ago by git

Commit: b3e1bcad805e3cff946ee95bc225534a583ea2488b68cdb1290ca3fa5e160debc322f5d9e86086af

Branch pushed to git repo; I updated commit sha1. New commits:

8b68cdbChanged "$" to "`" as LaTeX marker on documentation.

comment:11 Changed 8 years ago by ncohen

Status: needs_reviewpositive_review

All tests passed !

Thanks,

Nathann

comment:12 Changed 8 years ago by vbraun

Branch: u/jmantysalo/latticeposet__add_meet_irreducibles__faster_is_distributive8b68cdb1290ca3fa5e160debc322f5d9e86086af
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.