On Mon, Mar 09, 2020 at 05:20:02PM -0700, Soheli Das wrote: > I was trying to list the King tableaux of a particular shape. Here's the > function: > > def list_of_king_tableaux(t_shape, t_max_entry): > """A function which finds the list of King tableaux of given shape.""" > return list([t for t in SemistandardTableaux(t_shape, > max_entry=t_max_entry) if is_king_tableau(t)]) > > And this is the output I got: > > sage: list_of_king_tableaux([2,2],4) > [[[1, 1], [3, 3]], > [[1, 1], [3, 4]], > [[1, 1], [4, 4]], > [[1, 2], [3, 3]], > [[1, 2], [3, 4]], > [[1, 2], [4, 4]], > [[1, 3], [3, 4]], > [[1, 3], [4, 4]]] > > The list shows the tableaux that are not king tableaux. How do I choose the > ones that obey the king tableaux condition?
The way you use is_king_tableau in list_of_king_tableaux looks correct. So test that is_king_tableau indeed return false on the undesired tableau. Btw: list([...]) is redundant; [...] is equivalent. In addition, iterators are most of the time better than lists. If you haven't done so yet, I really recommend the iterators thematic tutorial. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-combinat-devel/20200310055921.GN3535%40mistral.