I have checked out the iterators thematic tutorial and I must say, it's really helpful. Thank you for recommending that. Seems like the is_king_tableau throws away the tableaux that have 2 in the 2nd-row 1st column. After that, it displays all other tableaux. I tried implementing a condition that goes over the list and throws away the undesired tableaux but haven't been successful yet.
On Tuesday, March 10, 2020 at 1:59:23 AM UTC-4, Nicolas M. Thiery wrote: > > > 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" <nth...@users.sf.net <javascript:>> > 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/be4a8d0c-e9e3-4771-b5a5-edce3e806812%40googlegroups.com.