Seeming preference for values of some operators
Created by: rodrigoaraizabravo
Hello, I've been playing with the NetKet code for some time now. In particular, we've seen a particularly interesting behavior when it comes down to measuring one-site observables of the Ising 1D model in the ferromagnetic regime. Let us say we run the code as pointed in the Ising1d tutorial for different values of the transverse field h \in [0J,2J]. We can also measure some in-site observables such as the in-site magnetization by specifying:
def sigmaz(): #Defines the third Pauli matrix
return np.array([[1,0], [0, -1]])
def get_loc_obs_dict(i, O, name=''): #Defines the information to be passed to the pars['Observables']
sites =[[i]]
ops = [O.tolist()]
return dict(ActingOn=sites,Operators=ops,Name=name+str(i))
#Defines observables to measure during the learning procedure
pars['Observables'] = []
for i in range(L):
pars['Observables'].append(get_loc_obs_dict(i, sigmaz(), `name='z'))```
I've also written a python script that runs a simulation on an L=12 chain for 40 equally spaced values of h in the interval specified. The energy has no trouble converging, and in fact observables such as <Z_iZ_{i+1}> also converge to the right values, but our in-site magnetization doesn't (see figures in the attachments). Sampling though different values for the hidden nodes did not help, as can be seen in the image I provide. The issue is prominent when the energy gap is small.
The issue is not that the theoretical and learnt in-site magnetization seem to disagree with the small h values, but that NetKet seems to converge to ground states which prefer a negative in-site magnetization. I've been looking through the documentation and I cannot seem to spot the issue.
I was wondering if I could be given some guidance on how to approach this issue. I've look through the seed in Utils/random_utils.hpp and the initialization ansatz in Machines/rbm_spin.hpp but haven't seen any issues. I even wrote an initialization scheme that approximates a GHZ state from the get-go, but the in-site magnetization is still negative. I'd be happy to give more details if needed.