Opened 12 years ago

Closed 11 years ago

# An interface to Anders Buch's Littlewood-Richardson Calculator ``lrcalc``

Reported by: Owned by: Mike Hansen Sage Combinat CC user major sage-5.0 packages: optional spkg package, Schubert calculus, Littlewood-Richardson, days30 Sage Combinat CC user, Anders S Buch, Franco Saliola sage-5.0.beta2 Mike Hansen, Anders Buch, Nicolas M. Thiéry, Anne Schilling Nicolas M. Thiéry, Anne Schilling N/A

The attached patch, and spkg implements an interface to Anders Buch's Littlewood-Richardson Calculator lrcalc

The "Littlewood-Richardson Calculator" is a C library for fast computation of Littlewood-Richardson (LR) coefficients and products of Schubert polynomials. It handles single LR coefficients, products of and coproducts of Schur functions, skew Schur functions, and fusion products. All of the above are achieved by counting LR (skew)-tableaux (also called Yamanouchi (skew)-tableaux) of appropriate shape and content by iterating through them. Additionally, lrcalc handles products of Schubert polynomials.

The web page of lrcalc is: http://math.rutgers.edu/~asbuch/lrcalc/

Here is a short extract of the doc:

```EXAMPLES::

sage: import sage.libs.lrcalc.lrcalc as lrcalc

Compute a single Littlewood-Richardson coefficient::

sage: lrcalc.lrcoef([3,2,1],[2,1],[2,1])              #optional - lrcalc
2

Compute a product of Schur functions; return the coefficients in the Schur expansion::

sage: lrcalc.mult([2,1], [2,1])                       #optional - lrcalc
{[3, 3]: 1, [4, 2]: 1, [3, 1, 1, 1]: 1, [4, 1, 1]: 1, [2, 2, 2]: 1, [3, 2, 1]: 2, [2, 2, 1, 1]: 1}
```

Making lrcalc into a standard package in the next Sage release is the topic of the followup ticket: #11563

### comment:1 Changed 12 years ago by Mike Hansen

Status: new → needs_review

### comment:3 Changed 12 years ago by Anne Schilling

Reviewers: → Anne Schilling

Together with Anders Buch, I went through this patch at Sage Days 30 and checked all functionalities. We added further doctests and also access to fusion coefficients (which was not in the previous version of this patch).

From the mathematical point of view, I give this a positive review. Could someone please do a quick technical review of the patch?

Thanks!

Anne

Apply: trac_10333-lrcalc-final.patch

### comment:4 Changed 12 years ago by Anne Schilling

Milestone: sage-4.7 → sage-4.7.1

### comment:5 Changed 12 years ago by Anne Schilling

Keywords: spkg package Schubert calculus Littlewood-Richardson added

I fixed some more typos and omissions on the doctest.

Positive review on the mathematics and features.

Could someone complete the technical review?

Cheers,

Anne

### comment:7 Changed 11 years ago by Frédéric Chapoton

for the bot:

Apply: trac_10333-lrcalc-final.patch

### comment:8 Changed 11 years ago by Anne Schilling

Authors: Mike Hansen → Mike Hansen, Anders Buch, Nicolas Thiery, Anne Schilling Anne Schilling → Nicolas Thiery, Anne Schilling

### comment:9 Changed 11 years ago by Nicolas M. Thiéry

Hi,

I used the occasion to do something I had promissed Anders a while ago: namely to add a standard GNU build system (autoconf/automake) to the original lrcalc sources. With this, the SPKG becomes trivial. I'll upload shortly a preversion of it. If Anders agrees with the changes, and once he will have done an official release, I'll upload a final version of the spkg.

Mike: could you review now the three little files: SPKG.txt, spkg-install and spkg-check? Those are unlikely to change.

### comment:10 Changed 11 years ago by Nicolas M. Thiéry

Description: modified (diff) Add an optional interface for lrcalc → An interface to Anders Buch's Littlewood-Richardson Calculator ``lrcalc``

### comment:11 Changed 11 years ago by Nicolas M. Thiéry

Description: modified (diff)

### comment:12 Changed 11 years ago by Nicolas M. Thiéry

I fixed a couple tiny typos in lrcalc.pyx, and uploaded an updated patch. For me this part is good to go.

### comment:13 follow-up:  14 Changed 11 years ago by Nicolas M. Thiéry

Description: modified (diff)

According to the vote on http://groups.google.com/group/sage-devel/browse_thread/thread/2e7114375f6f88a5/, there is a consensus on making lrcalc a standard package, after a one release probation period in order to follow the official rule. See: #11563

### comment:14 in reply to:  13 Changed 11 years ago by Anne Schilling

Can we now set a positive review on this patch?

Anne

### comment:15 follow-up:  16 Changed 11 years ago by Nathann Cohen

Status: needs_review → needs_info

(pending an answer, if no one knows whether this ticket should be reviewed...)

### comment:16 in reply to:  15 Changed 11 years ago by Anne Schilling

