<jupyter_start><jupyter_text>Acceptance Metropolis-Hastings<jupyter_code>modeller = msm.convert('alanine_dipeptide.pdb', to_form='openmm.Modeller')

topology = modeller.topology
positions = modeller.positions

forcefield = app.ForceField('amber10.xml', 'amber10_obc.xml')
system = forcefield.createSystem(topology, constraints=app.HBonds, nonbondedMethod=app.NoCutoff)

explorer = oe.Explorer(topology, system, platform='CUDA')

explorer.set_coordinates(positions)
msm.get_dihedral_angles(explorer, dihedral_angle='all')
explorer.get_potential_energy()
explorer.move.dihedral_shifts()
msm.get_dihedral_angles(explorer, dihedral_angle='all')
explorer.get_potential_energy()
explorer.acceptance.metropolis_hastings(previous_coordinates=positions)
explorer.acceptance.metropolis_hastings.accepted
explorer.acceptance.metropolis_hastings.n_tries
explorer.acceptance.metropolis_hastings.n_accepted
explorer.acceptance.metropolis_hastings.random
explorer.acceptance.metropolis_hastings.weight
explorer.acceptance.metropolis_hastings.potential_energy
explorer.acceptance.metropolis_hastings.previous_potential_energy
msm.get_dihedral_angles(explorer, dihedral_angle='all')
explorer.acceptance.metropolis_hastings._kT
acceptor=explorer.acceptance.metropolis_hastings
acceptor.run(previous_potential_energy=1.0*unit.kilojoules_per_mole,
             potential_energy=2.5*unit.kilojoules_per_mole,
             update_explorer=False)

print(acceptor.weight, acceptor.random, acceptor.accepted)<jupyter_output>0.5589580462161713 0.8290382123279033 False
{'fraction_non_alphanumeric': 0.0933852140077821, 'fraction_numerical': 0.027237354085603113, 'mean_word_length': 9.79020979020979, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '82222', 'license': 'MIT', 'n_tokens_mistral': 578, 'n_tokens_neox': 518, 'n_words': 47, 'path': 'docs/contents/.ipynb_checkpoints/Acceptance-checkpoint.ipynb', 'repo_name': 'uibcdf/OpenMembrane', 'size': '1542'}