# Calculating the local energy in neural network quantum state

given a Hamiltonian of Heisenberg 1D model as following:

$$H = -J\sum_{I}\sigma_{i}^{z}\sigma_{i+1}^{z}$$

I am trying to solve it with a neural network function given by Restricted Boltzmann machine by minimising the Energy function. At each iteration, I generated the sample by using MCMC, and I have to calculated the local energy of each sample, where the local energy was written as follow

$$E_\text{local} = H_{ss'}*\frac{\Psi(s')}{\Psi({s})} = \frac{\sum_{s'}\langle s|H|s'\rangle\Psi(s')}{\Psi(s)}.$$

I don't know how to evaluated this local energy. I saw some people try to flip some anti-parallel spin on the current state and generate another set of sample to evaluated this local energy. But according to the equation we have to calculated all the basis again. I'm confused as how to evaluate $$H_{ss'}$$.