def make_mstis_engine():
    pes = (
        toys.OuterWalls([1.0, 1.0], [0.0, 0.0])
        + toys.Gaussian(-0.7, [12.0, 12.0], [0.0, 0.4])
        + toys.Gaussian(-0.7, [12.0, 12.0], [-0.5, -0.5])
        + toys.Gaussian(-0.7, [12.0, 12.0], [0.5, -0.5])
    )

    topology=toys.Topology(
        n_spatial=2,
        masses=[1.0, 1.0],
        pes=pes
    )

    integ = toys.LangevinBAOABIntegrator(dt=0.02, temperature=0.1, gamma=2.5)

    options={
        'integ': integ,
        'n_frames_max': 5000,
        'n_steps_per_frame': 1
    }

    toy_eng = toys.Engine(
        options=options,
        topology=topology
    ).named('toy_engine')

    template = toys.Snapshot(
        coordinates=np.array([[-0.5, -0.5]]),
        velocities=np.array([[0.0,0.0]]),
        engine=toy_eng
    )

    toy_eng.current_snapshot = template
    return toy_eng
def make_mistis_engine():
    pes = (
        toys.OuterWalls([1.0, 1.0], [0.0, 0.0])
        + toys.Gaussian(-1.0, [12.0, 12.0], [-0.5, 0.5])
        + toys.Gaussian(-1.0, [12.0, 12.0], [-0.5, -0.5])
        + toys.Gaussian(-1.0, [12.0, 12.0], [0.5, -0.5])
    )

    topology=toys.Topology(n_spatial=2,
                           masses=[1.0, 1.0],
                           pes=pes)

    integ = toys.LangevinBAOABIntegrator(dt=0.02, temperature=0.1, gamma=2.5)

    options = {
        'integ': integ,
        'n_frames_max': 5000,
        'n_steps_per_frame': 1
    }

    toy_eng = toys.Engine(
        options=options,
        topology=topology
    ).named('engine')
    return toy_eng
예제 #3
0
    def setUp(self):
        pes = linear
        integ = toy.LangevinBAOABIntegrator(dt=0.002, temperature=0.5,
                                        gamma=1.0)
        topology=toy.Topology(
            n_spatial = 2,
            masses = sys_mass,
            pes = pes
        )
        options={
            'integ' : integ,
            'n_frames_max' : 5}
        sim = toy.Engine(options=options,
                        topology=topology
                       )

        template = toy.Snapshot(
            coordinates=init_pos.copy(),
            velocities=init_pos.copy(),
            engine=sim
        )

        sim.positions = init_pos.copy()
        sim.velocities = init_vel.copy()

        sim.n_steps_per_frame = 10
        self.sim = sim
예제 #4
0
    def setup(self):
        integ = toys.LangevinBAOABIntegrator(dt=0.002,
                                             temperature=1.0,
                                             gamma=2.5)
        options = {'integ': integ, 'n_frames_max': 5}
        topology_2D = toys.Topology(n_spatial=2, masses=[1.0], pes=None)
        engine_2D = toys.Engine(options=options, topology=topology_2D)
        self.snap_2D = toys.Snapshot(coordinates=np.array([[0.0, 0.0]]),
                                     velocities=np.array([[2.0, 4.0]]),
                                     engine=engine_2D)

        topology_6D = toys.Topology(n_spatial=3,
                                    n_atoms=2,
                                    masses=[1.0, 2.0],
                                    pes=None)
        engine_6D = toys.Engine(options=options, topology=topology_6D)
        self.snap_6D = toys.Snapshot(coordinates=np.array([[0.0, 0.0, 0.0],
                                                           [0.0, 0.0, 0.0]]),
                                     velocities=np.array([[1.0, 0.0, 0.0],
                                                          [1.0, 0.0, 0.0]]),
                                     engine=engine_6D)
예제 #5
0
    parser = argparse.ArgumentParser()
    parser.add_argument('--nsteps', type=int, default=10000)
    return parser

parser = make_parser()
opts = parser.parse_args()
n_steps = opts.nsteps

pes = (toys.OuterWalls([1.0,1.0], [0.0,0.0])
       + toys.Gaussian(-0.7, [30.0, 0.5], [-0.6, 0.0])
       + toys.Gaussian(-0.7, [30.0, 0.5], [0.6, 0.0])
       + toys.Gaussian(0.5, [85.0, 70.0], [0.1, 0.0]))
topology = toys.Topology(n_spatial=2, masses=[1.0, 1.0], pes=pes)
engine = toys.Engine(
    {'integ': toys.LangevinBAOABIntegrator(dt=0.02,
                                           temperature=0.1,
                                           gamma=2.5),
     'n_frames_max': 5000,
     'n_steps_per_frame': 10}, topology)
template = toys.Snapshot(coordinates=np.array([[0.0, 0.0]]),
                         velocities=np.array([[0.0, 0.0]]),
                         engine=engine)

def val(snapshot, index):
    return snapshot.xyz[0][index]

cv_x = paths.FunctionCV("xval", val, index=0)
cv_y = paths.FunctionCV("yval", val, index=1)

stateA = paths.CVDefinedVolume(cv_x, float("-inf"), -0.6).named("A")
stateB = paths.CVDefinedVolume(cv_x, 0.6, float("inf")).named("B")