qmctorch.solver.solver_base module
- class qmctorch.solver.solver_base.SolverBase(wf=None, sampler=None, optimizer=None, scheduler=None, output=None, rank=0)[source]
Bases:
object
Base Class for QMC solver
- Parameters:
wf (qmctorch.WaveFunction, optional) – wave function. Defaults to None.
sampler (qmctorch.sampler, optional) – Sampler. Defaults to None.
optimizer (torch.optim, optional) – optimizer. Defaults to None.
scheduler (torch.optim, optional) – scheduler. Defaults to None.
output (str, optional) – hdf5 filename. Defaults to None.
rank (int, optional) – rank of he process. Defaults to 0.
- configure_resampling(mode='update', resample_every=1, nstep_update=25)[source]
Configure the resampling
- track_observable(obs_name)[source]
define the observalbe we want to track
- Parameters:
obs_name (list) – list of str defining the observalbe. Each str must correspond to a WaveFuncion method
- store_observable(pos, local_energy=None, ibatch=None, **kwargs)[source]
store observale in the dictionary
- resample(n, pos)[source]
Resample the wave function
- Parameters:
n (int) – current epoch value
pos (torch.tensor) – positions of the walkers
- Returns:
new positions of the walkers
- Return type:
(torch.tensor)
- sampling_traj(pos=None, with_tqdm=True, hdf5_group='sampling_trajectory')[source]
Compute the local energy along a sampling trajectory
- Parameters:
pos (torch.tensor) – positions of the walkers along the trajectory
hdf5_group (str, optional) – name of the group where to store the data. Defaults to ‘sampling_trajecory’
- Returns:
contains energy/positions/
- Return type:
SimpleNamespace
- print_parameters(grad=False)[source]
print parameter values
- Parameters:
grad (bool, optional) – also print the gradient. Defaults to False.