Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a catalog for crystals #15882

Closed
tscrim opened this issue Mar 1, 2014 · 73 comments
Closed

Implement a catalog for crystals #15882

tscrim opened this issue Mar 1, 2014 · 73 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Mar 1, 2014

Make a catalog for crystals similar to graphs/codes/etc. and remove things like CrystalOf* and InfinityCrystalOf* from the global namespace in an effort to clean it up.

Depends on #14275
Depends on #16027

CC: @sagetrac-sage-combinat @nthiery @anneschilling @bsalisbury1

Component: combinatorics

Keywords: crystals catalog

Author: Travis Scrimshaw

Branch: 0942e81

Reviewer: Nathann Cohen, Anne Schilling

Issue created by migration from https://trac.sagemath.org/ticket/15882

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 1, 2014

Commit: 56a29b8

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 1, 2014

Branch: public/combinat/crystals/catalog

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 1, 2014

comment:1

Starting to get there.


New commits:

3babe7fInitial setup.
629bb54Merge branch 'develop' into public/combinat/crystals/catalog
b353b82Merge branch 'develop' into public/combinat/crystals/catalog
acb0610Merge branch 'develop' into public/combinat/crystals/catalog
fa15648Merge branch 'develop' into public/combinat/crystals/catalog
7b79a42Renamed catalog files.
56a29b8Starting to deprecate from global namespace.

@nthiery
Copy link
Contributor

nthiery commented Mar 3, 2014

comment:2

Thanks Travis! I haven't checked the code yet, but this will be a nice improvement.

One thing I have been pondering for some time: at the end of the day, we can expect that there will eventually be exactly two entry points for crystals in the global name space, namely crystals and Crystals (indeed, once #10963 will be in, we will be able to deprecate FiniteCrystals() and friends in favor of Crystals().Finite()).

Would it make sense to push the logic even further and actually have a single entry point, which probably should be Crystals? In other words, could the category also play the role of catalog of implementations? Maybe something like Crystals.catalog.CrystalOfLetters(...) though this is a bit heavyweight.

Of course this question is not just about crystals, but could apply to groups, posets, ...

Anyway, just food for thought for after this ticket.

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 3, 2014

comment:3

How about we link them all to the category? For example, currently I do

sage: crystals.Tableaux(['A',2], shape=[2,1])

Instead we make this use the category:

sage: Crystals.Tableaux(['A',2], shape=[2,1])

We should be able to do

from sage.combinat.crystals.catalog import *

in the crystals category to do this. Although doing things this way, we could easily have things lost among the category methods. So I'm not convinced this is the best direction to go.

Also I'm somewhat of the opinion that categories should be grouped together as well via categories.Crystals and such and not be in the global namespace. Therefore leaving crystals.* as the only entry point. IDK, I'm okay with 2 entry points too...

@nthiery
Copy link
Contributor

nthiery commented Mar 3, 2014

comment:4

Replying to @tscrim:

How about we link them all to the category? For example, currently I do

sage: crystals.Tableaux(['A',2], shape=[2,1])

Instead we make this use the category:

sage: Crystals.Tableaux(['A',2], shape=[2,1])

We should be able to do

from sage.combinat.crystals.catalog import *

in the crystals category to do this. Although doing things this way,
we could easily have things lost among the category methods. So I'm
not convinced this is the best direction to go.

Agreed! This is why, in my attempted notation, I had put this in an
attribute Crystals.catalog. But it's not super convincing
either.

Also I'm somewhat of the opinion that categories should be grouped
together as well via categories.Crystals and such and not be in
the global namespace. Therefore leaving crystals.* as the only
entry point.

I agree that there definitely should be far less categories in the
global name space, and #10963 will help much in this
direction. However, for the well known ones like Sets, Fields, Groups,
Posets, Crystals, ... I find that the category is a natural entry
point to explore the functionalities implemented in Sage about a given
topic, because it has more semantic attached to it than with a mere
module like groups.

On a related matter, it would be a cool feature, when given a
category, to recover all parents in this category. E.g.:

    sage: affine_crystals = Crystals().Affine().implementations()
    sage: affine_crystals.K<tab>
    KirillovReshetikhinCrystal
    ...

Florent had implemented a proof-of-concept, recovering automatically
the information from a database build from the Sage TestSuite's. But
this would take some more work.

IDK, I'm okay with 2 entry points too...

That will certainly do for now :-)

