示例#1
0
def hmc_inner(system, positions, params):
    groups = set_respa(system, params["respa"])
    integrator = hmc_integrators.GHMCRESPA(temperature, params["steps_per_hmc"], params["timestep"] * u.femtoseconds, collision_rate, groups)
    context = mm.Context(system, integrator)
    context.setPositions(positions)
    context.setVelocitiesToTemperature(temperature)
    integrator.step(n_steps)
    d = integrator.summary
    d.update(params)
    print(pd.Series(d))
    print("**************************** %f" % integrator.effective_ns_per_day)
    return d
示例#2
0
integrator = hmc_integrators.GHMC2(temperature, 50, timestep)
integrator.getNumComputations()
context = mm.Context(system, integrator)
context.setPositions(positions)
context.setVelocitiesToTemperature(temperature)

integrator.step(1)
%timeit integrator.step(4)

for k in range(integrator.getNumComputations()):
    print(integrator.getComputationStep(k))


groups = [(0, 1)]
integrator = hmc_integrators.GHMCRESPA(temperature, 50, timestep, collision_rate, groups)
integrator.getNumComputations()

context = mm.Context(system, integrator)
context.setPositions(positions)
context.setVelocitiesToTemperature(temperature)

integrator.step(1)
%timeit integrator.step(4)


for k in range(integrator.getNumComputations()):
    print(integrator.getComputationStep(k))


integrator = hmc_integrators.XHMCIntegrator(temperature,
                                            steps_per_hmc=10,
                                            timestep=timestep,
                                            collision_rate=1.0 / u.picoseconds,
                                            extra_chances=5)
context = mm.Context(system, integrator)
context.setPositions(positions)
context.setVelocitiesToTemperature(temperature)

data["xhmc1"] = pd.DataFrame(sample(context, n_iter=n_iter, n_steps=1))

groups = [(0, 2), (1, 1)]
hmc_integrators.guess_force_groups(system, nonbonded=0, fft=1, others=0)
integrator = hmc_integrators.GHMCRESPA(temperature,
                                       steps_per_hmc=10,
                                       timestep=timestep,
                                       collision_rate=1.0 / u.picoseconds,
                                       groups=groups)
context = mm.Context(system, integrator)
context.setPositions(positions)
context.setVelocitiesToTemperature(temperature)

data["ghmcrespa1"] = pd.DataFrame(sample(context, n_iter=n_iter, n_steps=1))

groups = [(0, 2), (1, 1)]
hmc_integrators.guess_force_groups(system, nonbonded=0, fft=1, others=0)
integrator = hmc_integrators.XHMCRESPAIntegrator(temperature,
                                                 steps_per_hmc=10,
                                                 timestep=timestep,
                                                 collision_rate=1.0 /
                                                 u.picoseconds,
cutoff = 1.0 * u.nanometers
hydrogenMass = 1.0 * u.amu

testsystem = testsystems.DHFRExplicit(hydrogenMass=hydrogenMass, cutoff=cutoff)
system, positions = testsystem.system, testsystem.positions

positions = lb_loader.pre_equil(system, positions, temperature)

platform_properties = dict(CudaPrecision="mixed")
steps_per_hmc = 17
timestep = 1.5 * u.femtoseconds
hmc_integrators.guess_force_groups(system, nonbonded=1, fft=1, others=0)
factor = 1
groups = [(0, 2), (1, 1)]

integrator = hmc_integrators.GHMCRESPA(temperature, steps_per_hmc, timestep,
                                       collision_rate, groups)
context = mm.Context(system, integrator, platform, platform_properties)
context.setPositions(positions)
context.setVelocitiesToTemperature(temperature)

integrator.step(1)
integrator.step(n_steps)
integrator.vstep(5)

platform_properties = dict(CudaPrecision="single")
steps_per_hmc = 17
timestep = 1.5 * u.femtoseconds
hmc_integrators.guess_force_groups(system, nonbonded=1, fft=1, others=0)
factor = 1
groups = [(0, 2), (1, 1)]