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, ntherm_update=-1, increment={'every': None, 'factor': None})[source]
Configure the resampling
- Parameters:
mode (str, optional) – method to resample : ‘full’, ‘update’, ‘never’ Defaults to ‘update’.
resample_every (int, optional) – Number of optimization steps between resampling Defaults to 1.
nstep_update (int, optional) – Number of MC steps in update mode. Defaults to 25.
ntherm_update (int, optional) – Number of MC steps to thermalize the new sampling. Defaults to -1.
increment (dict, optional) – dict containing the option to increase the sampling space every (int) : increment the sampling space every n optimization step factor (int) : increment with factor x nwalkers points
- 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)
- single_point(with_tqdm=True, batchsize=None, hdf5_group='single_point')[source]
Performs a single point calculatin
- 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.