Cheers,
Nicolas

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 17, 2014

Changed commit from 56a29b8 to a27f7fa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 17, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

6dc2259Deprecated CrystalOfSpins* and KyotoPathModel.
441a478Merge branch 'develop' into public/combinat/crystals/catalog
ed62d74Added deprecations for affine.py.
108e019Adds a deprecation option to lazy_import.
a484809Doctest fixes.
7c3558aMerge branch 'u/tscrim/14275' into public/combinat/crystals/catalog-15882
fbe3f6cAdded all remaining deprecations.
a27f7faMerge branch 'develop' into public/combinat/crystals/catalog-15882

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 17, 2014

Dependencies: #14275

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 17, 2014

comment:6

Using #14275 makes deprecating things from the global namespace so much easier.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

ee4789fEasier access to KR crystals and converted elementary_crystals.py and infinity_crystals.py.
a695b22Finished replacing deprecated public tests and did some pyflakes cleanup.
2167fedFixing documentation for highest_weight_crystals.py.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Changed commit from a27f7fa to 2167fed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

fa08cf3Used catalog in thematic tutorials and some additional cleanup/updating.
420cd33Fixed linking of :class:`...` in doc.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Changed commit from 2167fed to 420cd33

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 19, 2014

comment:10

Okay, now it should be ready.

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 20, 2014

comment:11

(being curious. I love catalogs)

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 20, 2014

comment:12

Hey man.

I felt a bit trap when I noticed, after having spent quite some time reading the diff, that the ticket did not only change what it claims....

Anyway.

I agree with everything I can understand (and "git diff --word-diff" really is useful for tickets like that), but there are five things that I cannot review:

  • The "model" changes to /src/sage/combinat/crystals/highest_weight_crystals.py

  • This change

-        if self.cartan_type().is_affine():
+        if not self.cartan_type().is_finite():
  • This one
