Ticket #13074 (closed enhancement: fixed)

Opened 12 months ago

Last modified 5 months ago

Implementation of TableauTuples

Reported by: andrew.mathas Owned by: Andrew Mathas
Priority: major Milestone: sage-5.6
Component: combinatorics Keywords: Tableaux, PartitionTuple
Cc: sage-combinat Work issues:
Report Upstream: N/A Reviewers: Travis Scrimshaw
Authors: Andrew Mathas Merged in: sage-5.6.beta2
Dependencies: #9265, #13072 Stopgaps:

Description (last modified by andrew.mathas) (diff)

Implements (standard) tableaux of shape a PartitionTuple. That is, tableau with shape a tuple of partitions, together with standard functions for these objects. These objects arise naturally in algebraic combinatorics, such as in the representation theory of the cyclotomic Hecke algebras of type G(r,1,n) and (hence) in the categorification of the irreducible highest weight representations (and their canonical bases) of the (quantum) affine special linear groups.

This patch implements TableauTuples and StandardTableauTuples and basic methods for them. The idea is that these classes should naturally extend the corresponding Tableaux classes, which are in bijection with 1-tuples of tableaux. As with PartitionTuples, the TableauTuple classes return honest Tableaux whilst still recognising them as being TableauTuples. Both Tableaux and TableauTuples classes have a component() method which returns the list of components which allows loops such as

for s in t.components():
  do X

where t is a TableauTuple (or Tableau). With this modification is it possible to write code which will behave the same for both classes. Whenever they were meaningful, I have implemented existing functions for tableaux for the tableau tuples. For example, there are iterators for StandardTableauTuples, you can conjugate TableauTuples, take their shape and size, compute words, act on them, ...

The patch implements the following classes:

  • TableauTuples
  • TableauTuples_all
  • TableauTuples_level
  • TableauTuples_size
  • TableauTuples_level_size
  • StandardTableauTuples
  • StandardTableauTuples_all
  • StandardTableauTuples_level
  • StandardTableauTuples_size
  • StandardTableauTuples_level_size
  • StandardTableauTuples_shape

Apply: trac_13074-tuples-of-tableaux-am.patch Download

Attachments

trac_13074-tuples-of-tableaux-am.patch Download (178.8 KB) - added by jdemeyer 5 months ago.
Removing long doc test

Change History

comment:1 Changed 11 months ago by andrew.mathas

  • Cc sage-combinat added
  • Status changed from new to needs_review
  • Description modified (diff)
  • Milestone changed from sage-wishlist to sage-pending

comment:2 Changed 10 months ago by andrew.mathas

  • Dependencies changed from 13072 to #13072

comment:3 Changed 10 months ago by andrew.mathas

  • Description modified (diff)

comment:4 Changed 10 months ago by andrew.mathas

  • Dependencies changed from #13072 to #13072 #9265

comment:5 Changed 10 months ago by andrew.mathas

  • Milestone changed from sage-pending to sage-5.3

comment:6 Changed 10 months ago by andrew.mathas

  • Priority changed from minor to major
  • Dependencies changed from #13072 #9265 to #9265 #13072
  • Description modified (diff)

