Python interface

The simulation can be runned through a python interface as followed.

from ndsimulator.ndrun import NDRun

params = dict(
    root = "./",
    run_name = "instance",
    ndim = 2,
    x0 = [0.0, 0.0],
    potential = "square",
    seed = 11111,
    method = "md",
    steps = 100,
    dt = 0.5,
    integrate = "langevin",
    temperature = 300.0,
    md_gamma = 0.005,
)
simulation = NDRun(**params)
simulation.begin()
simulation.run()
simulation.end()
class ndsimulator.ndrun.NDRun(ndim: int, temperature: float = 300.0, mass: float = 5, steps: int = 100, atoms=None, colvar=None, true_colvar=None, method: str = 'md', random=None, seed: Optional[int] = None, x0: Union[list, str] = [0.0, 0.0], biases: Optional[list] = [], plot=False, screen=True, dump=True, **kwargs)
Parameters
  • ndim (int) – The dimensionality of the energy landscape. Defaults to 2.

  • temperature (float, optional) – Defaults to 300.0.

  • mass (float, optional) – Defaults to 5.

  • steps (int, optional) – Defaults to 100.

  • atoms (optional) – Defaults to None.

  • colvar (optional) – Defaults to None.

  • true_colvar (optional) – Defaults to None.

  • method (str, optional) – The method for sampling. Defaults to “md”.

  • random (np.random.RandomState, optional) – RandomState. Defaults to None.

  • seed (int, optional) – random number seed. Defaults to None.

  • x0 (list, str, optional) – initial positions. Defaults to [0.0, 0.0].

  • biases (list, optional) – list of biases. Defaults to [].

  • plot (bool, optional) – If True, the sampling process is plotted. Defaults to False.

  • screen (bool, optional) – If True, screen output is dumped. Defaults to True.

  • dump (bool, optional) – If True, the position history is logged. Defaults to True.

Raises

NameError – _description_

classmethod from_dict(dictionary)

load model from dictionary

Args:

dictionary (dict): append (bool): if True, append the old model files and append the same logfile