# Observables depend on initial preparation

**URL:** <https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104>\
**Category:** DMRG and Numerical Methods\
**Tags:** dmrg\
**Created:** [May 1, 2022, 4:17pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104 "2022-05-01T16:17:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![calca98](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@calca98](https://itensor.discourse.group/u/calca98)\
**Post date:** [May 1, 2022, 4:17pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/1 "2022-05-01T16:17:56Z")

</div>

Hello everyone, I am new at ITensor and I am using it to run some numerical DMRG simulations.  
Starting from a 1D extended Hubbard Hamiltonian

H =- t \sum\_i \bigg( c^\dag\_{i+1}c\_i + c^\dag\_i c\_{i+1} \bigg) + V \sum\_{i} \sum\_{l=1}^{2} n\_i n\_{i+l}

I created two different initial states with a defined number of particles with

> int N = 100  
> auto sites = Fermion(N,{“ConserveNf=”,true});  
> auto state1 = InitState(sites,“0”);  
> auto state2 = InitState(sites,“0”);  
> for(int j = 1; j \<= N; ++j)  
> {  
> if( j%d == 1 || j%d == 2 || j%d == 5 || j%d == 8 )  
> {  
> state1.set(j,“1”);  
> }  
> }
> 
> for(int j = 1; j \<= 40; ++j)  
> {  
> state2.set(j,“1”);  
> }

so that the only difference is the initial location of the particles. Then I create the MPS

> auto psi01 = MPS(state1); //starting state  
> auto psi02 = MPS(state2); //starting state

and finally run DMRG

> auto [energy1,psi1] = dmrg(H,psi01,sweeps) ;  
> auto [energy2,psi2] = dmrg(H,psi02,sweeps)) ;

But the energy ground state is different (and behaves differently by varying V).  
Am I making some mistakes or is it intrinsic in DMRG?

P.S. I have already tried with noise option in sweeps

---

<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:** [May 1, 2022, 4:52pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/2 "2022-05-01T16:52:51Z")

</div>

Yes, getting different results sometimes in DMRG when starting from different initial states. Please see [the discussion in the ITensor documentation here](https://itensor.github.io/ITensors.jl/stable/faq/DMRG.html#Preventing-DMRG-from-getting-stuck-in-a-local-minimum).

How many sweeps did you do? If you do more sweeps do the two energies become closer?

---

<div class="post-metadata">

**Author:** ![calca98](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@calca98](https://itensor.discourse.group/u/calca98)\
**Post date:** [May 1, 2022, 8:40pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/3 "2022-05-01T20:40:16Z")

</div>

Hello, thank you for your response. I started with 5 sweeps with maxdim 10,20,30,50,100. I have now increased to 10 sweeps with maxdim 10,20,30,40,50,60,80,100,120,140; but the energies did not become closer

---

<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:** [May 1, 2022, 9:57pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/4 "2022-05-01T21:57:54Z")

</div>

What’s the value of `d` in your code above? Thanks.

---

<div class="post-metadata">

**Author:** ![calca98](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@calca98](https://itensor.discourse.group/u/calca98)\
**Post date:** [May 1, 2022, 10:44pm UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/5 "2022-05-01T22:44:35Z")

</div>

It’s 10. That’s because I expect the system to arrange (for large V) in a configuration like

1100 100 100

---

<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:** [May 2, 2022, 12:52am UTC](https://itensor.discourse.group/t/observables-depend-on-initial-preparation/104/6 "2022-05-02T00:52:05Z")

</div>

Thanks: I just wanted to double check that the number of particles ended up being the same for both initial states.

So I found that I was able to get both states to converge to the same final energy. The key is just that state2 is much more challenging for DMRG to use as an initial state, since the particles are all on one side of the system and being fermions can’t move past each other. But if I did **at least 30 sweeps** while also using the noise parameter it helped a lot. Another trick for difficult-to-converge states is to do many sweeps at a smaller bond dimension first, then raise the bond dimension after that.

Here is the `Sweeps` definition I used:

```auto
    auto sweeps = Sweeps(50);
    sweeps.maxdim() = 10,10,10,10,10,10,10,20,20,20,20,40,80,100;
    sweeps.cutoff() = 1E-8;
    sweeps.noise() = 1E-5,1E-5,1E-5,1E-5,1E-6,1E-6,1E-6,1E-12;
    println(sweeps);

```