-        return other.__lt__(self)
+        return self._list.__gt__(other._list)
  • The definition of KirillovReshetikhin in catalog.py (and I don't think that it is the right place to define it)

  • Same for RiggedConfigurations in catalog_kirillov_reshetikhin.py though the code is trivial>

I do not understand what it does, and though I thought I could review a ticket that implements a crystal catalogs, I can't review these parts.

Soooo well. You can either remove them and I can set this ticket to positive review, or someone else will do it.

There are broken doc links reported by sage -docbuild reference/combinat --warn-links html. And I also add a commit to your branch to fix a typo and a "double deprecation".

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 20, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

78489a6trac #15882: review (typos)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 20, 2014

Changed commit from 420cd33 to 78489a6

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 20, 2014

comment:14

Oh and I forgot something important : the new index of crystals must appear in the reference manual !

Nathann

@tscrim
Copy link
Collaborator Author

tscrim commented Mar 21, 2014

comment:15

Hey Nathann,

Replying to @nathanncohen:

I felt a bit trap when I noticed, after having spent quite some time reading the diff, that the ticket did not only change what it claims....

Well, there were things that I wanted to touch up while I was making sweeping changes.

I agree with everything I can understand (and "git diff --word-diff" really is useful for tickets like that), but there are five things that I cannot review:

  • The "model" changes to /src/sage/combinat/crystals/highest_weight_crystals.py

  • This change

-        if self.cartan_type().is_affine():
+        if not self.cartan_type().is_finite():

For reference: this is for better (future?) support for LS paths over other indefinite types (ex. hyperbolic).

  • This one
-        return other.__lt__(self)
+        return self._list.__gt__(other._list)

After some though, I felt it was better to revert this.

  • The definition of KirillovReshetikhin in catalog.py (and I don't think that it is the right place to define it)

This is the right place because it's just a function which redirects to the correct class (in different files). IMO it's stupid (and potentially confusing) to put it in kirillov_reshetikhin.py just to import it into the catalog.

  • Same for RiggedConfigurations in catalog_kirillov_reshetikhin.py though the code is trivial>

Here this should be here even more so because I want to reinforce that we only want to construct the rigged configurations of a single KR crystal (not as a tensor product thereof).

I do not understand what it does, and though I thought I could review a ticket that implements a crystal catalogs, I can't review these parts.

Thank you for your review thus far.

There are broken doc links reported by sage -docbuild reference/combinat --warn-links html. And I also add a commit to your branch to fix a typo and a "double deprecation".

I've done what I can about them.

Best,

Travis

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 21, 2014

Changed commit from 78489a6 to 968f9f6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 11, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

6402c54fixed some documentation issues

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 12, 2014

Changed commit from 6402c54 to a596cdd

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 12, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

482ca9cFixed last bad link.
a596cddMerge branch 'public/combinat/crystals/catalog' of trac.sagemath.org:sage into public/combinat/crystals/catalog-15882

@tscrim
Copy link
Collaborator Author

tscrim commented Apr 12, 2014

comment:45

Well, that was the only bad link I could find with an extensive grep campaign.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 13, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

698ae7esome small changes to the documentation

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 13, 2014

Changed commit from a596cdd to 698ae7e

@anneschilling
Copy link
Contributor

comment:47

Hi Travis,

I just pushed some small changes to the introduction. If you agree with them, please set a positive review on my behalf!

Anne

@tscrim
Copy link
Collaborator Author

tscrim commented Apr 13, 2014

comment:48

Looks good to me. Thanks Anne and Nathann for doing the review!

@vbraun
Copy link
Member

vbraun commented Apr 13, 2014

comment:49
sage -t --long src/sage/combinat/root_system/plot.py  # 1 doctest failed
sage -t --long src/sage/combinat/tableau.py  # 1 doctest failed
sage -t --long src/sage/combinat/root_system/cartan_type.py  # 2 doctests failed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 14, 2014

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

0942e81Fixed failing doctests.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 14, 2014

Changed commit from 698ae7e to 0942e81

@tscrim
Copy link
Collaborator Author

tscrim commented Apr 14, 2014

comment:51

Sorry about that.

@vbraun
Copy link
Member

vbraun commented Apr 14, 2014

Changed branch from public/combinat/crystals/catalog to 0942e81

@nthiery
Copy link
Contributor

nthiery commented May 9, 2014

comment:53

Hi!

Sorry, I haven't been been following up on this ticket, so that's probably too late. Anyway, just as a food for thought, I wanted to mention that I was surprised at first to have

    crystals.Letters

rather than

    crystals.CrystalOfLetters

The latter is nicer if you want to do from crystals import *. But maybe the point is that you don't want to do that and just always crystals...., and then it's less redundant.

Let's see how this is done in the other catalogs. Hmm, we have graphs.ChvatalGraph, but groups.permutation.Dihedral. Not super consistent ...

Cheers,
Nicolas

@nthiery
Copy link
Contributor

nthiery commented May 9, 2014

Changed commit from 0942e81 to none

@anneschilling
Copy link
Contributor

comment:54

Hi Nicolas,

We thought that

crystals.CrystalOfLetters

was redundant. Since it is pretty short, I think I/we will just use
crystals. ... in the future.

Anne

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 12, 2014

comment:55

Let's see how this is done in the other catalogs. Hmm, we have graphs.ChvatalGraph, but groups.permutation.Dihedral. Not super consistent ...

As always, it is better to make sense than to be consistent. The Graph thing is an error. We should .... deprecated those 100+ functions and remove the final "Graph" ?... Scary T_T

Nathann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants