# Mixed site set with quantum number conservation

**URL:** <https://itensor.discourse.group/t/mixed-site-set-with-quantum-number-conservation/470>\
**Category:** ITensor Julia Questions\
**Tags:** julia, dmrg, mps, mpo\
**Created:** [October 14, 2022, 10:20pm UTC](https://itensor.discourse.group/t/mixed-site-set-with-quantum-number-conservation/470 "2022-10-14T22:20:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [October 15, 2022, 1:37am UTC](https://itensor.discourse.group/t/mixed-site-set-with-quantum-number-conservation/470/2 "2022-10-15T01:37:32Z")

</div>

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:

```auto
  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.

---

_[View the full topic](https://itensor.discourse.group/t/mixed-site-set-with-quantum-number-conservation/470)._
