<jupyter_start><jupyter_text>This is file runs the main calculation for the fixed length TPS simulation. It requires the file `alanine_dipeptide_fixed_tps_traj.nc`, which is written in the notebook `alanine_dipeptide_fixed_tps_traj.ipynb`.In this file, you will learn:* how to set up and run a fixed length TPS simulationNB: This is a long calculation. In practice, it would be best to export the Python from this notebook, remove the `live_visualizer`, and run non-interactively on a computing node.<jupyter_code>import openpathsampling as paths<jupyter_output><empty_output><jupyter_text>Load engine, trajectory, and states from file<jupyter_code>old_storage = paths.Storage("tps_nc_files/alanine_dipeptide_fixed_tps_traj.nc", "r")
engine = old_storage.engines[0]
C_7eq = old_storage.volumes.find('C_7eq')
alpha_R = old_storage.volumes.find('alpha_R')
traj = old_storage.trajectories[0]
phi = old_storage.cvs.find('phi')
psi = old_storage.cvs.find('psi')
template = old_storage.snapshots[0]
print engine.name
print engine.snapshot_timestep<jupyter_output>300K
0.02 ps<jupyter_text>TPSThe only difference between this and the flexible path length example in `alanine_dipeptide_tps_run.ipynb` is that we used a `FixedLengthTPSNetwork`. We selected the `length=400` (8 ps) as a maximum length based on the results from a flexible path length run.<jupyter_code>network = paths.FixedLengthTPSNetwork(C_7eq, alpha_R, length=400)
scheme = paths.OneWayShootingMoveScheme(network, selector=paths.UniformSelector(), engine=engine)
initial_conditions = scheme.initial_conditions_from_trajectories(traj)
sampler = paths.PathSampling(storage=paths.Storage("tps_nc_files/alanine_dipeptide_fixed_tps.nc", "w", template),
                             move_scheme=scheme,
                             sample_set=initial_conditions)
#sampler.live_visualizer = paths.StepVisualizer2D(network, phi, psi, [-3.14, 3.14], [-3.14, 3.14])
#sampler.live_visualizer = None
sampler.run(10000)<jupyter_output>Working on Monte Carlo cycle number 10000
Running for 124921 seconds -  0.08 steps per second
Expected time to finish: 12 seconds
DONE! Completed 10000 Monte Carlo cycles.
{'fraction_non_alphanumeric': 0.08639108221086855, 'fraction_numerical': 0.02693915466790525, 'mean_word_length': 5.903846153846154, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '186414', 'license': 'MIT', 'n_tokens_mistral': 739, 'n_tokens_neox': 674, 'n_words': 190, 'path': 'examples/alanine_dipeptide_tps/AD_tps_2b_run_fixed.ipynb', 'repo_name': 'apdealbao/openpathsampling', 'size': '2153'}