-
Notifications
You must be signed in to change notification settings - Fork 230
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
New Permutations package #3393
base: development
Are you sure you want to change the base?
New Permutations package #3393
Conversation
Permutations
|
Permutations revisions
I should also mention that this package includes code for pattern avoidance and is taken directly from the |
-- avoidsPatterns | ||
doc /// | ||
Key | ||
avoidsPatterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under SeeAlso
, you can link to "MatrixSchubert::avoidsAllPatterns"
and "MatrixSchubert::isPatternAvoiding"
.
new Permutation from VisibleList := (typeofPermutation,w) -> w | ||
|
||
permutation = method() | ||
permutation List := Permutation => w -> new Permutation from w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, I think it would be reasonable to move permutations
, inversePermutation
, and (possibly?) uniquePermutations
into this package (along with their tests and documentation), and comment that they were moved from Core. This may break some tests in other packages, in which case we will add this package as their dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this make sense and I'll look into it.
to1Index := w -> (w / (i -> i+1)) | ||
to0Index := w -> (w / (i -> i-1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I'm curious if there was a problem with my suggestion about prepending 0 to switch to 0-index: #2581 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problems, just those helper functions seemed like the most obvious thing to do at the time I had written the bulk of this code (December 2023).
One incompatibility with the built-in permutations is that they start at 0, not 1. |
Yes, although MatrixSchubert is also 1-indexed. I realize I'm not the main audience of this, so I don't have a strong opinion. Would it be much harder to check whether a permutation is 0 or 1 indexed in every algorithm? Or maybe have easy to use functions for going forth and back? |
I think a good solution would be some sort of configuration option when loading the package. So, it defaults to |
Recently I was using permutations (though not through this package) and I thought of a few wish list items, if you have time to implement them:
I'm happy to merge this with the 1-based notation if at least item 1 above is implemented. |
New package implementing a
Permutation
type by Sean Grate. Its intent is to have a standard and consistent type for permutations as more combinatorics-focused packages get added to Macaulay2. Much of the inspiration for the implemented methods came from the Sage implementation. This also resolves Issue #2581.