In [1]:
%matplotlib inline
import openpathsampling as paths
import numpy as np
import matplotlib.pyplot as plt
import os
import openpathsampling.visualize as ops_vis
from IPython.display import SVG

In [2]:
# note that this log will overwrite the log from the previous notebook
import logging.config
#logging.config.fileConfig("../resources/logging.conf", disable_existing_loggers=False)
logging.config.fileConfig("timed_logging.conf", disable_existing_loggers=False)

Analyzing the fixed path length simulation

We start with the same sorts of analysis as we did in the flexible path length example: we get an overview of the file, then we look at the acceptance ratio, and then we look at the move history tree and the decorrelated trajectories.


In [3]:
%%time
fixed = paths.AnalysisStorage("tps_nc_files/alanine_dipeptide_fixed_tps.nc")


CPU times: user 3min 15s, sys: 1min 33s, total: 4min 49s
Wall time: 1h 3min 59s

In [4]:
engine = fixed.engines[0]
fixed_scheme = fixed.schemes[0]

print "File size: {0} for {1} steps, {2} snapshots".format(
    fixed.file_size_str,
    len(fixed.steps),
    len(fixed.snapshots)
)


File size: 75.45GB for 10001 steps, 3990224 snapshots

In [5]:
# rough estimate of total time
#sum(step.change.details.timing for step in fixed.steps[1:])

In [6]:
fixed_scheme.move_summary(fixed.steps)


shooting ran 100.000% (expected 100.00%) of the cycles with acceptance 4924/10000 (49.24%)

In [7]:
history = ops_vis.PathTree(
    fixed.steps[0:50],
    ops_vis.ReplicaEvolution(
        replica=0
    )
)
print len(list(history.samples))

SVG(history.svg())


28
Out[7]:
+FBBFBBBBBBBFFBFBFFFFBFFFFFBcorstep*16891011131415161922253031323335363940434446474849

In [8]:
print "Decorrelated trajectories:", len(history.generator.decorrelated_trajectories)


Decorrelated trajectories: 4

Note that the number of MC steps (and even more so, time steps) per decorrelated trajectory is much higher than in the case of flexible path length TPS. This is the heart of the argument that flexible path length approaches are more efficient than fixed path length approaches: with a fixed path length, it takes much more effort to get a decorrelated trajectory.