# question about asymmetric hubbard model

**URL:** <https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020>\
**Category:** ITensor Julia Questions\
**Tags:** dmrg\
**Created:** [September 29, 2024, 9:42am UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020 "2024-09-29T09:42:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luckyzy](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@luckyzy](https://itensor.discourse.group/u/luckyzy)\
**Post date:** [September 29, 2024, 9:42am UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020/1 "2024-09-29T09:42:42Z")

</div>

Hello everyone, I have been working on my two-dimensional asymmetric Hubbard model and have noticed that the computation speed is very slow, and it consistently fails to converge. I would like to ask if this issue might be caused by my program. Below are my parameters:

```julia
let
  Ny = 6
  Nx = 6
  U=2
  tupup=1
  tdndn=0.2
  N = Nx * Ny

  sites = siteinds("Electron",N; conserve_sz=true)
  lattice = square_lattice(Nx, Ny; yperiodic=false)

  os = OpSum()
  for b in lattice
    os += tupup, "Cdagup", b.s1, "Cup", b.s2
    os += tupup, "Cup", b.s1, "Cdagup", b.s2
    os += tdndn, "Cdagdn", b.s1, "Cdn", b.s2
    os += tdndn, "Cdn", b.s1, "Cdagdn", b.s2
    os += U, "Nup", b.s1, "Ndn", b.s1
  end

  H = MPO(os, sites)
  state = [isodd(n) ? "Up" : "Dn" for n in 1:N]
  psi0 = random_mps(sites, state; linkdims=30)
  
  nsweeps = 20
  maxdim = [400, 800, 1600, 1800 ,2000 ,2200]
  cutoff = [1E-8]
  noise = [1E-5 ,1E-6, 1E-7, 1E-8, 0.0]

  energy, psi = dmrg(H, psi0; nsweeps, maxdim, cutoff, noise)
  H2 = inner(H,psi,H,psi)
  E = inner(psi',H,psi)
  var = H2-E^2
  @show var
  return nothing

```

H = t\_{\uparrow} \sum\_{\langle i,j \rangle} \left( C\_{i\uparrow}^{\dagger} C\_{j\uparrow} + C\_{j\uparrow}^{\dagger} C\_{i\uparrow} \right)+t\_{\downarrow} \sum\_{\langle i,j \rangle} \left( C\_{i\downarrow}^{\dagger} C\_{j\downarrow} + C\_{j\downarrow}^{\dagger} C\_{i\downarrow} \right) + U \sum\_{i} n\_{i\uparrow} n\_{i\downarrow}

Could everyone please help me verify if my Hamiltonian for the two-dimensional DMRG is correct? Feel free to adjust any part of it!

---

<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 29, 2024, 4:46pm UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020/2 "2024-09-29T16:46:33Z")

</div>

My feedback would mainly be to say that `Ny = 6` is rather ambitious for the Hubbard model with DMRG. State-of-the-art DMRG calculations for `Ny = 4` cylinders needed to keep up to 20,000 states (`maxdim=20,000`) to converge and even then there were some questions about the accuracy. See this paper:  
[https://www.science.org/doi/full/10.1126/science.aal5304](https://www.science.org/doi/full/10.1126/science.aal5304)

(While that paper is about about a t-t'-U model, I would think that the general point would apply to your case too.)

In general, for the Hubbard model one has to approach wider cylinders very gradually and carefully with DMRG. This includes studying smaller cylinders first, trying various initial states and plotting the results to visualize the behavior e.g. are holes or particles ‘sticking’ to the boundaries or phase separating, and also considering if there are different / modified Hamiltonians which might show similar qualitative behavior but have less entanglement.

---

<div class="post-metadata">

**Author:** ![luckyzy](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@luckyzy](https://itensor.discourse.group/u/luckyzy)\
**Post date:** [October 4, 2024, 4:33am UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020/3 "2024-10-04T04:33:43Z")

</div>

Thanks, Miles! I think the way you mentioned works really well.

---

<div class="post-metadata">

**Author:** ![corbett5](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/corbett5/32/886_2.png) [@corbett5](https://itensor.discourse.group/u/corbett5)\
**Post date:** [October 4, 2024, 6:19pm UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020/4 "2024-10-04T18:19:43Z")

</div>

I’ve been using ITensors to study the Ferm-Hubbard Hamiltonian as well and can confirm that 6x6 is ambitious. The one other remark I have is that I think your interaction term is wrong.

You have (ignoring the other terms)

```julia
for b in lattice
  os += U, "Nup", b.s1, "Ndn", b.s1
end

```

but here `for b in lattice` is iterating over all the lattice bonds not sites. Even worse the number of times `b.s1` will appear is not constant from site to site so you’ll wind up with different interaction strengths.

```julia
julia> lattice = square_lattice(2, 2; yperiodic=false)
4-element Vector{LatticeBond}:
 LatticeBond(1, 3, 1.0, 1.0, 2.0, 1.0, "")
 LatticeBond(1, 2, 1.0, 1.0, 1.0, 2.0, "")
 LatticeBond(2, 4, 1.0, 2.0, 2.0, 2.0, "")
 LatticeBond(3, 4, 2.0, 1.0, 2.0, 2.0, "")

julia> for b in lattice
       @show b.s1, b.s2
       end
(b.s1, b.s2) = (1, 3)
(b.s1, b.s2) = (1, 2)
(b.s1, b.s2) = (2, 4)
(b.s1, b.s2) = (3, 4)

```

I would imagine there’s a way to use the lattice system to do this but I would just do

```julia
for i in 1:N
  os += U, "Nup", i, "Ndn", i
end

```

Also, about the computational speed. Currently you’re only conserving the total spin, do you also want to conserve the total number of electrons (I think this is the most common case). Have you tried enabling the block sparse [multithreading](https://itensor.github.io/ITensors.jl/stable/Multithreading.html)? I would try increasing the number of sweeps at lower bond dimensions substantially as a way to speed convergence at the larger bond dimensions. I would also recommend saving the MPS to disk so that you can resume the calculation and not have to redo it every time ([here](https://itensor.discourse.group/t/how-to-save-mps-data-during-the-dmrg-calculation/949) is an example of how to do this).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/d3072b13e047cd06df7f3981547c0917d940dfa4.png) [@system](https://itensor.discourse.group/u/system)\
**Post date:** [October 14, 2024, 6:20pm UTC](https://itensor.discourse.group/t/question-about-asymmetric-hubbard-model/2020/5 "2024-10-14T18:20:26Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
