# Fusion of indeces

**URL:** <https://itensor.discourse.group/t/fusion-of-indeces/984>\
**Category:** ITensor Julia Questions\
**Tags:** julia\
**Created:** [June 28, 2023, 12:43pm UTC](https://itensor.discourse.group/t/fusion-of-indeces/984 "2023-06-28T12:43:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mozhik](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mozhik](https://itensor.discourse.group/u/mozhik)\
**Post date:** [June 28, 2023, 12:43pm UTC](https://itensor.discourse.group/t/fusion-of-indeces/984/1 "2023-06-28T12:43:58Z")

</div>

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:

```julia
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

---

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [June 28, 2023, 1:12pm UTC](https://itensor.discourse.group/t/fusion-of-indeces/984/2 "2023-06-28T13:12:58Z")

</div>

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](https://itensor.github.io/ITensors.jl/dev/examples/ITensor.html#Combining-Multiple-Indices-into-One-Index)

---

<div class="post-metadata">

**Author:** ![mozhik](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mozhik](https://itensor.discourse.group/u/mozhik)\
**Post date:** [June 28, 2023, 1:18pm UTC](https://itensor.discourse.group/t/fusion-of-indeces/984/3 "2023-06-28T13:18:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [July 1, 2023, 7:30pm UTC](https://itensor.discourse.group/t/fusion-of-indeces/984/4 "2023-07-01T19:30:02Z")

</div>

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 –
