Mixed site set with quantum number conservation

Good question – I think you’re running into a minor, but annoying, limitation of our QN system as it currently stands. We plan to lift this limtation in the future. The good news is that this limitation is easy to work around. (The limitation is that when using QNs all indices must have them, even ones which don’t conserve anything.)

As a workaround, please try the following code for making your sites array:

  sites = Vector{Index}(undef,Nsites)
  for n=1:Nsites
    if isodd(n)
      sites[n] = siteind("Electron"; addtags="n=$n",conserve_qns=true)
    else
      sites[n] = Index([QN() => phonon_dim],"Boson,Site,n=$n")
    end
  end

and please let me know if it works. If not we can keep tweaking it.

3 Likes