Skip to content

[WIP] Rename the named-array types to an AbstractITensor{DimName} hierarchy#164

Draft
mtfishman wants to merge 3 commits into
mainfrom
mf/rename-itensor-hierarchy
Draft

[WIP] Rename the named-array types to an AbstractITensor{DimName} hierarchy#164
mtfishman wants to merge 3 commits into
mainfrom
mf/rename-itensor-hierarchy

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Renames the absorbed named-array types to the ITensor hierarchy: AbstractNamedDimsArray becomes AbstractITensor, NamedDimsArray becomes ITensor, AbstractNamedDimsOperator becomes AbstractITensorOperator, and NamedDimsOperator becomes ITensorOperator. The source files are renamed to match.

AbstractITensor is now parameterized only by its dimension-name type: AbstractITensor{DimName} <: AbstractArray{Any, Any}. ITensor stores its parent as an AbstractArray field and its names as a Vector{DimName}, so element type, rank, and parent array type are erased from the signature. A value still carries them, so ndims, denamedtype, and parenttype return the concrete answer for an instance and the erased one for the type. dimnametype returns the dimension-name type, and the unparameterized ITensor returns Any, mirroring eltype(Array).

The AbstractArray supertype is kept for now so existing array machinery keeps working, and will be dropped in a follow-up. Index stays its own type. The LittleSet dimension-name accessor is unchanged: dimnames still returns a LittleSet over a Tuple, with the underlying Vector{DimName} storage as an implementation detail.

TODO

  • Final review before marking ready

Renames the absorbed named-array types: AbstractNamedDimsArray to
AbstractITensor, NamedDimsArray to ITensor, AbstractNamedDimsOperator to
AbstractITensorOperator, and NamedDimsOperator to ITensorOperator.

AbstractITensor is now parameterized only by its dimension-name type, with
element type and rank erased from the signature.
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.33809% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.12%. Comparing base (b1a7e91) to head (3ca5ba7).

Files with missing lines Patch % Lines
src/abstractitensor.jl 74.42% 100 Missing ⚠️
src/itensoroperator.jl 70.00% 9 Missing ⚠️
src/tensoralgebra.jl 83.33% 5 Missing ⚠️
src/broadcast.jl 63.63% 4 Missing ⚠️
src/itensor.jl 73.33% 4 Missing ⚠️
...sorBaseBlockArraysExt/ITensorBaseBlockArraysExt.jl 57.14% 3 Missing ⚠️
...t/ITensorBaseMooncakeExt/ITensorBaseMooncakeExt.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   73.20%   70.12%   -3.09%     
==========================================
  Files          23       21       -2     
  Lines        1168     1148      -20     
==========================================
- Hits          855      805      -50     
- Misses        313      343      +30     
Flag Coverage Δ
docs 23.74% <21.44%> (-0.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Renames abstractnameddimsarray.jl to abstractitensor.jl, nameddimsarray.jl
to itensor.jl, and nameddimsoperator.jl to itensoroperator.jl, and updates
the includes accordingly.
The parent array type is erased from ITensor's signature, so denamedtype
and parenttype on the type return AbstractArray. An instance still carries
the parent, so the instance methods return its concrete type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant