openpathsampling.analysis.network.MSTISNetwork

class openpathsampling.analysis.network.MSTISNetwork(trans_info)[source]

Multiple state transition interface sampling network.

The way this works is that it sees two effective sets of transitions. First, there are sampling transitions. These are based on ensembles which go to any final state. Second, there are analysis transitions. These are based on ensembles which go to a specific final state.

Sampling is done using the sampling transitions. Sampling transitions are stored in the from_state[state] dictionary. For MSTIS, the flux and total crossing probabilities are independent of the final state, and so the analysis calculates them in the sampling transitions, and copies the results into the analysis transitions. This way flux and total crossing probably are only calculated once per interface set.

The conditional transition probability depends on the final state, so it (and the rate) are calculated using the analysis transitions. The analysis transitions are obtained using .transition[(stateA, stateB)].

__init__(trans_info)[source]

Creates MSTISNetwork, including interfaces.

Parameters:trans_info (list of tuple) – Details of each state-based ensemble set. 3-tuple in the order (state, interfaces, orderparameter) where state is a Volume, interfaces is a list of Volumes, and orderparameters is a CollectiveVariable

Methods

__init__(trans_info) Creates MSTISNetwork, including interfaces.
args() Return a list of args of the __init__ function of a class
base() Return the most parent class that is actually derived from Storable(Named)Object
build_analysis_transitions()
build_fromstate_transitions(trans_info) Builds the sampling transitions (the self.from_state dictionary).
count_weaks() Return the counts of how many objects of storable type are still in memory
descendants() Return a list of all subclassed objects
fix_name() Set the objects name to be immutable.
from_dict(dct)
from_transitions(transitions[, interfaces])
idx(store) Return the index which is used for the object in the given store.
named(name) Name an unnamed object.
objects() Returns a dictionary of all storable objects
rate_matrix(steps[, force]) Calculate the matrix of all rates.
save(store) Save the object in the given store (or storage)
set_observer(active) (De-)Activate observing creation of storable objects
to_dict()

Attributes

all_ensembles All ensembles in the sampling transitions, including special ensembles.
all_states
analysis_ensembles Ensembles from the analysis transitions, excluding special ensembles.
base_cls Return the base class
base_cls_name Return the name of the base class
cls Return the class name as a string
default_name Return the default name.
is_named True if this object has a custom name.
minus_ensembles
ms_outers
name Return the current name of the object.
observe_objects
sampling_ensembles Ensembles from the sampling transitions, excluding special ensembles.
sampling_transitions The transitions used in sampling
__delattr__

x.__delattr__(‘name’) <==> del x.name

__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

all_ensembles

All ensembles in the sampling transitions, including special ensembles.

analysis_ensembles

Ensembles from the analysis transitions, excluding special ensembles.

args()

Return a list of args of the __init__ function of a class

Returns:the list of argument names. No information about defaults is included.
Return type:list of str
base()

Return the most parent class that is actually derived from Storable(Named)Object

Important to determine which store should be used for storage

Returns:the base class
Return type:type
base_cls

Return the base class

Returns:the base class
Return type:type

See also

base()

base_cls_name

Return the name of the base class

Returns:the string representation of the base class
Return type:str
build_fromstate_transitions(trans_info)[source]

Builds the sampling transitions (the self.from_state dictionary).

This also sets self.states (list of states volumes), self.outers (list of interface volumes making the MS-outer interface), and self.outer_ensembles (list of TISEnsembles associated with the self.outers interfaces). Additionally, it gives default names volumes, interfaces, and transitions.

Parameters:trans_info (list of 4-tuples) – See description in __init__.
cls

Return the class name as a string

Returns:the class name
Return type:str
count_weaks()

Return the counts of how many objects of storable type are still in memory

This includes objects not yet recycled by the garbage collector.

Returns:dict of str – the dictionary which assigns the base class name of each references objects the integer number of objects still present
Return type:int
default_name

Return the default name.

Usually derived from the objects class

Returns:the default name
Return type:str
descendants()

Return a list of all subclassed objects

Returns:list of subclasses of a storable object
Return type:list of type
fix_name()

Set the objects name to be immutable.

Usually called after load and save to fix the stored state.

idx(store)

Return the index which is used for the object in the given store.

Once you store a storable object in a store it gets assigned a unique number that can be used to retrieve the object back from the store. This function will ask the given store if the object is stored if so what the used index is.

Parameters:store (openpathsampling.netcdfplus.objects.ObjectStore) – the store in which to ask for the index
Returns:the integer index for the object of it exists or None else
Return type:int or None
is_named

True if this object has a custom name.

This distinguishes default algorithmic names from assigned names.

name

Return the current name of the object.

If no name has been set a default generated name is returned.

Returns:the name of the object
Return type:str
named(name)

Name an unnamed object.

This only renames the object if it does not yet have a name. It can be used to chain the naming onto the object creation. It should also be used when naming things algorithmically: directly setting the .name attribute could override a user-defined name.

Examples

>>> import openpathsampling as p
>>> full = p.FullVolume().named('myFullVolume')
objects()

Returns a dictionary of all storable objects

Returns:dict of str – a dictionary of all subclassed objects from StorableObject. The name points to the class.
Return type:type
rate_matrix(steps, force=False)[source]

Calculate the matrix of all rates.

Parameters:
  • steps (iterable of MCStep) – steps to be analyzed
  • force (bool (False)) – if True, cached results are overwritten
Returns:

Rates from row_label to column_label. Diagonal is NaN.

Return type:

pandas.DataFrame

sampling_ensembles

Ensembles from the sampling transitions, excluding special ensembles.

sampling_transitions

The transitions used in sampling

save(store)

Save the object in the given store (or storage)

Parameters:store (openpathsampling.netcdfplus.objects.ObjectStore or openpathsampling.netcdfplus.netcdfplus.NetCDFStorage) – the store or storage to be saved in. if a storage is given then the default store for the given object base type is determined and the appropriate store is used.
Returns:the integer index used to save the object or None if the object has already been saved.
Return type:int or None
set_observer(active)

(De-)Activate observing creation of storable objects

This can be used to track which storable objects are still alive and hence look for memory leaks and inspect caching. Use openpathsampling.netcdfplus.base.StorableObject.count_weaks() to get the current summary of created objects

Parameters:active (bool) – if True then observing is enabled. False disables observing. Per default observing is disabled.