Skip to content

Basis truncation (basis[:n]) is unimplemented, which makes AugmentedBasis slicing unusable #84

Description

@shinaoka

FiniteTempBasis.__getitem__ raises
NotImplementedError("Basis truncation not yet implemented in C API").

Two call sites depend on it and are therefore dead:

  • AugmentedBasis.__getitem__ (src/sparse_ir/augment.py) builds
    AugmentedBasis(self._basis[:stop - self._naug], ...).
  • _AugmentedFunction.__getitem__ slices self._fbasis[:stop - self._naug].

While fixing the audit findings, both of these were repaired to the extent
possible at this layer: they called a nonexistent basis._slice_to_size(...)
and raised AttributeError before ever reaching the truncation, and now use a
local _slice_to_size(index, size) helper that range-checks the slice and
raises IndexError/ValueError with a clear message. Slicing an augmented
basis still ends in NotImplementedError from the underlying
FiniteTempBasis, which is the honest outcome until truncation exists.

This issue tracks implementing truncation once the C API supports
constructing a basis limited to the n most significant singular values
(may need a corresponding entry point tracked on SpM-lab/sparse-ir-rs).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions