# plt.hist(eloc.detach().numpy(), bins=50) # plt.show() # pos = solver.sample(ntherm=0, ndecor=10) # obs = solver.sampling_traj(pos) # plot_energy(obs, e0=-8.) if 0: solver.configure(task='wf_opt', freeze=['ao', 'mo']) solver.observable(['local_energy']) solver.initial_sampling(ntherm=1000, ndecor=100) solver.resampling(nstep=25, step_size=0.2, resample_from_last=True, resample_every=1, tqdm=False) solver.ortho_mo = False data = solver.run(50, batchsize=None, loss='energy', grad='manual', clip_loss=True) save_observalbe('lih.pkl', solver.obs_dict) e, v = plot_energy(solver.obs_dict, e0=-8.06, show_variance=True) plot_data(solver.obs_dict, obs='jastrow.weight')
# Tc = plot_walkers_traj(obs) # plot_block(obs) # save_observalbe('obs.pkl', obs) # obs = load_observable('obs.pkl') # plot_energy(obs, e0=-1.1645, show_variance=True) # optimize the wave function if 0: solver.configure(task='wf_opt', freeze=['ao', 'mo']) solver.observable(['local_energy']) solver.initial_sampling(ntherm=1000, ndecor=100) solver.resampling(nstep=20, ntherm=-1, step_size=0.2, resample_from_last=True, resample_every=1, tqdm=True) solver.ortho_mo = False data = solver.run(50, batchsize=None, loss='energy', grad='manual', clip_loss=False) save_observalbe('h2.pkl', solver.obs_dict) e, v = plot_energy(solver.obs_dict, e0=-1.1645, show_variance=True) plot_data(solver.obs_dict, obs='jastrow.weight') # # optimize the geometry