TransitionPathway

class mrsimulator.transition.TransitionPathway(data: list = [])

Bases: mrsimulator.transition.pathway.TransitionList

Base TransitionPathway class is a list of connected Transitions.

Example

>>> from mrsimulator.transition import TransitionPathway, Transition
>>> t1 = Transition(initial = [0.5, 0.5], final = [0.5, -0.5])
>>> t2 = Transition(initial=[0.5, 0.5], final=[-0.5, 0.5])
>>> path = TransitionPathway([t1, t2])
>>> path
|0.5, -0.5⟩⟨0.5, 0.5| ⟶ |-0.5, 0.5⟩⟨0.5, 0.5|

Method Documentation

tolist()

Expand TransitionPathway to a Python list.

Example

>>> path.tolist()
[0.5, 0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5]
json() dict

Parse the class object to a JSON compliant python dictionary object.

Example

>>> pprint(path.json())
[{'final': [0.5, -0.5], 'initial': [0.5, 0.5]},
 {'final': [-0.5, 0.5], 'initial': [0.5, 0.5]}]