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)


CPU times: user 6min 6s, sys: 1.13 s, total: 6min 7s
Wall time: 6min 10s

Now we move on to the analysis.


In [6]:
sim.rate_matrix


Out[6]:
({x|opX(x) in [-inf, -0.3]} and {x|opY(x) in [-inf, -0.3]}) ({x|opX(x) in [-inf, -0.3]} and {x|opY(x) in [0.3, inf]}) ({x|opX(x) in [0.3, inf]} and {x|opY(x) in [-inf, -0.3]})
({x|opX(x) in [-inf, -0.3]} and {x|opY(x) in [-inf, -0.3]}) NaN 0.000113593 7.93139e-05
({x|opX(x) in [-inf, -0.3]} and {x|opY(x) in [0.3, inf]}) 5.23322e-05 NaN 5.16412e-05
({x|opX(x) in [0.3, inf]} and {x|opY(x) in [-inf, -0.3]}) 5.8578e-05 4.93234e-05 NaN

In [7]:
sim.n_transitions


Out[7]:
{(<openpathsampling.volume.IntersectionVolume at 0x11595a290>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a390>): 20,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a290>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a990>): 10,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a390>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a290>): 19,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a390>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a990>): 16,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a990>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a290>): 11,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a990>,
  <openpathsampling.volume.IntersectionVolume at 0x11595a390>): 16}

In [8]:
fluxes = sim.fluxes
for f in fluxes:
    print f[0].name, f[1].name, fluxes[f]


A -inf<opY<-0.3 0.00130918783318
B -inf<opXprime<-0.3 0.00129306050463
A -inf<opX<-0.3 0.00134206626387

In [9]:
sim.n_flux_events


Out[9]:
{(<openpathsampling.volume.IntersectionVolume at 0x11595a390>,
  <openpathsampling.volume.CVDefinedVolume at 0x11593e9d0>): 501,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a390>,
  <openpathsampling.volume.CVDefinedVolume at 0x115952cd0>): 518,
 (<openpathsampling.volume.IntersectionVolume at 0x11595a990>,
  <openpathsampling.volume.CVDefinedVolume at 0x115945b90>): 610}

In [ ]: