Cytnx icon indicating copy to clipboard operation
Cytnx copied to clipboard

return_err for Svd_truncate

Open pcchen opened this issue 1 year ago • 1 comments

Currently, when the input of cytnx.linalg.Svd_truncate() is a UniTensor and return_err=True, it will return return_err as a UniTensor.

I think we should just return return_err as a scalar.

pcchen avatar Feb 24 '24 12:02 pcchen

This problem caused from the constrain of C++. C++ can only one type variable like:

std::vector<cytnx::UniTensor> Svd_truncate(...) {
...
}

not like python can return several type:

svds, error = Svd_truncate(...)

Since the library use pybind so we just put the error info in the UniTesnor.

hunghaoti avatar Feb 25 '24 03:02 hunghaoti