Closed f29946bc-ee7b-48cd-9abc-3445948c551d closed 8 years ago
Description changed:
---
+++
@@ -1,3 +1,3 @@
Add a function to get the lattice of sublattices.
-(First wait #20669 to get closed.)
+(First wait #20669 to get integrated at 7.3beta7.)
Changed keywords from latticeposet to lattice poset
Isn't "lattice" an ambiguous keyword? It refers to two different things, try to click it and see.
In and of itself, yes, "lattice" is ambiguous. However, "latticeposet" is not a word (in English), but having the "lattice poset" together makes it clear. (More of a random note, there are also 2 other distinct non-mathematical uses of the word lattice that comes to mind as well.)
However, you're free to build here upon #20669 before it gets released in a beta.
Replying to @tscrim:
In and of itself, yes, "lattice" is ambiguous. However, "latticeposet" is not a word (in English), but having the "lattice poset" together makes it clear.
But trac does not seem to accept two words keyphrase. Trying to put "foo bar, xyzzy" as keywords does just what "foo, bar, xyzzy" would do. lattice_poset maybe?
However, you're free to build here upon #20669 before it gets released in a beta.
True, but Volker releases betas so often that it makes no big delay.
Not ready, but I save it here and will continue on another computer after next beta.
New commits:
85ccdc2 | Added function sublattices_lattice. |
Commit: 85ccdc2
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
29f13a1 | Add sublattices_lattice(). |
Just pinging... Examples are hard, as even very small lattice can generate a big lattice of sublattices.
I would write the input section as:
- ``element_constructor`` -- string; can be one of the following:
* ``'lattice'`` - (the default) elements of the lattice will
be lattices that correspond to sublattices of ``self``
* ``'tuple'`` - elements are tuples of elements of the
sublattices of ``self``
* ``'integer'`` - the elements are plain integers
Also, it looks like you have an unneeded import of DiGraph
. Otherwise LGTM.
Reviewer: Travis Scrimshaw
Branch pushed to git repo; I updated commit sha1. New commits:
2863437 | Reviewer comments. |
Corrected those. I used format "original lattice", as self
is not very much used in docstring in this file.
Should it be "elements" or "the elements"?
Formally (i.e., if a English professor looked at it), I'm not sure if the "the" is necessary here because it is plural and the structure of the sentence is declarative. Feel free to add it as it is not wrong. Also, I missed this above, it should just be (default)
, i.e., no "the" there. Thanks.
Branch pushed to git repo; I updated commit sha1. New commits:
85ccdc2 | Added function sublattices_lattice. |
cf7f1e5 | Merge branch 'u/jmantysalo/latticeposet__add_function_to_get_lattice_of_sublattices' of git://trac.sagemath.org/sage into t/20921/latticeposet__add_function_to_get_lattice_of_sublattices |
cf557bb | Removed a 'the'. |
Replying to @tscrim:
Formally (i.e., if a English professor looked at it), I'm not sure if the "the" is necessary here because it is plural and the structure of the sentence is declarative. Feel free to add it as it is not wrong.
If it is not needed, I can left it off. I was just wondering when you wrote "tuple - elements are" vs. "integer - the elements".
Ready now?
Replying to @jm58660:
Replying to @tscrim:
Formally (i.e., if a English professor looked at it), I'm not sure if the "the" is necessary here because it is plural and the structure of the sentence is declarative. Feel free to add it as it is not wrong.
If it is not needed, I can left it off. I was just wondering when you wrote "tuple - elements are" vs. "integer - the elements".
Whoops, my bad.
Ready now?
Yep. Thanks.
sage -t --long src/sage/combinat/posets/lattices.py
**********************************************************************
File "src/sage/combinat/posets/lattices.py", line 1743, in sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice
Failed example:
sll = L.sublattices_lattice()
Exception raised:
Traceback (most recent call last):
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 499, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 862, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice[4]>", line 1, in <module>
sll = L.sublattices_lattice()
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1868, in sublattices_lattice
G.relabel(lambda x: self.sublattice(x))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py", line 19817, in relabel
perm = dict( [ i, perm(i) ] for i in self.vertices() )
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py", line 19817, in <genexpr>
perm = dict( [ i, perm(i) ] for i in self.vertices() )
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1868, in <lambda>
G.relabel(lambda x: self.sublattice(x))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1680, in sublattice
return LatticePoset(self.subposet(current_set))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 4513, in subposet
elements = [self(e) for e in elements]
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 1232, in __call__
return super(FinitePoset, self).__call__(element)
File "sage/structure/parent.pyx", line 1107, in sage.structure.parent.Parent.__call__ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/parent.c:9904)
return mor._call_(x)
File "sage/structure/coerce_maps.pyx", line 110, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/coerce_maps.c:4651)
raise
File "sage/structure/coerce_maps.pyx", line 105, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/coerce_maps.c:4539)
return C._element_constructor(x)
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 1208, in _element_constructor_
% type(element))
ValueError: <type 'int'> is not an element of this poset
**********************************************************************
File "src/sage/combinat/posets/lattices.py", line 1844, in sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice
Failed example:
sll = L.sublattices_lattice()
Exception raised:
Traceback (most recent call last):
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 499, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 862, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice[4]>", line 1, in <module>
sll = L.sublattices_lattice()
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1868, in sublattices_lattice
G.relabel(lambda x: self.sublattice(x))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py", line 19817, in relabel
perm = dict( [ i, perm(i) ] for i in self.vertices() )
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py", line 19817, in <genexpr>
perm = dict( [ i, perm(i) ] for i in self.vertices() )
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1868, in <lambda>
G.relabel(lambda x: self.sublattice(x))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py", line 1680, in sublattice
return LatticePoset(self.subposet(current_set))
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 4513, in subposet
elements = [self(e) for e in elements]
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 1232, in __call__
return super(FinitePoset, self).__call__(element)
File "sage/structure/parent.pyx", line 1107, in sage.structure.parent.Parent.__call__ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/parent.c:9904)
return mor._call_(x)
File "sage/structure/coerce_maps.pyx", line 110, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/coerce_maps.c:4651)
raise
File "sage/structure/coerce_maps.pyx", line 105, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (/home/buildbot/slave/sage_git/build/src/build/cythonized/sage/structure/coerce_maps.c:4539)
return C._element_constructor(x)
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/combinat/posets/posets.py", line 1208, in _element_constructor_
% type(element))
ValueError: <type 'int'> is not an element of this poset
**********************************************************************
File "src/sage/combinat/posets/lattices.py", line 1856, in sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice
Failed example:
sll.is_isomorphic(Posets.BoolenLattice(3))
Exception raised:
Traceback (most recent call last):
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 499, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 862, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice[10]>", line 1, in <module>
sll.is_isomorphic(Posets.BoolenLattice(Integer(3)))
AttributeError: type object 'Posets' has no attribute 'BoolenLattice'
**********************************************************************
1 item had failures:
3 of 24 in sage.combinat.posets.lattices.FiniteLatticePoset.sublattices_lattice
[310 tests, 3 failures, 0.75 s]
Branch pushed to git repo; I updated commit sha1. New commits:
fe8b4f6 | Removed duplicate function. |
AARGHS! There was my temporary copy still in the branch. Now it is removed and tests passed.
Changed branch from u/jmantysalo/latticeposet__add_function_to_get_lattice_of_sublattices to fe8b4f6
Add a function to get the lattice of sublattices.
(First wait #20669 to get integrated at 7.3beta7.)
CC: @tscrim
Component: combinatorics
Keywords: lattice poset
Author: Jori Mäntysalo
Branch/Commit:
fe8b4f6
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/20921