Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Jori Mantysalo
On Thu, 28 Aug 2014, Jori Mantysalo wrote: As a side note of testing: Docs for is_modular() reference to the wikipedia Uh, forget. If poset is also lattice and has subposet that is also lattice, still subposet might not be sublattice. -- Jori Mäntysalo -- You received this message because

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Jori Mantysalo
On Thu, 28 Aug 2014, Nathann Cohen wrote: Now it seems to work! I'll continue testing, and add a function to sage. It is meant to be equivalent, so it would be a bad news if they did not give the same answer :-P As a side note of testing: Docs for is_modular() reference to the wikipedia ar

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Nathann Cohen
Yooo !!! > Now it seems to work! I'll continue testing, and add a function to sage. It is meant to be equivalent, so it would be a bad news if they did not give the same answer :-P > Is it pine forest? In any case, have a nice walk. Not a pine forest, but a good forest indeed. It had tr

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Jori Mantysalo
On Thu, 28 Aug 2014, Nathann Cohen wrote: (In the forest) With the transitive closure ! The transitive closure AND induced= true. Now it seems to work! I'll continue testing, and add a function to sage. Is it pine forest? In any case, have a nice walk. -- Jori Mäntysalo ("mänty"=pine, "salo"

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Nathann Cohen
(In the forest) With the transitive closure ! The transitive closure AND induced= true. Append .transitive_closure() after each call to hasse_digram and it should work ! Nathann On Thursday, August 28, 2014, Jori Mantysalo wrote: > On Thu, 28 Aug 2014, Nathann Cohen wrote: > > Yes, you do ne

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Jori Mantysalo
On Thu, 28 Aug 2014, Nathann Cohen wrote: Yes, you do need this induced=True otherwise the chain contains all other (smaller) posets :-P But def has_isomorphic_subposet(A, B): for x in Subsets(A.list(), k=B.cardinality()): if A.subposet(x).is_isomorphic(B): return True

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Nathann Cohen
(sitting in the living room) Yes, you do need this induced=True otherwise the chain contains all other (smaller) posets :-P Sorry 'bout that. And it should be much faster than the listing from your trac ticket (which you can close if your problem is solved, or recycle into a ticket to implement

Re: [sage-devel] Re: Function for subposet search

2014-08-28 Thread Nathann Cohen
(At the super market) Doesn't it work better if you also do induced=true for the transitive closure thing too ? Nathann On Wednesday, August 27, 2014, Jori Mantysalo wrote: > On Fri, 22 Aug 2014, Nathann Cohen wrote: > > Does Sage has a function to check if poset A contains a subposet >>> iso

Re: [sage-devel] Re: Function for subposet search

2014-08-27 Thread Jori Mantysalo
On Fri, 22 Aug 2014, Nathann Cohen wrote: Does Sage has a function to check if poset A contains a subposet isomorphic to subposet B? Not... exactly. There is no Poset method that does that, but there is a DiGraph method that does that. But then, it depends on what you call a subposet of a pos

Re: [sage-devel] Re: Function for subposet search

2014-08-22 Thread Nathann Cohen
> +1 to doing this; that way it becomes easier (more natural) to check for > things like 2+2 freeness. My first thought is for B.is_subposet(A). In Graph there is a G.is_subgraph(H) that just checks that the edges of H are edges of G (and that points of H are point of G). This function is of cours

Re: [sage-devel] Re: Function for subposet search

2014-08-22 Thread Travis Scrimshaw
Hey, > OK. First question is name of the function. I would say A.has_subposet(), > but should it be A.has_isomorphic_subposet() or even B.is_subposet()? > +1 to doing this; that way it becomes easier (more natural) to check for things like 2+2 freeness. My first thought is for B.is_subposet(

Re: [sage-devel] Re: Function for subposet search

2014-08-22 Thread Nathann Cohen
Helloo !! > OK. First question is name of the function. I would say A.has_subposet(), > but should it be A.has_isomorphic_subposet() or even B.is_subposet()? HMmmm.. Well, do you only want to answer whether there is a copy of B in A, or also give that copy to the user ? When I picked a n

Re: [sage-devel] Re: Function for subposet search

2014-08-22 Thread Jori Mantysalo
On Fri, 22 Aug 2014, Nathann Cohen wrote: Does Sage has a function to check if poset A contains a subposet isomorphic to subposet B? Not... exactly. There is no Poset method that does that, but there is a DiGraph method that does that. But then, it depends on what you call a subpos