qr and ql implementations in NDTensors

Hello everyone, I’m trying to come up with a way to change the function orthogonalize! to use an in-place function for the factorization. I’ve implemented a version that works, by benchmark it doesn’t save much time, but it requires less allocations and memory. Before submitting a final version I wanted to better understand the utility of the Expose package and how to use it.

Hello Vincenzo,

Can you link the PR and I can look at the code. The Expose package is designed to help with multiple dispatch on the ITensor stored datatype. So if your function is launched on ITensor or NDTensor.Tensor or AbstractArray you will most likely need to use Expose if the function is dispatched on Base.Array then it should be fine.
Why we need expose is because of wrapped types in Julia. A wrapper type can, in a sense, lose information about the type it is wrapping. Particularly, wrapper types are assumed act like Base.Array however, this can cause issues when the wrapper wraps other array types like GPU based arrays.
All the best,
Karl