hi,
my silly idea of the day was to extract the diagonal of a rank2 square ITensor and build a new diagITensor with it - I wasn’t able to find a more clever way to do it than doing something like diag_itensor(array(diag(t)), indices)
, which works on CPU but not on GPU - I think this is something more general related with the diag_itensor function, ie. it seems that building a diagonal ITensor from a CUDA array is not working. I imagine this is not intended, or am I missing something? A MWE would be
using ITensors, CUDA
ii = (Index(3), Index(3))
v = [1,2,3.0+im]
d = diag_itensor(v,ii) # works as expected
# but
cud = diag_itensor(NDTensors.cu(v),ii)
#throws ERROR: MethodError: no method matching _indices(::Tuple{}, ::CuArray{ComplexF64, 1, CUDA.DeviceMemory})
thanks!