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
Fully-commutative stable Grothendieck crystal #30461
Comments
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Samll remarks. Avoid having only TESTS:: in any non-underscored method, because the doc will be empty. This
could be
which is faster.
should be
could be
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:18
Looks good. Thank you for this addition. Some additional comments to Frédéric's:
You could have In the Do you really expect this:
It seems like it would be mostly useless. It would be good to avoid going through the coercion framework and element constructor and just directly create the element: -self.parent()(s)
+P = self.parent()
+P.element_class(P, s) This is good for speed. Error messages should start with a lowercase: -raise ValueError("Each nonempty factor should be a strictly decreasing sequence")
+raise ValueError("each nonempty factor should be a strictly decreasing sequence") This is a Python convention that we try to follow. You don't need the list here (I think it is actually slightly slower): -m = max([cell[0] for cell in cells])+1
+m = max(cell[0] for cell in cells) + 1 (and in similar other places). -for i in range(m)[::-1]:
+for i in range(m-1,-1,-1): I believe you can do this:
to avoid the transient parent (and some extra unnecessary containment checks). -if m == None or (len(_jumps(w))<=m-1):
+if m is None or len(_jumps(w)) <= m-1: I think it would be good to avoid creating the tableau and then its conjugate in T = Tableau(L)
return T.conjugate().is_semistandard() I would just go through and check everything directly in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
This can be simplified: - for i in range(len(L)-1):
- for j in range(len(L[i+1])):
- if L[i+1][j]<L[i][j]:
- return False
- return True
+ return not any(L[i+1][j] < L[i][j] for i in range(len(L)-1)
+ for j in range(len(L[i+1]))) or + return all(L[i+1][j] >= L[i][j] for i in range(len(L)-1)
+ for j in range(len(L[i+1]))) (Interestingly enough the latter is actually faster.) |
comment:22
Thanks a lot for looking through the code, Travis. Appreciate the suggestions on syntax, speedups, SageMath-specific infrastructure, etc. Replying to @tscrim:
Thank you for the suggestions. I used the following guide for
It was to have the
No, so this has been removed. |
comment:23
Replying to @sagetrac-wpoh:
Thank you for your changes.
Looks good. Thanks. Can you add a test showing that the
That is a good point; I forgot about the singletons. For the I have a few more additional comments: -return tuple(len(l) for l in self.value)[::-1]
+return tuple([len(l) for l in reversed(self.value)]) Yes, having the list here is strangely faster. -if len(factor)>0:
+if factor: Instead of using both This is strange to me:
Why inherit from both? Why not just wrap the |
comment:25
Thank you for the further comments. I've pushed all the changes according to the previous suggestions, except for the one on the Replying to @tscrim:
I've added a test in the
Both remarks make sense. The code looks better now.
The code was more or less adopted from I am not so familiar with the difference between
and making minor changes in
|
comment:26
Replying to @sagetrac-wpoh:
Thank you.
Without seeing what your code is, I cannot comment. You can look at the Actually, I am starting to wonder a bit why you need the separate class. If it inherits from Some little nitpicks with style (it wouldn't stop a positive review, but it is good to follow): - k, D = max(w), {}
+ k = max(w)
+ D = {} -if all(len(L[i])>=len(L[i+1]) for i in range(len(L)-1)):
+if all(len(L[i]) >= len(L[i+1]) for i in range(len(L)-1)): -if p==r and q!=p and abs(p-q)==1:
+if p == r and q != p and abs(p-q) == 1: -t = _apply_relations(v,position,move)
+t = _apply_relations(v, position, move) and similar. More micro-optimizations: For def _applicable_relations(word):
"""
Return all positions where a relation can be applied on ``word``
along with the type of relation.
"""
L = []
for i in range(len(word)-2):
p, q, r = word[i:(i+2)+1]
if abs(p-q) > 1:
L += [[i,"pq=qp"]]
elif abs(p-q) == 1:
if p == r: # p != q by the abs test
L += [[i,"pqp=qpq"]]
elif r != p: # We must have p == q
L += [[i,"ppq=pqq"]]
if q == r and r != p:
L += [[i,"pqq=ppq"]]
if abs(word[-2]-word[-1]) > 1:
L += [[len(word)-2,"pq=qp"]]
return L The first is removing the unless if statements and pulling the last case outside of the loop. The second is removing redundant checks for the different relations. I think this can be simplified: -w[J[i]:J[i+1]][::-1]
+w[J[i+1]-1:J[i]-1:-1] In Your doc is not building because you need to make this change: -Remove all bracketed letters between `i`th and `(i+1)`th entry.
+Remove all bracketed letters between `i`-th and `(i+1)`-th entry. |
comment:28
Thanks again for the further comments. I have pushed all the changes according to the suggestions. Replying to @tscrim:
There are decreasing factorizations associated to non-fully commutative permutations, so I was hesitant to put it directly in the Also, I need
You're right that they were there mainly for debugging. I've removed the error handling. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:30
Replying to @sagetrac-wpoh:
Making this into a separate
I don't see any reason why you should need this. It seems like you are fighting code that is trying to tell you to make it more simple. Have I missed something? |
comment:31
Replying to @tscrim:
Sorry for the slow response. I could not compile Sage for a while due to Xcode12. We need this for the insertion algorithm implemented in #30460 unless the insertion takes as input crystal elements rather than decreasing factorizations. |
comment:32
Replying to @anneschilling:
I don't see why the insertion could not take the crystal elements. So it still feels a little over-engineered, but it is good enough for now as the element class hierarchy doesn't have any duplication. |
Reviewer: Travis Scrimshaw |
comment:33
Thank you for the review, Travis! |
comment:34
Replying to @anneschilling:
No problem. Sorry it took a little longer for me to get to it. I will be on the lookout for when #30460 is ready. |
Changed branch from public/combinat/fc_stable_Grothendieck_crystal-30461 to |
Implementation of the crystal on fully-commutative decreasing factorizations in the 0-Hecke monoid. See https://arxiv.org/abs/1911.08732.
CC: @anneschilling @sagetrac-jppan @tscrim
Component: combinatorics
Keywords: crystal
Author: Jianping Pan, Wencin Poh, Anne Schilling
Branch/Commit:
d6bfcd2
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/30461
The text was updated successfully, but these errors were encountered: