[WIP] Rename the named-array types to an AbstractITensor{DimName} hierarchy#164
Draft
mtfishman wants to merge 3 commits into
Draft
[WIP] Rename the named-array types to an AbstractITensor{DimName} hierarchy#164mtfishman wants to merge 3 commits into
mtfishman wants to merge 3 commits into
Conversation
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 Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the absorbed named-array types to the ITensor hierarchy:
AbstractNamedDimsArraybecomesAbstractITensor,NamedDimsArraybecomesITensor,AbstractNamedDimsOperatorbecomesAbstractITensorOperator, andNamedDimsOperatorbecomesITensorOperator. The source files are renamed to match.AbstractITensoris now parameterized only by its dimension-name type:AbstractITensor{DimName} <: AbstractArray{Any, Any}.ITensorstores its parent as anAbstractArrayfield and its names as aVector{DimName}, so element type, rank, and parent array type are erased from the signature. A value still carries them, sondims,denamedtype, andparenttypereturn the concrete answer for an instance and the erased one for the type.dimnametypereturns the dimension-name type, and the unparameterizedITensorreturnsAny, mirroringeltype(Array).The
AbstractArraysupertype is kept for now so existing array machinery keeps working, and will be dropped in a follow-up.Indexstays its own type. TheLittleSetdimension-name accessor is unchanged:dimnamesstill returns aLittleSetover aTuple, with the underlyingVector{DimName}storage as an implementation detail.TODO