def construct_simulator(name, top, sys, pos, timestep=default_timestep, thinning_interval=default_thinning): return EquilibriumSimulator(platform=configure_platform("CUDA"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=timestep, burn_in_length=burn_in_length, n_samples=n_samples, thinning_interval=thinning_interval, name=name)
from benchmark.testsystems.configuration import configure_platform import numpy as np n_samples = 100 thinning_interval = 100 temperature = simulation_parameters["temperature"] from benchmark.testsystems.bookkeepers import EquilibriumSimulator top, sys, pos = load_alanine(constrained=True) alanine_constrained = EquilibriumSimulator( platform=configure_platform("Reference"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=500, n_samples=n_samples, thinning_interval=thinning_interval, name="alanine_constrained_test") print("Sample from cache: \n", alanine_constrained.sample_x_from_equilibrium()) sim = NonequilibriumSimulator( alanine_constrained, LangevinSplittingIntegrator("O V R V O", timestep=4.5 * unit.femtoseconds)) result = sim.collect_protocol_samples(100, 100, store_potential_energy_traces=True, store_W_shad_traces=True) print("<W>_(0 -> M): {:.3f}, <W>_(M -> 2M): {:.3f}".format(
testsystem = WaterBox(constrained=constrained) (topology, system, positions) = testsystem.topology, testsystem.system, testsystem.positions add_barostat(system) return topology, system, positions temperature = simulation_parameters["temperature"] from benchmark.testsystems.bookkeepers import EquilibriumSimulator top, sys, pos = load_waterbox(constrained=True) waterbox_constrained = EquilibriumSimulator( platform=configure_platform("CUDA"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=100000, n_samples=1000, thinning_interval=10000, name="waterbox_constrained") top, sys, pos = load_waterbox(constrained=False) flexible_waterbox = EquilibriumSimulator(platform=configure_platform("CUDA"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=0.5 * unit.femtosecond, burn_in_length=200000, n_samples=1000,
force.addBond(int(bond[0]), int(bond[1]), grid_spacing, coupling_strength) system.addForce(force) # Create topology. topology = app.Topology() element = app.Element.getBySymbol('Ar') chain = topology.addChain() for particle in range(system.getNumParticles()): residue = topology.addResidue('Ar', chain) topology.addAtom('Ar', element, residue) # Set topology, positions, system as instance attributes self.topology = topology self.positions = positions self.system = system n_samples = 1000 # number of samples to collect if 'TRAVIS' in os.environ: n_samples = 20 # reduce sampling for travis temperature = simulation_parameters["temperature"] testsystem = CoupledPowerOscillators(nx=5, ny=5, nz=5) top, sys, pos = testsystem.topology, testsystem.system, testsystem.positions coupled_power_oscillators = EquilibriumSimulator(platform=configure_platform("CPU"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=1000, n_samples=n_samples, thinning_interval=10, name="coupled_power_oscillators")
else: testsystem = AlanineDipeptideExplicit(constraints=None, rigid_water=False) topology, system, positions = testsystem.topology, testsystem.system, testsystem.positions add_barostat(system) return topology, system, positions n_samples = 1000 # number of samples to collect if 'TRAVIS' in os.environ: n_samples = 20 # reduce sampling for travis temperature = simulation_parameters["temperature"] from benchmark.testsystems.bookkeepers import EquilibriumSimulator top, sys, pos = load_alanine(constrained=True) alanine_constrained = EquilibriumSimulator(platform=configure_platform("Reference"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=50000, n_samples=n_samples, thinning_interval=10000, name="alanine_constrained") top, sys, pos = load_alanine(constrained=False) alanine_unconstrained = EquilibriumSimulator(platform=configure_platform("Reference"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=50000, n_samples=n_samples, thinning_interval=10000, name="alanine_unconstrained") top, sys, pos = load_solvated_alanine(constrained=False) solvated_alanine_unconstrained = EquilibriumSimulator(platform=configure_platform("CUDA"), topology=top, system=sys, positions=pos, temperature=temperature,
# DHFR reaction field (for the MTS experiment) dhfr_reaction_field = construct_simulator( "dhfr_constrained_reaction_field", *load_dhfr_reaction_field(constrained=True)) # Src explicit top, sys, pos = load_src_explicit(constrained=True) src_constrained = construct_simulator("src_constrained", top, sys, pos, default_timestep / 2.5, default_thinning * 2.5) # T4 lysozyme t4_constrained = construct_simulator("t4_constrained", *load_t4_implicit(constrained=True)) t4_unconstrained = construct_simulator("t4_unconstrained", *load_t4_implicit(constrained=False)) # constraint-coupled harmonic oscillators top, sys, pos = load_constraint_coupled_harmonic_oscillators(constrained=True) constraint_coupled_harmonic_oscillators = EquilibriumSimulator( platform=configure_platform("Reference"), topology=top, system=sys, positions=pos, temperature=temperature, timestep=1000.0 * unit.femtosecond, burn_in_length=50, n_samples=10000, thinning_interval=10, name="constraint_coupled_harmonic_oscillators")
self.system = system self.positions = positions n_waters = 20 testsystem = WaterCluster(n_waters=n_waters, constrained=True) (topology, system, positions) = testsystem.topology, testsystem.system, testsystem.positions water_cluster_rigid = EquilibriumSimulator( platform=configure_platform("Reference"), topology=topology, system=system, positions=positions, temperature=temperature, timestep=1.0 * unit.femtosecond, burn_in_length=100000, n_samples=1000, thinning_interval=10000, name="water_cluster_rigid") testsystem = WaterCluster(n_waters=n_waters, constrained=False) (topology, system, positions) = testsystem.topology, testsystem.system, testsystem.positions water_cluster_flexible = EquilibriumSimulator( platform=configure_platform("Reference"), topology=topology, system=system, positions=positions,