-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
The behavior of the UniTensor methods bond and bonds seems inconsistent:
bond(idx) returns a copy of the bond
bond_(idx) returns a reference to the bond
bonds() returns references to the bonds
bonds_() does not exist
I was wondering if this is intended, and methods with return type vector always return a shared view. But this seems not generally true, e.g.:
UniTensor::labels() returns references
Tensor::shape() returns references, but
UniTensor::shape() returns cloned values
The shape should never be changed directly by the user anyway. But for methods such as bonds() and labels(), this matters. I would suggest defining the behavior and documenting it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels