You were right. I debugged is_king_tableau and found a minor fault in it. I fixed it like this:
def is_king_tableau(t): """A function which tests if a semistandard tableau is a King tableau.""" if SemistandardTableau(t): if t[0][0] < 1: return False """checks tableaux of shape (2,1)""" elif (t[1][0]%2)==0: return False for i, row in enumerate(t): if row[0] <= 2*i: return False return True I ran a couple of test cases and got my desired output. Is there a better way to check the above condition or what I did is fine? Thanks, Soheli On Wednesday, March 11, 2020 at 7:02:04 PM UTC-4, Nicolas M. Thiery wrote: > > > Right I forgot about it. > > Take a semi standard tableau that is in the resulting list and should > not be there (or the converse). Apply is_king_tableau. If the result > is not as expected, then it's time to debug is_king_tableau. If the > result is as expected, then something went wrong with how you used it. > > In both cases, if you need further help, report precise sequences of > commands you typed in so that it can be reproduced and analyzed. > > Cheers, > Nicolas > > > On Wed, Mar 11, 2020 at 03:44:35PM -0700, Soheli Das wrote: > > But now I'm using the tidied function given by Bruce: > > > > def is_king_tableau(t): > > """A function which tests if a semistandard tableau is a King > > tableau.""" > > > > if t[0][0] != 1: > > return False > > for i, row in enumerate(t): > > if row[0] <= 2*i: > > return False > > return True > > > > > > On Wednesday, March 11, 2020 at 5:59:43 PM UTC-4, Nicolas M. Thiery > wrote: > > > > > > > > > > > > > I have checked out the iterators thematic tutorial and I must say, > it's > > > > really helpful. Thank you for recommending that. > > > > > > Glad to hear :-) > > > > > > > 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. > > > > > > If something is fishy, it's in the is_king_tableau. Make sure that > > > function does what you want. > > > > > > sage: def is_king_tableau(t,no_of_rows): > > > ....: for i in range(no_of_rows): > > > ....: if t[0][0] != 1: > > > ....: return False > > > ....: elif t[i][0] <= 2*i: > > > ....: return False > > > ....: else: > > > ....: i=i+1 > > > ....: return True > > > > > > The i=i+1 is suspicious. If you really want to consider rows of even > > > index, it's more explicit to use range(0, no_of_rows, 2). > > > > > > Also the t[0][0] might as well be outside of the loop since it does > > > not depend on i. > > > > > > 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 <javascript:>. > > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-combinat-devel/a09b94cb-4b98-4e23-982e-6cdee5fa8557%40googlegroups.com. > > > > 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/5a916564-2497-4455-84d8-84f6f85d11c3%40googlegroups.com.