# DMRG initial states with QN conservation

**URL:** <https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404>\
**Category:** ITensor Julia Questions\
**Tags:** dmrg\
**Created:** [September 21, 2022, 2:41am UTC](https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404 "2022-09-21T02:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnab](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@Arnab](https://itensor.discourse.group/u/Arnab)\
**Post date:** [September 21, 2022, 2:41am UTC](https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404/1 "2022-09-21T02:41:04Z")

</div>

Hi!

I am trying to find the ground state of a Hamiltonian with a \mathbb{Z}\_2 \otimes \mathbb{Z}\_2 global symmetry. To this end, I want to initialize the ground state in a way that respects the symmetry and then make DMRG remain in the symmetry sector. The simplest such ground state is the following: |\psi\_0 \rangle =\frac{1}{\sqrt{2}}(\underbrace{|0+++...++0\rangle}\_{\psi\_a} +\underbrace{|1+++...++1\rangle}\_{\psi\_b} ) where |+\rangle stands for the +1 eigenstate of \sigma\_x. I tried to implement this strategy using the example laid out in the [documentation](https://itensor.github.io/ITensors.jl/stable/tutorials/QN_DMRG.html) but came across two problems.

First of all, when defining the \psi\_a part of the state, ITensor doesn’t seem to recognize the |+\rangle state as part of the [Qubit library](https://github.com/ITensor/ITensors.jl/blob/main/src/physics/site_types/qubit.jl).

```auto
using ITensors

  N = 10
  sites = siteinds("Qubit",N;conserve_qns=true)
  state_a = [isequal(n,1)|| isequal(n,N) ? "0" : "X+" for n=1:N] 
  psi_a = productMPS(sites,state)

```

producing

> ArgumentError: Overload of “state” or “state!” functions not found for state name “X+” and Index tags “Qubit,Site,n=1”.

Finally, I don’t know if adding two product states \psi\_a and \psi\_b is allowed in this context in ITensor.

Thank you very much in advance!

Best,  
Arnab

---

<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 23, 2022, 7:30pm UTC](https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404/2 "2022-09-23T19:30:24Z")

</div>

Hi Arnab,  
It’s an interesting question. First of all, what you’re trying in the code above is probably not working for two reasons:

1. you defined your array as `state_a` but then wrote `state` when plugging it into the `productMPS` function, so you just have a minor bug there
2. the `state_a` state you are making (I get `state_a = ["0", "X+", "X+", "X+", "X+", "X+", "X+", "X+", "X+", "0"]` when printing it out) does not conserve total qubit parity, which is what `conserve_qns=true` conserves for the “Qubit” site type. As I think you’d agree it’s a state which is a superposition of different parity sectors.

So to understand what you’re trying to do I’d need some more information. What is the Z\_2 \otimes Z\_2 symmetry you are trying to conserve? What does each copy of Z\_2 correspond to in terms of the qubits?

---

<div class="post-metadata">

**Author:** ![Arnab](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@Arnab](https://itensor.discourse.group/u/Arnab)\
**Post date:** [September 24, 2022, 7:04pm UTC](https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404/3 "2022-09-24T19:04:17Z")

</div>

Hi Miles,

Thank you very much for your response! The \mathbb{Z}\_2 \otimes \mathbb{Z}\_2 symmetry I am trying to conserve acts on the qubits via \cong \langle ZXIXI…XIZ, XIXIX…XIX\rangle. So the parity is conserved in the bulk but at the two boundary sites, things get a little more complicated.

Best,  
Arnab

---

<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 24, 2022, 7:56pm UTC](https://itensor.discourse.group/t/dmrg-initial-states-with-qn-conservation/404/4 "2022-09-24T19:56:32Z")

</div>

That helps me understand a bit more, but I’m afraid I don’t have all the information I would need to help you if you still want to try to conserve this. Is there a way of explaining the symmetry in terms of a quantity which is conserved? Like for spins a common example is that total Sz is conserved. Is it here that the parity of a subset of the qubits is conserved or always remains the same?
