Skip to content

Replace manifold structures by inheritance #33168

Open
@tobiasdiez

Description

We remove the constructor argument structure and the private field _structure in the manifold class (and its subclasses). Instead, now inheritance is used to provide the information that originally were controlled by the structure. That is, the subclasses control now this data by either specifying it in the constructor (e.g. _name_modifer variable that be one of 'topological', 'differentiable', etc) or by overwriting methods (e.g. scalar_field_algebra).

Currently, the structure combines two aspects. Namely on one hand information that is in the definition of the manifold (e.g. if charts are real-valued) and on the other hand data that a manifold may carry in addition (e.g. Riemannian metric).
This leads to a bit of code duplication and potentially strange behavior.
For example, one can construct a topological manifold (using the TopologicalManifold constructor) that has the "structure" of a differentiable manifold. Another example is that one has different "structures" of Lorentzian and (pseudo-)Riemannian metrics, but in the end there is no intrinsic difference there except for the signature. In particular, these are all just differentiable manifolds at the core (and thus have the same algebra of smooth functions etc).

Based on the discussion in #33001.

Discussion points:

  • Currently, a complex manifold is displayed as "1-dimensional complex manifold M" if its differentiable and as "Complex 1-dimensional topological manifold M" if its only topological. I find this somewhat confusing. What do you think about "Complex 3-dimensional differentiable/topological manifold M"?
  • Should the display text be really "degenerate_metric manifold M" with underscore?

CC: @egourgoulhon @tscrim @mjungmath

Component: manifolds

Author: Tobias Diez

Branch/Commit: public/manifold/remove_structure @ 1231cc0

Issue created by migration from https://trac.sagemath.org/ticket/33168

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions