Fusion of indeces

Hello,
I’m writing my own MPS and MPO DMRG code, but based on ITensors core features.
I have the following question:
Suppose I have a qn-conserving tensor t of order 8:

t=mpo.W[1]*mpo.W[2]*mpo.W[3]*mpo.W[4]; # somehow obtained tensor t
 Hinds= inds(t) # i'm getting here indeces of t 
 Linds = (Hinds[1],Hinds[3],Hinds[5],Hinds[7]) # forming Left and Right set of indeces 
Rinds = (Hinds[2],Hinds[4],Hinds[6],Hinds[8]) # to convert it to a matrix
D, U = eigen(t, Linds, Rinds)  # doing full diagonalization of the resulted matrix

I would like to have only a matrix on a given sector, and get only the Ground State in that sector. For this, I need to fuse indeces and get direct access to a matrix representation; Is it possible to do that with ITensor? I could not find any relevant feature in the documention page.
EDITED:
I see that the combiner object can do that.

Thank you,

Best regards,

Murod

1 Like

Hi Murod,
I see you just edited your question to give the answer, but for others reading, here is a code example about the “combiner” ITensor which does what you are asking about:

https://itensor.github.io/ITensors.jl/dev/examples/ITensor.html#Combining-Multiple-Indices-into-One-Index

2 Likes

Hi, Miles,

Thank you for your respond.

Another question has emerged: How effectively get subsector matrix with a given QN? I know that I can get using direct indeces T[[a:b],[g:f]] for example, where ‘a’,‘b’,‘g’,‘f’ are boundary indeces of the given sector. But, how to get these indeces if I only know the QN?

Best regards,
Murod

Hi Murod, if you still have this question, could you please post it as a new topic, since it’s a rather different question from the first one above? Thanks –