Skip to content

Immutable elements of FreeModuleTensor #30181

@mkoeppe

Description

@mkoeppe

Currently, elements of a FiniteRankFreeModule and its tensor modules are mutable and therefore cannot be hashed.

In analogy to sage.modules.FreeModuleElement and sage.matrix.Matrix, a method set_immutable() should be added.

In this ticket, we do this by creating a subclass ModuleElementWithMutability of ModuleElement. The existing classes Vector (and thus FreeModuleElement from sage.modules) and FreeModuleTensor (from sage.tensor) are changed to subclass it.

The methods from FreeModuleElement implementing mutability are moved to ModuleElementWithMutability and become available for FreeModuleTensor in this way. (The class Vector also gets them for free.)

CC: @egourgoulhon @tscrim @mjungmath

Component: linear algebra

Author: Matthias Koeppe

Branch/Commit: a2ee8be

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions