forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-39160: Add _make_named_class_key for several categories, m…
…iscellaneous changes Fixes sagemath#39154 Let `C = Category.join([NumberFields(), QuotientFields(), MetricSpaces()])`, then there are 4 categories being created * `Modules(C)` * `VectorSpaces(C)` * `Modules(C).Filtered()` * `VectorSpaces(C).Filtered()` The last 2 have type `FilteredModulesCategory`, which inherit from `RegressiveCovariantConstructionCategory, Category_over_base_ring` which in turn inherits from `CategoryWithParameters`. Subclasses of `CategoryWithParameters` need to override `_make_named_class_key` correctly so that category A and B can only return same key if their parent class, element class, subcategory class etc. are identical. But `FilteredModulesCategory` takes `_make_named_class_key` from `Category_over_base_ring`, which returns the base category (`C`) for the key. With this change, the returned key is e.g. `Modules(C).parent_class` and `VectorSpaces(C).parent_class` respectively, which is different. Side note: by how things are implemented in SageMath, `Modules(C)` actually returns the same thing as `VectorSpaces(C)`. The above diagram is only for illustration purpose. Side note 2: `Modules(C).Filtered()` is currently a subcategory of `VectorSpaces(C)`… so the above is not a diamond, rather it's a linear chain. Also make `Modules(Fields())).Filtered()` ≤ `VectorSpaces(Fields())`, and a few other changes e.g. make `_test_category_graph` works for hom categories. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] 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#39160 Reported by: user202729 Reviewer(s): Tobias Diez
- Loading branch information
Showing
5 changed files
with
175 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters