-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
Invoke manifolds with structure more conveniently #33001
Comments
comment:1
-1 on adding classes such as |
comment:2
Alright, I see. That makes sense. What about something like |
comment:3
I'd rather suggest to look into having certain keyword arguments trigger a choice of structure.
Instead, this could perhaps imply
Instead, this should probably select It would also be good if users could pass a
This is something that we should extend along the way. |
comment:4
I agree with Matthias. I would not be opposed to |
comment:5
I agree. The categorical approach is the most natural one. I think we should get rid of the structure implementation as it is right now and entirely jump over to categories. This would also have the great advantage that we can combine structures such as symplectic and Riemannian structures, which are not mutually exclusive. Also this default behavior on extra parameters is a good idea. |
comment:6
I am fairly -1 on pushing the full structure into the categories. This was a very conscious design decision in full view of what could be done with categories.
It is meant to work in conjunction with the categories. |
comment:7
Replying to @tscrim:
Can you elaborate on 1, please? As for 2, do you have an example where the structure design makes things easier opposed to categories? I see the point in 3. Nevertheless, we should rethink the design in some way. We have Riemannian manifolds, which are represented by the class |
comment:8
Replying to @mjungmath:
If you have a manifold
You want information preserved for manifolds over
Don't conflate structures and base classes. They are different and serve different roles. Don't try and force a square peg into a round hole. Right now there is not a combinatorial explosion of cases, so we don't need to use a backhoe when all we need is a shovel either. If you need a combined structure, then make a combined structure. |
comment:9
Replying to @tscrim:
Why can't you just swap the category accordingly? As far as I see it, this is the same concept.
That's a good argument. I think, though, this can easily be circumvented by using a category base class that is not build upon a "base ring" structure.
Well, that is my point. Base classes and structures are different, and yet we have a Riemannian manifold base class and structure. Though I'd prefer categories; if we stay with the structure design, I'd feel more comfortable if we'd implement joins of structures. This is far more flexible and robust for future structures. It's getting harder to change the architecture when the "combinatorial explosion of cases" is already too high. |
comment:10
Replying to @mjungmath:
Because categories are strongly tied to the creation of the object (and its elements) as it creates a dynamic subclass. In fact, strictly speaking, the differentiable structure of a manifold can give different objects in the category of differentiable manifolds (although we have actually pushed this data into the manifold itself).
Categories carry mathematical information. You cannot separate the base ring.
You cannot get around having a base class when you want extra methods, at least without a performance penalty or monkey-patching. However, it can have a range of structures attached to it.
That is a fallacy as good OOP design means you do not care about how the backend is implemented. This sounds like the engineer's paradox: spend 30% more time making something 10% faster. |
comment:11
My remark originally was that I find I cannot really contribute to the category vs structure discussion as I'm not familiar enough with the category framework. (If someone wants to enlighten me: what are the practical consequences of viewing |
Commit: |
Author: Matthias Koeppe |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
Replying to @tobiasdiez:
Done |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:20
Replying to @tobiasdiez:
I am very strong -1 on adding a bunch of things that pollute the global namespace when there is a generic concept (here a "manifold") and a global entry point. Not only does it create more imports at startup (even if done lazily, it still means more objects), more maintenance if names change, and more documentation fragmentation (it makes it much easier to decide where to put, e.g., construction information). (If you find it easier, then you can add it to your |
comment:21
The dispatching based on |
comment:22
Replying to @tscrim:
I fully agree with all the above points. |
comment:23
Replying to @tscrim:
Fair enough!
I agree with the submanifold part, but why is it not possible to decide about the structure? It seems to me that the structure of a topological manifold is completely determined by the base field (and similarly for diff manifolds). One could probably even remove the structure constructor argument of |
This comment has been minimized.
This comment has been minimized.
Reviewer: Travis Scrimshaw |
comment:26
LGTM. |
comment:27
Thanks! |
Changed branch from u/mkoeppe/invoke_manifolds_with_structure_more_conveniently to |
Inspired by the discussion in #30362, comment:77, we change the
Manifold
constructor so that once can omit thestructure
parameter when parameters such asdiff_degree
ormetric_name
are given:CC: @egourgoulhon @tscrim @tobiasdiez
Component: manifolds
Author: Matthias Koeppe
Branch/Commit:
9548b50
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33001
The text was updated successfully, but these errors were encountered: