Skip to content

Refactor Components into parent & element #30307

@mkoeppe

Description

@mkoeppe

Currently every Components object has lots of metadata attributes in addition to the actual data dictionary in ._comp.

If one has many different Components objects with the same symmetry metadata, we can reduce storage space as follows.

We create new classes CompParent, CompParentWithSym, ..., which
store the symmetry attributes and become UniqueRepresentation. We make Components objects elements of these parents.

The parents will also have index iterator methods.

Data associated with symmetries and dimensions, computed currently each time for each CompWithSym object in methods such as __init__, __add__, trace, ... can be precomputed and cached in the parent using @cached_method in the parent class).

This will make the code in #30229 (subspaces of tensor with symmetries) more elegant because it no longer needs a dummy Components object to represent the symmetry but rather a CompParent object.

See also:

Depends on #31904
Depends on #29619

CC: @mjungmath @egourgoulhon @tscrim @honglizhaobob

Component: linear algebra

Author: Michael Jung, Matthias Koeppe

Branch/Commit: public/30307 @ e5a81f2

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

Metadata

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