Skip to content

Slicing should have correct rowrank set #331

Description

@manuschneider

At the moment, slicing a UniTensor returns a UniTensor with rowrank=0.
I would suggest that all remaining indices in the rowspace/columnspace should remain in the corresponding space.
Example:

uT=cytnx.UniTensor.zeros([2,3,4], name="uT", labels=["a", "b", "c"])
uT.set_rowrank_(2)
slice1 = uT[:,:,0:2]
slice2 = uT[0,:,0:2]
print(uT.rowrank())     # 2
print(slice1.rowrank()) # 0, I would suggest it should be 2
print(slice2.rowrank()) # 0, I would suggest it should be 1 because one dimension was removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Low priorityAn issue which is not urgentgood first issueGood for newcomerssuggestionSuggestion for current codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions