Hi folks,
I think I just missed it in the docs, but I do not see an easy way to do "fancy" indexing in ITensor. Lets us consider the following example
i = Index(10,"i")
j = Index(20,"j")
k = Index(30,"k")
A = randomITensor(i,j,k)
U,Σ,V = svd(A,(i,j));
u = commonind(U,Σ)
# Now I would like to select all rows where Σ is larger than 15
cn = (Σ.store .> 15)
dim_cn = sum(cn)
c = Index(dim_cn,"c")
selector = zeros(dim_cn,dim(u))
selector[:,cn].= I(dim_cn)
selector = ITensor(selector,c,u)
U_new = selector * U
You see what is my goal: I would like to select specific rows of U. With standard Julia syntax I could just use
U_new = U[:,Σ.> 15]
Thanks a lot.
Best,
v.