Status: needs_info → needs_review

(pending an answer, if no one knows whether this ticket should be reviewed...)

As far as I know, everything is fine with the ticket except that Nicolas is waiting for confirmation from Anders Buch about the spkg. Nicolas, is everything ok now on this front?

Anne

### comment:17 Changed 11 years ago by Nathann Cohen

Got it ! Then what about setting it to needs_info in the meantime sothat it does not appear in the list of tickets needing a review ? I am trying to deal with some of them, and it would be nice to sort out the tickets which actually need one, those which are to be forgotten until some external event takes place, and those that are totally abandonned `:-)`

Nathann

### comment:18 Changed 11 years ago by Nicolas M. Thiéry

Status: needs_review → needs_info → Need final permission from Anders

Done.

### comment:19 Changed 11 years ago by Nicolas M. Thiéry

Description: modified (diff)

### Changed 11 years ago by Nicolas M. Thiéry

lrcalc 1.1.6 beta release (for Anders)

### comment:20 Changed 11 years ago by Nicolas M. Thiéry

Status: needs_info → needs_review Need final permission from Anders

After discussion with Anders, I have rolled a new (beta) release of lrcalc, based on:

• lrcalc-1.1.5.tar.gz
• schmult-1.1.5.tar.gz
• an autotools build system

which Anders will later polish into an official 1.1.6 release. The spkg is basically identical to the previous 1.1.5b, except for some updated files in the lrcalc sources (README/AUTHOR/TODO), and the header installation configuration. Anders gave his +1 on the changes. I have installed the spkg together with the patch on sage 4.7.2 and sage-5.0.prealpha0, and in both cases, all test pass.

The patch is unchanged and has a positive review.

Anne (and others!): could you try out the new spkg? If it works fine for you, I guess we can set a positive review. Feel free to untar the spkg, and check the files src/README, src/AUTHORS, src/TODO, src/NEWS.

Cheers,

Nicolas

### comment:21 Changed 11 years ago by Nicolas M. Thiéry

Cc: Anders S Buch added modified (diff)

### comment:22 Changed 11 years ago by Anne Schilling

Status: needs_review → positive_review

I tried out the new package and ran the tests. Everything seemed to work. Positive review.

Anne

### comment:23 Changed 11 years ago by Jeroen Demeyer

Milestone: sage-4.8 → sage-5.0

### comment:24 Changed 11 years ago by Jeroen Demeyer

Component: combinatorics → optional packages

### comment:25 follow-up:  26 Changed 11 years ago by Jeroen Demeyer

Status: positive_review → needs_work

I get a warning building the documentation (this is without the optional spkg installed):

```/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta1/devel/sage/doc/en/reference/sage/libs/lrcalc/lrcalc.rst:7: WARNING: autodoc can't import/find module 'sage.libs.lrcalc.lrcalc', it reported error: "No module named lrcalc", please check your spelling and sys.path
```

### comment:26 in reply to:  25 ; follow-up:  29 Changed 11 years ago by Nicolas M. Thiéry

I get a warning building the documentation (this is without the optional spkg installed):

```/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta1/devel/sage/doc/en/reference/sage/libs/lrcalc/lrcalc.rst:7: WARNING: autodoc can't import/find module 'sage.libs.lrcalc.lrcalc', it reported error: "No module named lrcalc", please check your spelling and sys.path
```

Yikes. Is there an idiom to conditionally include a piece of documentation in the reference manual depending on the presence or not of a spkg? (analogue of the is_package_installed in module.list.py).

