In [1]:
%matplotlib inline
import openpathsampling as paths
import numpy as np
As always, we load things from files so we don't have to set them up again.
In [2]:
old = paths.AnalysisStorage("mistis.nc")
engine = old.engines[0]
network = old.networks[0]
states = set(network.initial_states + network.final_states)
The flux_pairs variable is a list of 2-tuples, where the first element is the state we're calculating the flux out of, and the second element is the interface we're calculating the flux through.
In [3]:
flux_pairs = [(trans.stateA, trans.interfaces[0]) for trans in network.transitions.values()]
Set up the simulation and run it!
In [4]:
sim = paths.DirectSimulation(
storage=None,
engine=engine,
states=states,
flux_pairs=flux_pairs,
initial_snapshot=old.snapshots[0]
)
In [5]:
%%time
sim.run(150000)
Now we move on to the analysis.
In [6]:
sim.rate_matrix
Out[6]:
In [7]:
sim.n_transitions
Out[7]:
In [8]:
fluxes = sim.fluxes
for f in fluxes:
print f[0].name, f[1].name, fluxes[f]
In [9]:
sim.n_flux_events
Out[9]:
In [ ]: