Opened 13 months ago

Last modified 3 months ago

#29619 new enhancement

tensors should have a sparse iterator

Reported by: gh-mwageringel Owned by:
Priority: major Milestone: sage-9.4
Component: linear algebra Keywords:
Cc: egourgoulhon, gh-LBrunswic Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

As observed on this Ask SageMath question, it does not seem to be possible to iterate over the non-zero entries of a tensor. This is unfortunate because the entries are stored in a sparse format, in a dictionary.

Since a tensor might have symmetries, this is more involved than just iterating over the dictionary, but such an iterator would immediately be useful for the implementation of the display() method, for instance.

Change History (5)

comment:1 Changed 13 months ago by mkoeppe

  • Priority changed from minor to major

comment:2 Changed 13 months ago by egourgoulhon

Thanks for opening this ticket. I've added a link to it in the "Algebraic part" section of the meta-ticket #18528.

comment:3 Changed 9 months ago by mkoeppe

See also: #30309 - Unify free module elements API: methods dict, monomial_coefficients, etc.

comment:4 Changed 9 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:5 Changed 3 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

Note: See TracTickets for help on using tickets.