Improvements to the construction of subalgebras#41602
Improvements to the construction of subalgebras#41602vbraun merged 5 commits intosagemath:developfrom
Conversation
|
Tangential, but it would be nice to have the |
|
@orlitzky Good point, done. |
|
I refactored it slightly so that ideals can also use the same implementation (grow and expand only using the newly discovered elements). |
|
Documentation preview for this PR (built with commit 873c6bc; changes) is ready! 🎉 |
|
@orlitzky @fchapoton Can one of you review this fully? This gets quite a good speedup on this construction. |
|
I'm not that familiar with I'd also like to check that both ideal algorithms work in all cases by tweaking the default |
|
I tried setting both generators and basis as the default algorithm and it didn't hurt the CI. One more idea though. In the ideal example, you could add an extra test to ensure that both algorithms return the same submodule (they should, right?). For example: |
4e581fe to
77ddb5f
Compare
|
Thank you. I've added the doctest and some others to demonstrate the correct properties. I had to work around an issue with the submodule |
|
OK, I'm convinced, thanks. |
|
Thank you! |
sagemathgh-41602: Improvements to the construction of subalgebras <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This speeds up the construction of subalgebras by only applying generators to newly created elements (i.e., not in the span of the previous iteration). We also take into account the basis order (which also works for things that are indexed by objects that do not have natural comparisons). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41602 Reported by: Travis Scrimshaw Reviewer(s):
sagemathgh-41602: Improvements to the construction of subalgebras <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This speeds up the construction of subalgebras by only applying generators to newly created elements (i.e., not in the span of the previous iteration). We also take into account the basis order (which also works for things that are indexed by objects that do not have natural comparisons). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41602 Reported by: Travis Scrimshaw Reviewer(s):
sagemathgh-41602: Improvements to the construction of subalgebras <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This speeds up the construction of subalgebras by only applying generators to newly created elements (i.e., not in the span of the previous iteration). We also take into account the basis order (which also works for things that are indexed by objects that do not have natural comparisons). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41602 Reported by: Travis Scrimshaw Reviewer(s):
sagemathgh-41602: Improvements to the construction of subalgebras <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This speeds up the construction of subalgebras by only applying generators to newly created elements (i.e., not in the span of the previous iteration). We also take into account the basis order (which also works for things that are indexed by objects that do not have natural comparisons). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41602 Reported by: Travis Scrimshaw Reviewer(s):
This speeds up the construction of subalgebras by only applying generators to newly created elements (i.e., not in the span of the previous iteration). We also take into account the basis order (which also works for things that are indexed by objects that do not have natural comparisons).
📝 Checklist
⌛ Dependencies