Skip to content

CombinatorialFreeModule.is_ambient, add element methods items and nonzero_positions #34511

@mkoeppe

Description

@mkoeppe

FreeModule (from sage.modules) has a method is_ambient for distinguishing ambient modules from submodules.

We make this method available for CombinatorialFreeModule too via ModulesWithBasis.

Add a method items, with the same semantics as for sparse vectors from sage.modules, and matrices and tensor components after #29619. If self is a submodule, they refer to the ambient module (see #34455).
Likewise nonzero_positions, which gives the indices only.

For ambient modules, dict, items, and monomial_coefficients give the same result, and support and nonzero_positions are the same. We enforce this with a _test_... method.

CC: @tscrim

Component: linear algebra

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

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