If not, may we just kill the beast, and make lrcalc right away a standard spkg (#11563)?

Cheers,

### comment:27 follow-up:  28 Changed 11 years ago by Jeroen Demeyer

Maybe this should be discussed on sage-devel? I don't have an opinion either way.

### comment:28 in reply to:  27 Changed 11 years ago by Nicolas M. Thiéry

Description: modified (diff)

Maybe this should be discussed on sage-devel? I don't have an opinion either way.

Ok, I just relaunched the discussion there:

### comment:29 in reply to:  26 ; follow-up:  30 Changed 11 years ago by Sébastien Labbé

Yikes. Is there an idiom to conditionally include a piece of documentation in the reference manual depending on the presence or not of a spkg? (analogue of the is_package_installed in module.list.py).

If you don't include the documentation in the reference manual (by that, I mean no modification to the file `doc/en/reference/libs.rst` ), does the warning still shows up when building the documentation?

What is the status of the documentation for other optional packages?

### comment:30 in reply to:  29 Changed 11 years ago by Nicolas M. Thiéry

Salut Sébastien!

Yikes. Is there an idiom to conditionally include a piece of documentation in the reference manual depending on the presence or not of a spkg? (analogue of the is_package_installed in module.list.py).

If you don't include the documentation in the reference manual (by that, I mean no modification to the file `doc/en/reference/libs.rst` ), does the warning still shows up when building the documentation?

I guess not, so worst case that will be the way to go. But not having the documentation linked to does not feel good.

What is the status of the documentation for other optional packages?

I did not find that many, and as far as I could see, the documentation was not linked to ...

Cheers,

### comment:31 Changed 11 years ago by Nicolas M. Thiéry

Status: needs_work → positive_review

Oh well, I just stripped the link to the lrcalc from libs.rst. Ugly, but if that's the price to pay to abide to the rules ...

Jeroen: I am allowing myself to put back the positive review to catch your attention. Feel free to unset it if you find it innappropriate.

### comment:32 follow-up:  33 Changed 11 years ago by Jeroen Demeyer

Status: positive_review → needs_work

One more thing: the spkg should follow the format of http://sagemath.org/doc/developer/producing_spkgs.html#the-file-spkg-txt. In particular, the `Changelog` should be formatted differently.

Final spkg

### comment:33 in reply to:  32 Changed 11 years ago by Nicolas M. Thiéry

Status: needs_work → needs_review

One more thing: the spkg should follow the format of http://sagemath.org/doc/developer/producing_spkgs.html#the-file-spkg-txt. In particular, the `Changelog` should be formatted differently.

Oops. Thanks for spotting this. I updated the spkg accordingly. Do you mind reviewing the new SPKG.txt?

### comment:34 follow-up:  35 Changed 11 years ago by Jeroen Demeyer

Status: needs_review → needs_work

Actually, the documentation still doesn't work:

```/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta2/devel/sage/doc/en/reference/sage/libs/lrcalc/lrcalc.rst:7: WARNING: autodoc can't import/find module 'sage.libs.lrcalc.lrcalc', it reported error: "No module named lrcalc", please check your spelling and sys.path
/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta2/local/lib/python2.7/site-packages/sage/misc/edit_module.py:docstring of sage.misc.edit_module.edit_devel:14: WARNING: Inline interpreted text or phrase reference start-string without end-string.
```

### comment:35 in reply to:  34 Changed 11 years ago by Nicolas M. Thiéry

Actually, the documentation still doesn't work:

```/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta2/devel/sage/doc/en/reference/sage/libs/lrcalc/lrcalc.rst:7: WARNING: autodoc can't import/find module 'sage.libs.lrcalc.lrcalc', it reported error: "No module named lrcalc", please check your spelling and sys.path
/mnt/usb1/scratch/jdemeyer/merger/sage-5.0.beta2/local/lib/python2.7/site-packages/sage/misc/edit_module.py:docstring of sage.misc.edit_module.edit_devel:14: WARNING: Inline interpreted text or phrase reference start-string without end-string.
```

I don't understand. Why is this lrcalc.rst file generated, whereas no such file is generated for, e.g. the analoguous sage/numerical/backends/coin_backend.pyx?

### comment:36 follow-ups:  37  38 Changed 11 years ago by John Palmieri

When I click on trac_10333-lrcalc-final.patch, it still has a line adding `sage/libs/lrcalc/lrcalc` to `doc/en/reference/libs.rst`. That's presumably the problem.

### comment:37 in reply to:  36 ; follow-up:  39 Changed 11 years ago by Anne Schilling

When I click on trac_10333-lrcalc-final.patch, it still has a line adding `sage/libs/lrcalc/lrcalc` to `doc/en/reference/libs.rst`. That's presumably the problem.

Nicolas, could you please also put the updated patch on the sage-combinat server.

Thanks,

Anne

### comment:38 in reply to:  36 Changed 11 years ago by Nicolas M. Thiéry

When I click on trac_10333-lrcalc-final.patch, it still has a line adding `sage/libs/lrcalc/lrcalc` to `doc/en/reference/libs.rst`. That's presumably the problem.

What's the heck? How did I do this?

Oh well; fixed. Thanks for spotting it!

### comment:39 in reply to:  37 Changed 11 years ago by Nicolas M. Thiéry

Status: needs_work → needs_review

Nicolas, could you please also put the updated patch on the sage-combinat server.

Done.

### comment:40 follow-up:  41 Changed 11 years ago by Nicolas M. Thiéry

Jeroen: I let you set back the positive review. Sorry for all the back and forth.

### comment:41 in reply to:  40 Changed 11 years ago by Anne Schilling

Status: needs_review → positive_review

Jeroen: I let you set back the positive review. Sorry for all the back and forth.

The line referring to doc/en/reference/libs.rst seems to be gone now, so I set this back to positive review. Hopefully it will work now!

Anne

### comment:42 Changed 11 years ago by Jeroen Demeyer

Merged in: → sage-5.0.beta2 → fixed positive_review → closed

Yippee :-)

Thanks everyone!

### comment:44 Changed 11 years ago by Jeroen Demeyer

Authors: Mike Hansen, Anders Buch, Nicolas Thiery, Anne Schilling → Mike Hansen, Anders Buch, Nicolas M. Thiéry, Anne Schilling Nicolas Thiery, Anne Schilling → Nicolas M. Thiéry, Anne Schilling
Note: See TracTickets for help on using tickets.