ITensor / NDTensors.jl

A Julia package for n-dimensional sparse tensors.
Apache License 2.0
27 stars 7 forks source link

Use new `setstorage` and `setdata` to decrease code duplication across storage types #74

Open mtfishman opened 3 years ago

mtfishman commented 3 years ago

New generic functions setstorage and setdata were introduced in #72. These can be used to decrease code duplication across storage types. Here is a running list of examples where they could be used:

emstoudenmire commented 3 years ago

Good point. I just implemented the scalar multiplication case as a generic TensorStorage routine across all data types in PR #72. The case of similar may be a bit more complicated because there are two subtypes of DiagBlockSparse which handle the similar operation differently, so I didn’t want to rush through that one for #72.