# DMRG for a two leg ladder model

**URL:** <https://itensor.discourse.group/t/dmrg-for-a-two-leg-ladder-model/379>\
**Category:** DMRG and Numerical Methods\
**Created:** [September 7, 2022, 3:01pm UTC](https://itensor.discourse.group/t/dmrg-for-a-two-leg-ladder-model/379 "2022-09-07T15:01:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paban.patra](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@paban.patra](https://itensor.discourse.group/u/paban.patra)\
**Post date:** [September 7, 2022, 3:01pm UTC](https://itensor.discourse.group/t/dmrg-for-a-two-leg-ladder-model/379/1 "2022-09-07T15:01:08Z")

</div>

Hi,

I am using ITensor Julia to calculate the ground state of a two-leg ladder model by DMRG. while doing it I first kept fewer bond dimensions( that I know previously from reference) to found the ground state, and whatever state (psi) I got from it I keep it as an initial state for the next program with more bond dimensions to prove ground state energy is converging. But I am facing some errors while doing it. so my questions are as follows

a)  
 ![Screenshot from 2022-09-07 20-08-12](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/5f65f5df0e6fd8db43f02e12be44e175ed768b55.png)

Where new2 is a file where I stored ground state(psi) and keep the same state in dmrg function to find a new state, but I got an error as follows.

![Screenshot from 2022-09-07 20-20-45](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/7a371b29c49fc7aa142821657c974add6b031b69.png)

So, can you tell me how to fix it?

b) I think (please correct me if I am wrong) the dmrg code is available in the documentation is of two sites Dmrg method, is there any way we can customize it into the one-site?

Thanks

Paban

---

<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:** [September 7, 2022, 5:58pm UTC](https://itensor.discourse.group/t/dmrg-for-a-two-leg-ladder-model/379/2 "2022-09-07T17:58:24Z")

</div>

Hi, so the reason for that error is that your MPS `psi` has different site indices from the MPO `H`. The site indices get made when you call the `siteinds` function, so if you code is making a new set of site indices to make H, but reading in `psi` from a previous run of the code (or a different code) it will have different site indices.

A good solution is to read in `psi` first, then call this function on it to retrieve its site indices:

```auto
s = siteinds(psi)

```

then use these to make `H` afterward.

Regarding two or one site DMRG, right now we only offer two-site DMRG. But in an upcoming package (the ITensorTDVP package) that we will eventually merge into ITensor, we will offer one-site DMRG and will make that available from within ITensor itself.

---

<div class="post-metadata">

**Author:** ![paban.patra](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@paban.patra](https://itensor.discourse.group/u/paban.patra)\
**Post date:** [September 8, 2022, 9:09am UTC](https://itensor.discourse.group/t/dmrg-for-a-two-leg-ladder-model/379/3 "2022-09-08T09:09:42Z")

</div>

Thanks, It is working now.
