예제 #1
0
def get_multi_temperature_data(kt0=1.0, kt1=5.0, length0=10000, length1=10000, n0=10, n1=10):
    """
    Continuous MCMC process in an asymmetric double well potential at multiple temperatures.

    Parameters
    ----------
    kt0: double, optional, default=1.0
        Temperature in kT for the first thermodynamic state.
    kt1: double, optional, default=5.0
        Temperature in kT for the second thermodynamic state.
    length0: int, optional, default=10000
        Trajectory length in steps for the first thermodynamic state.
    length1: int, optional, default=10000
        Trajectory length in steps for the second thermodynamic state.
    n0: int, optional, default=10
        Number of trajectories in the first thermodynamic state.
    n1: int, optional, default=10
        Number of trajectories in the second thermodynamic state.

    Returns
    -------
    dict - keys shown below in brackets
        Trajectory (trajs), energy (energy_trajs), and temperature (temp_trajs) data from the MCMC
        runs as well as the discretised version (dtrajs + centers). Energies and temperatures are
        given in kT, lengths in arbitrary units.
    """
    dws = _DWS()
    mt_data = dws.mt_sample(
        kt0=kt0, kt1=kt1, length0=length0, length1=length1, n0=n0, n1=n1)
    mt_data.update(centers=dws.centers)
    return mt_data
예제 #2
0
def get_umbrella_sampling_data(ntherm=11, us_fc=20.0, us_length=500, md_length=1000, nmd=20):
    """
    Continuous MCMC process in an asymmetric double well potential using umbrella sampling.

    Parameters
    ----------
    ntherm: int, optional, default=11
        Number of umbrella states.
    us_fc: double, optional, default=20.0
        Force constant in kT/length^2 for each umbrella.
    us_length: int, optional, default=500
        Length in steps of each umbrella trajectory.
    md_length: int, optional, default=1000
        Length in steps of each unbiased trajectory.
    nmd: int, optional, default=20
        Number of unbiased trajectories.

    Returns
    -------
    dict - keys shown below in brackets
        Trajectory data from umbrella sampling (us_trajs) and unbiased (md_trajs) MCMC runs and
        their discretised counterparts (us_dtrajs + md_dtrajs + centers). The umbrella sampling
        parameters (us_centers + us_force_constants) are in the same order as the umbrella sampling
        trajectories. Energies are given in kT, lengths in arbitrary units.
    """
    dws = _DWS()
    us_data = dws.us_sample(
        ntherm=ntherm, us_fc=us_fc, us_length=us_length, md_length=md_length, nmd=nmd)
    us_data.update(centers=dws.centers)
    return us_data