-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Add category FreeModules (without distinguished basis) #30164
Comments
comment:1
I am not sure I agree with having this category. I don't see the use case why we would need this category as there are basically only one concrete implementation: an n-dimensional free module. It is not until you start selecting and manipulating bases that you start having the possibility for different concrete implementations. At least, I see better ways of doing this rather than a new category that I don't foresee having much room to expand. |
comment:2
Perhaps, in fact, this category should define (as an abstract method) the method |
comment:3
My thought is that would be better left to the concrete implementation. It almost seems like you are proposing lifting the entire concrete implementation of |
comment:4
Replying to @tscrim:
There is certainly a subtle line that separates expectations for a category's parent/element methods from those for abstract base classes. I would think that user-facing methods that expose a mathematical concept/theorem do belong to the category. Concretely, an implementation detail certainly is how a basis is designated or represented. However, we can focus on the theorem that in a free module we can choose a basis and that therefore there exists a free module isomorphism with a free module with the same base ring and rank. And this is exactly what is expressed by the method I would generalize the method from #30094, The category's parent method would use the compatible signature |
comment:5
Replying to @mkoeppe:
The maintenance aspect with categories is something that I worry a bit more about. I have gotten a lot of questions asking how the category framework works with its black magic. Most of the times I point to a concrete implementation and the key methods someone needs to implement. Additionally, abstracting free modules will not lead to a combinatorial explosion of classes involving different combinations of axioms (which is the main reason why we have this framework). We see this with
The difference with
This feels more like code bloat to me right now. At least, I cannot think of a definitive use-case for this over having a common ABC. |
comment:6
Replying to @tscrim:
In case it did not become clear, in my proposal I do NOT define a semantic for |
comment:7
Replying to @tscrim:
Could you elaborate on the maintenance aspect? This sounds to me just like a documentation problem. Would it not just suffice to add some comments to an implementation class what methods are already provided by the required category?
I have noticed that, but the problem is that we have multiple incomplete and incompatible implementations of linear algebra.
My immediate application is #30198. |
comment:8
Replying to @mkoeppe:
For someone who doesn't know the code, if you look at an object
Not all of the features should necessarily be compatible because they are designed for different purposes. Sometimes these unaoidaby require specific implementation details. That being said, there are definitely missing features that could be lifted to an ABC, which can easily handle the generality you want. Categories are heavier objects than ABCs, which are still effective at modeling the mathematics. There are more assumptions and a bigger ecosystem to worry about. For instance, you have to make sure that you cannot have a category for
I feel like this method needs to handle a basis parameter. If you use a
Why would you want a category over an ABC? |
comment:9
Thanks a lot for your explanations. |
comment:10
Replying to @tscrim:
I think you're missing that I want the category (or, if you will, ABC) to provide the abstract method so that the protocol is specified, but not provide an implementation. Thus no methods |
comment:11
In a slightly different direction: I think it should also be clarified what exactly the category |
comment:13
Your proposed method |
comment:15
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
From
sage.tensor.modules.finite_rank_free_module
:Also we can define a functor from
FreeModules(R)
toFreeModulesWithBasis(R)
, which picks a basis (either arbitrary or optionally a parameter of the functor) for every module. This is a section of the forgetful functor fromFreeModulesWithBasis(R)
toFreeModules(R)
.CC: @tscrim @egourgoulhon @mjungmath
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/30164
The text was updated successfully, but these errors were encountered: