Skip to content

Mixed Forms: set_comp, comp #30272

@mjungmath

Description

@mjungmath

In the upcoming changes we want to allow mixed differential forms, among other things, being made immutable (see #30181, #30261).

However, the current implementation would not support that behavior properly, namely:

sage: M = Manifold(2, 'M')
sage: A = M.mixed_form()
sage: a = M.diff_form(2)
sage: A[2] = a
sage: A[2] is a
True

If A would be set immutable and a is not, this would contradict the behavior of an immutable element. Even if a would automatically be set immutable as soon as A had been set immutable, this might happen not on the behalf of the user.

I'd propose a similar approach as I had done in #30208 for bundle connections, and as it is already known for tensor fields, namely by introducing methods set_comp and comp (add_comp would not be necessary). Then each instance representing a homogeneous component is bound only to the mixed differential form.

As always, suggestions and opinions are welcome.

Depends on #31654
Depends on #30473

CC: @egourgoulhon @tscrim @mkoeppe

Component: manifolds

Author: Michael Jung

Branch/Commit: 91fc96f

Reviewer: Eric Gourgoulhon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions