np conserved module
Dear community,
I am at the moment working with a system which has a SU(2) invariance. Thus, when finding the ground state via DMRG, I fix the total \(Sz\) charge. So far everything is fine. Once I obtain the ground state, I would like to apply a \(Sx\) (or \(Sy\) ) operator to the ground state and here comes the problem. So, since 'Sx' is not compatible with the symmetry, calling
Code: Select all
SpinSite(S=0.5, conserve='Sz' )
cannot provide this operator, so I instead use
Code: Select all
SpinSite(S=0.5, conserve=None )
Y = site_op.get_op('Sy')
which looks to return a npc Array with no legcharge information. However, when I try to apply it to the ground state via
Code: Select all
psi.apply_local_op(L//2, Y)
or using different approaches, as for example setting the B tensor on that site explicitly doing the np.tensordot, I obtain the following error
Code: Select all
ValueError: incompatible LegCharge
which of course makes sense.
So my question is: what is the way to do this?
Also, I tried adding the 'Sy' operator to the conserving site via
Code: Select all
site_op= SpinHalfSite( conserve='Sz')
site_op.add_op('Sy', [[0.,1j],[-1j,0.]])
Y = site_op.get_op('Sy')
print(Y)
however the result "cuts" half of this operator
Code: Select all
op = npc.Array.from_ndarray(op, [self.leg, self.leg.conj()])
<npc.Array shape=(2, 2) charge=ChargeInfo([1], ['2*Sz']) labels=['p', 'p*']
+1 | -1
0 [[ 1] |0 [[ 1]
1 [-1]]|1 [-1]]
2 |2
[[ 0.+0.j 0.+0.j]
[-0.-1.j 0.+0.j]]
Thanks!