Thank you for your help! On Wednesday, March 4, 2020 at 2:55:50 AM UTC-5, Nicolas M. Thiery wrote: > > Dear Soheli, > > On Tue, Mar 03, 2020 at 03:12:09PM -0800, Soheli Das wrote: > > I'm trying to generate a function that produces King tableaux. My idea > is > > to first generate Semi-standard tableaux and then select the ones that > obey > > the conditions of a King tableaux. I'm thinking of the entries i and -i > for > > i=1,....,n as entries 1,....,2n. So, basically I want the rows to be > weakly > > increasing and the columns to be strictly increasing like > 1<3<5<.....<2n-1. > > The following is what I have so far, it simply generates semistandard > > tableaux. > > > > def generate_kingTableaux(size,max_entry_val,to_generate): > > ....: v=[ ] > > ....: for k in range(to_generate): > > ....: > > v.append(SemistandardTableaux(size,max_entry=max_entry_val).list()) > > ....: return v > > > > I want to implement a condition which is somewhat like: if v[i][1] < > 2i-1 > > then not a king tableaux; else i=i+1. > > I'm not sure how to implement this in sage. I would really appreciate if > > someone could guide/help me! > > Disclaimer: I am not familiar with King tableaux. > > Iterators are a comfortable tool in such situations. The general > structure for an iterator using a rejection method like yours would > be: > > def kingTableaux(size,max_entry_val,to_generate): > for k in range(to_generate): > for t in SemistandardTableaux(size,max_entry=max_entry_val): > # Check all the conditions t should satisfy to be a king > tableau > if / for ...: > # not a king tableaux; move on to the next onoe > continue > # Now we know t is a king tableau > yield t > > This would be used as: > > for t in kingTableaux(...): > ... > > If performance matters, and if King tableaux form a small subset of > semi standard tableaux, the next step would be to find a way to > produce them directly without generating all semistandard tableaux. > Possibly by induction. Or using a crystal structure on such tableaux > (relevant? https://arxiv.org/abs/1910.04459). Maybe someone already > has code for this. > > Hope this help. > > Cheers, > Nicolas > > [1] > https://doc.sagemath.org/html/en/thematic_tutorials/tutorial-comprehensions.html#defining-new-iterators > > -- > 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/fa96e62e-8f05-4b5f-872e-b552cf663918%40googlegroups.com.