Should now apply cleanly to 5.2 (on top of #9265 and #13072)

Apply: trac_13074-tuples-of-tableaux-am.patch

Last edited 10 months ago by andrew.mathas (previous) (diff)

comment:7 Changed 10 months ago by andrew.mathas

New version of patch which has tuple code in partition_tuple.py and tableau_tuple.py

comment:8 Changed 9 months ago by andrew.mathas

  • Description modified (diff)

comment:9 follow-up: ↓ 10 Changed 7 months ago by hivert

Hi Andrews,

First of all, many thanks form implementing tuple of tableaux. This is definitely a useful addition to Sage.

I didn't try to review your patch, but, when compiling the doc on Sage-Combinat queue, I noticed a bunch of warning from your file. Looking shortly at the patch, there is indeed many problems. You should to try to compile the doc with

sage -docbuild reference html

and then look into you browser to the compiled files. A few years ago, I wrote a page on the wiki to help writing the doc. It is at

http://wiki.sagemath.org/combinat/HelpOnTheDoc

Maybe it could help you. Also, be warned that it may be outdated.

Cheers,

Florent

comment:10 in reply to: ↑ 9 Changed 7 months ago by andrew.mathas

Hi Florent,

I accept that there are warnings when you build the documentation but I don't see any errors in either the python source or in the html output. As you said that you can see many errors in the doc strings in the patch, could you please point out a few of them so that I know what to look for? Otherwise I will waste a lot of time on this.

There doesn't seem to be any documentation on trouble shooting the documentation and, unfortunately, the warnings produced when compiling the documentation do not seem to be that helpful. For example, my patch produces the following warnings in partition.py

/usr/local/src/sage/sage-5.3/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition:13: WARNING: Block quote ends without a blank line; unexpected unindent.
/usr/local/src/sage/sage-5.3/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition:18: WARNING: Block quote ends without a blank line; unexpected unindent.
/usr/local/src/sage/sage-5.3/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition:23: WARNING: Block quote ends without a blank line; unexpected unindent.
/usr/local/src/sage/sage-5.3/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition:28: WARNING: Block quote ends without a blank line; unexpected unindent.

However, when I look at lines 13, 18, 23 and 28 of partition.py I don't see anything wrong -- and indeed, my patch does not appear to touch these lines (but these warning do not appear before my patch is applied...).

Presumably the line numbers above are not literal line numbers inside the file, and instead they are just relative line numbers in particular doc-strings, but I do not see how to find which doc strings the warnings refer to. Any hints that you can give would be much appreciated!

Andrew

comment:11 Changed 7 months ago by tscrim

  • Reviewers set to Travis Scrimshaw

Hey Andrew,

Yes, those line numbers are not literal, I think they are some sort of offset from the start of methods which cause the problem. In short, the warnings are generally useless.

There's a fair amount of documentation that I feel needs to be tweaked, so I'll write a review patch with my proposed changes.

Best,

Travis

comment:12 Changed 7 months ago by andrew.mathas

Thanks for doing this Travis. I think that I am now very much in your debt! I feel that you are again going over my documentation and fixing it up for me. Would it be better for me to have a first bash at improving it now that I understand a little better what it should like?

Andrew

comment:13 Changed 7 months ago by tscrim

Sure, go ahead. Thanks.

Travis

comment:14 Changed 6 months ago by andrew.mathas

  • Dependencies changed from #9265 #13072 to #9265 #13072 #11476

comment:15 Changed 6 months ago by tscrim

  • Status changed from needs_review to positive_review

Looks good to me now. I believe the startup failure is acceptable since we are creating a new module so I'm setting this to a positive review. If anyone disagrees and has a way around this, please let me know.

comment:16 Changed 6 months ago by andrew.mathas

  • Dependencies changed from #9265 #13072 #11476 to #9265 #13072

comment:17 follow-up: ↓ 18 Changed 5 months ago by jdemeyer

  • Status changed from positive_review to needs_work

There are some problems with the documentation formatting:

/release/merger/sage-5.6.beta0/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition.Partition_class.top_garnir_tableau:4: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/release/merger/sage-5.6.beta0/local/lib/python2.7/site-packages/sage/combinat/partition_tuple.py:docstring of sage.combinat.partition_tuple.PartitionTuple.top_garnir_tableau:5: WARNING: Inline interpreted text or phrase reference start-string without end-string.

comment:18 in reply to: ↑ 17 Changed 5 months ago by tscrim

Replying to jdemeyer:

There are some problems with the documentation formatting:

/release/merger/sage-5.6.beta0/local/lib/python2.7/site-packages/sage/combinat/partition.py:docstring of sage.combinat.partition.Partition_class.top_garnir_tableau:4: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/release/merger/sage-5.6.beta0/local/lib/python2.7/site-packages/sage/combinat/partition_tuple.py:docstring of sage.combinat.partition_tuple.PartitionTuple.top_garnir_tableau:5: WARNING: Inline interpreted text or phrase reference start-string without end-string.

I believe the problem is `top Garnir tableaux' which should be 'top Garnir tableaux' (unfortunately we can't strictly copy and paste our latex XP).

comment:19 Changed 5 months ago by andrew.mathas

Thanks Travis (and Jeronen). I'll upload the easy fix shortly.

comment:20 Changed 5 months ago by tscrim

  • Status changed from needs_work to positive_review

Thanks Andrew.

comment:21 Changed 5 months ago by jdemeyer

  • Status changed from positive_review to needs_work

On sage.math (Linux x86_64):

sage -t  --long -force_lib devel/sage/sage/combinat/tableau_tuple.py
*** *** Error: TIMED OUT! PROCESS KILLED! *** ***

         [1800.3 s]

Also, the header of the patch file is messed up.

comment:22 Changed 5 months ago by andrew.mathas

This was caused by the test (on line 2193):

all(correct_number(mu) for mu in PartitionTuples (4,12)) # long time

which does pass but which takes a really long time. I have changed the 12 to an 8 which completes fast enough to make the automatic test happy.

I have also fixed up the header. As the doctest now passes I'll change it back to positive review. Hope that's OK as the patchbot will be able to verify this.

Last edited 5 months ago by andrew.mathas (previous) (diff)

comment:23 Changed 5 months ago by andrew.mathas

  • Status changed from needs_work to positive_review

comment:24 follow-up: ↓ 27 Changed 5 months ago by jdemeyer

Preferably, doctests should take 30 seconds at most with 60 seconds as absolute maximum (measured on sage.math).

comment:25 Changed 5 months ago by jdemeyer

So this is still way too much:

sage: correct_number=lambda mu : StandardTableauTuples(mu).cardinality()==len(StandardTableauTuples(mu).list())
sage: time all(correct_number(mu) for mu in PartitionTuples(4,8))
True
Time: CPU 457.57 s, Wall: 457.57 s

comment:26 Changed 5 months ago by jdemeyer

  • Status changed from positive_review to needs_work

comment:27 in reply to: ↑ 24 Changed 5 months ago by andrew.mathas

Replying to jdemeyer:

Preferably, doctests should take 30 seconds at most with 60 seconds as absolute maximum (measured on sage.math).


I thought that the whole point of the #long time tag is to allow for longer tests? If you like I can take it out but as it is marked with #long time my first preference would be to leave it in place.

Please advise.

Andrew

comment:28 Changed 5 months ago by andrew.mathas

  • Status changed from needs_work to positive_review

I found the relevant section of the development guide and see that your comments actually refer to the #long time tests, so I have removed the long test.

Cheers,
Andrew

comment:29 Changed 5 months ago by jdemeyer

Fixed patch header properly (re-exported by Mercurial).

Changed 5 months ago by jdemeyer

Removing long doc test

comment:30 follow-up: ↓ 32 Changed 5 months ago by jdemeyer

  • Dependencies changed from #9265 #13072 to #9265, #13072

Also, stuff like

#Relies on patch trac_13072-tuples-of-partitions_am.patch which implements a PartitionTuple class.

doesn't need to be mentioned in the commit message, since it's not useful information after the patch has been merged into Sage.

comment:31 Changed 5 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.6.beta2

comment:32 in reply to: ↑ 30 Changed 5 months ago by andrew.mathas

Thanks for fixing these two things for me.
A.

Note: See TracTickets for help on using tickets.