Skip to content

Rename TensorDynLen to IdxTensor for ITensor compatibility #374

@shinaoka

Description

@shinaoka

Motivation

TensorDynLen is the core tensor type in tensor4all-rs, analogous to ITensor's ITensor type. The current name describes implementation details (dynamic-length indices) rather than what the type conceptually represents. To improve discoverability and emphasize compatibility with the ITensor ecosystem, we should rename it to IdxTensor — a name that highlights the index-based tensor semantics shared with ITensor.

Proposal

  1. Rename pub struct TensorDynLenpub struct IdxTensor in crates/tensor4all-core/src/defaults/tensordynlen.rs
  2. Keep pub type TensorDynLen = IdxTensor; as a deprecated type alias for backward compatibility during the transition
  3. Update all internal usage (library code, tests, examples, docs) to use IdxTensor
  4. Update C API and language bindings as needed

Scope

  • 152 files, ~1926 occurrences of TensorDynLen across the workspace
  • Struct definition: crates/tensor4all-core/src/defaults/tensordynlen.rs
  • Re-exported from crates/tensor4all-core/src/lib.rs

Notes

  • Since the project is in early development with no backward compatibility guarantees, the alias is mainly for a smooth transition period and can be removed later.
  • Consider also renaming the source file from tensordynlen.rs to idx_tensor.rs.

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