In [141]:
import numpy as np
import numpy.random as npr
from matplotlib import pyplot as pl
from msmbuilder.example_datasets import QuadWell, quadwell_eigs
from msmbuilder.cluster import NDGrid
from msmbuilder.msm import MarkovStateModel
from sklearn.pipeline import Pipeline

In [142]:
%matplotlib inline

In [3]:
dataset = QuadWell(random_state=0).get()


Saving "/Users/joshuafass/msmbuilder_data/quadwell/version-1_random-state-0.pkl"... (<type 'list'>)

In [7]:
dataset.trajectories[0].shape


Out[7]:
(1001, 1)

In [9]:
pl.hist(dataset.trajectories[0],bins=50);



In [215]:
potential = lambda X : (np.sin(X[0]) + np.cos(X[1])) + np.log(sum(X**2)+1) + + np.log(sum((X-10)**2)+1)

In [216]:
x_range = np.arange(-20,20,0.1)
y_range = np.arange(-20,20,0.1)

In [217]:
n = len(x_range)

In [218]:
mu = np.zeros((n,n))

In [219]:
for i in range(n):
    for j in range(n):
        mu[i,j] = potential(np.array([x_range[i],y_range[j]]))

In [220]:
pl.imshow(mu)
pl.colorbar();



In [220]:


In [221]:
init_pos = npr.randn(2)*10

In [222]:
init_pos,potential(init_pos),potential(np.zeros(2))


Out[222]:
(array([ 10.08855161,  -0.48522252]), 9.6124047189099731, 6.3033049080590757)

In [223]:
from numba import jit, autojit, double, float64, float32, void, int32

In [231]:
potential_jit = jit(double(double[:]))(potential)

In [232]:
potential = potential_jit

In [233]:
# potential must be defined
def random_walk(init_pos=np.zeros(2),step_size=0.1,num_steps=100):
    dim = len(init_pos)
    steps = np.zeros((num_steps,dim))
    steps[0] = init_pos
    current_potential = potential(init_pos)
    for i in range(1,num_steps):
        move = npr.randn(dim)
        # scale move_size by potential difference
        new_potential = potential(steps[i-1] + move)
        frac_change = (new_potential - current_potential) / current_potential
        steps[i] = steps[i-1] + step_size*move*max(0,1-frac_change)
        current_potential = potential(steps[i])
    return steps

In [362]:
# make sure potential is defined

def gradient(x0,h=0.0001):
    y = potential(x0)
    deriv = np.zeros(len(x0))
    x = np.array(x0)
    for i in range(len(x0)):
        x[i] += h
        deriv[i] = (potential(x) - y)/h
        x[i] -= h
    return deriv

def directed_walk(init_pos=np.zeros(2),
                  #init_momentum=np.zeros(2),
                  #mass=1.0,
                  step_size=0.1,
                  rand_size=0.01,num_steps=100):
    dim = len(init_pos)
    steps = np.zeros((num_steps,dim))
    steps[0] = init_pos
    #momentum = init_momentum
    for i in range(1,num_steps):
        grad = gradient(steps[i-1])
        #momentum -= grad/mass * (1+npr.rand(dim)*rand_size)
        #step_size*grad+npr.randn(dim)*rand_size
        steps[i] = steps[i-1] - step_size*grad+npr.randn(dim)*rand_size
        #steps[i] = steps[i-1] + momentum
        current_potential = potential(steps[i])
    return steps

In [334]:
%timeit gradient(npr.randn(200))


10 loops, best of 3: 35.8 ms per loop

In [335]:
grad_jit = jit(double[:](double[:],double))(gradient)

In [336]:
%timeit grad_jit(npr.randn(200),h=0.001)


10 loops, best of 3: 36.5 ms per loop

In [363]:
%timeit dw = directed_walk(step_size=1.0,num_steps=10000)


1 loops, best of 3: 1.01 s per loop

In [364]:
dw = directed_walk(npr.randn(2)*10,num_steps=1000)

In [373]:
paths = []
for i in range(100):
    dw = directed_walk(npr.randn(2)*5,rand_size=0.1,num_steps=50)
    pl.scatter(dw[:,0],dw[:,1],
               #c = np.ones(len(dw))*i,
               #c=np.array([potential(r) for r in dw]),
               c=range(len(dw)),
               linewidths=0,alpha=0.5)
    paths.append(dw)
pl.colorbar()


Out[373]:
<matplotlib.colorbar.Colorbar instance at 0x12e015dd0>

In [374]:
potentials = np.array([[potential(p) for p in path] for path in paths])
potentials.shape


Out[374]:
(100, 50)

In [375]:
end_points = [path[-1] for path in paths]
end_points


Out[375]:
[array([-0.50843477, -0.56218047]),
 array([-1.24440803, -2.77917452]),
 array([-0.86461163,  2.33532827]),
 array([ 4.31326617, -2.79821731]),
 array([ 4.94140157,  3.13687598]),
 array([ 1.86159966, -2.31279603]),
 array([-1.16085836,  9.25061013]),
 array([-8.12985648, -3.19167405]),
 array([ 4.59510944, -8.91501638]),
 array([ 4.43367833, -2.61404957]),
 array([-1.21172158,  2.51618055]),
 array([ 4.48706198, -3.2805926 ]),
 array([-7.43306399, -2.71318632]),
 array([-8.12190327, -9.03316374]),
 array([-1.02689876,  2.52823898]),
 array([ 4.97199246, -8.65351571]),
 array([-1.12062624, -2.04177189]),
 array([ 10.30119358,   3.65340984]),
 array([ 4.49042519,  2.34231121]),
 array([ 4.48582547, -3.07370084]),
 array([-0.67312233, -0.0291552 ]),
 array([-0.40270535, -0.25747685]),
 array([ 4.54646172,  3.30453733]),
 array([-0.95713359, -8.80620337]),
 array([ 4.87992189, -3.04820412]),
 array([-7.95232978,  2.92516379]),
 array([ 4.53948572,  2.30505442]),
 array([-7.60917248,  9.08885731]),
 array([-1.13377111, -2.62328107]),
 array([-7.60370568,  2.98350042]),
 array([-0.9999569 , -2.79475794]),
 array([-1.43811834, -2.17417348]),
 array([ 4.77667928, -9.26430046]),
 array([ 4.59833317, -2.67985587]),
 array([ 4.30091703, -3.02867966]),
 array([ 4.3395891 ,  3.54753243]),
 array([ 4.60995406,  3.1638374 ]),
 array([-0.5995971, -0.3470162]),
 array([ 4.72541257,  3.13956054]),
 array([-1.43842081,  2.98387611]),
 array([ 4.62533028,  2.73693908]),
 array([-14.11537329,  -0.31896044]),
 array([-1.19246217, -1.84571553]),
 array([ 11.06467917,  -3.30331491]),
 array([-7.46040873, -8.8634632 ]),
 array([ 4.46627587,  3.2233695 ]),
 array([-1.57004871, -9.01122712]),
 array([-0.609142  ,  0.86075533]),
 array([ 5.01160529,  9.38862823]),
 array([ 10.75735587,   3.33721932]),
 array([ 4.33297133, -3.16130111]),
 array([-7.29898354,  3.60508511]),
 array([-1.18687898,  2.61245003]),
 array([-0.91795278,  3.00276536]),
 array([-0.52277579,  2.245103  ]),
 array([ 4.71773389,  9.34330425]),
 array([-1.3907955 ,  2.80953653]),
 array([-1.65517036,  8.96941441]),
 array([-1.17889221,  2.99584251]),
 array([ 4.50387264,  2.87804865]),
 array([-1.2733939 ,  2.36712348]),
 array([-13.86432742,  -3.06488038]),
 array([-0.95765352, -9.24023604]),
 array([-0.98831962,  2.45111093]),
 array([ 5.087045  ,  8.78436468]),
 array([-1.47075687, -9.04614428]),
 array([ 10.89181281,  -2.7989293 ]),
 array([-0.96448926,  8.75719333]),
 array([ 4.22635044, -2.85442964]),
 array([-1.06084707, -1.94488598]),
 array([ 10.33168017,  -3.06648951]),
 array([-1.15250351, -2.50194767]),
 array([-13.83848237,  -3.16906594]),
 array([ 4.14674969, -2.69358687]),
 array([-0.69161626,  2.55513168]),
 array([ 4.65012044, -9.0829632 ]),
 array([-1.17084522,  2.58960488]),
 array([-1.10579623,  2.3364593 ]),
 array([ 11.0864594 ,   3.08306731]),
 array([-1.26270372,  2.36555626]),
 array([-1.90617726,  8.82541008]),
 array([ 4.36141687, -2.71321038]),
 array([-0.99498814, -2.24356515]),
 array([-7.87461457,  3.17987354]),
 array([ 10.40573299,   9.75394924]),
 array([ 4.51454855,  3.25848729]),
 array([ 4.24073184,  3.07372873]),
 array([-0.64520253, -1.63777225]),
 array([-1.17252902,  2.27929619]),
 array([-1.42898586,  8.65912459]),
 array([-0.9268007 ,  1.92169285]),
 array([ 5.21606571,  9.31565377]),
 array([-1.56271695, -8.96751946]),
 array([ 3.97024676, -2.88335438]),
 array([-7.26933165, -2.81511881]),
 array([ 4.84839887,  3.79083225]),
 array([-1.11872015, -2.49485825]),
 array([-1.15105401,  2.45075852]),
 array([ 4.5569494 , -9.32475898]),
 array([ 10.34798605,   9.71883166])]

In [376]:
potentials[:,-1]


Out[376]:
array([  6.22036839,   6.11965146,   5.70180666,   6.73264781,
         5.88868942,   7.95445352,   7.41171051,   8.60852379,
         8.71596001,   6.74117977,   5.63564467,   6.83382033,
         8.47579294,   9.65149551,   5.64447194,   8.85255184,
         6.10321958,   6.87358234,   6.10987383,   6.75777657,
         6.12338293,   6.14888621,   5.83605798,   8.90582119,
         6.83339872,   8.23831262,   6.13788747,   8.78078192,
         6.09100133,   8.14541488,   6.15652031,   6.12980853,
         8.7021072 ,   6.74174874,   6.76003242,   5.94178054,
         5.8203838 ,   6.16358068,   5.83147005,   5.70262624,
         5.89637213,  11.78513072,   6.14775198,   8.10381172,
         9.63159894,   5.82915411,   8.73019575,   6.11092247,
         6.05154948,   6.72613935,   6.7942647 ,   8.29666469,
         5.62936263,   5.73114006,   5.86581419,   6.08757175,
         5.65939252,   7.46509792,   5.68187907,   5.84874229,
         5.66388917,   9.95949615,   8.86544287,   5.65735779,
         6.19379376,   8.7236637 ,   8.0209848 ,   7.56780063,
         6.74913047,   6.12169048,   8.12523174,   6.07503631,
         9.9659117 ,   6.77128463,   5.74975543,   8.69072338,
         5.63002018,   5.66188159,   6.81181297,   5.66280125,
         7.61384226,   6.73127895,   6.09241436,   8.1984685 ,
         3.74590297,   5.82982181,   5.8674414 ,   6.26284825,
         5.67446801,   7.53960454,   5.79457534,   6.06767926,
         8.73536992,   6.83294432,   8.48101607,   6.06416314,
         6.0770787 ,   5.64194876,   8.7073974 ,   3.73874874])

In [377]:
for path in potentials:
    pl.plot(path)



In [372]:
rw = random_walk(step_size=1.0,num_steps=10000)

In [235]:
%timeit rw = random_walk(step_size=1.0,num_steps=10000)


1 loops, best of 3: 543 ms per loop

In [236]:
rw_jit = jit(double[:,:](double[:],double,int32))(random_walk)

In [240]:
%timeit rw = rw_jit(init_pos=np.zeros(2),step_size=0.1,num_steps=10000)


1 loops, best of 3: 544 ms per loop

In [358]:
rw = random_walk(step_size=0.3,num_steps=10000)

In [359]:
#pl.plot(rw[:,0],rw[:,1],color='grey')
pl.scatter(rw[:,0],rw[:,1],c=np.array([potential(r) for r in rw]),linewidths=0,alpha=0.5)
pl.colorbar()


Out[359]:
<matplotlib.colorbar.Colorbar instance at 0x12c2147a0>

In [360]:
pl.plot(np.array([potential(r) for r in rw]))


Out[360]:
[<matplotlib.lines.Line2D at 0x12c406510>]

In [177]:
np.array([potential(r) for r in rw])


Out[177]:
[1.0,
 0.87313219853077473,
 0.84653225168705659,
 0.86839898577548669,
 1.0380384472592481,
 1.0473957897412411,
 1.2416095077443967,
 1.4120765786826246,
 1.6168029054226052,
 0.94414745339971862,
 1.1320626590244718,
 1.5783288657598593,
 0.88325619677745082,
 1.0362015256762209,
 1.1838472026105702,
 1.3441097685747043,
 0.69832400867265698,
 0.6639513026965469,
 0.65380559286495799,
 0.68635843262740082,
 0.69554756695705744,
 0.68936610771941909,
 0.7470121257528497,
 0.7664213407139111,
 0.49538897432419526,
 0.49771877771533823,
 0.58712838544857981,
 0.63811739839453674,
 0.70123011204590524,
 0.45727338319368771,
 5.577389348303484,
 4.9079510047238237,
 5.0625761231621835,
 4.9713713546977401,
 4.6751046241442564,
 3.9064743527447843,
 3.836457275199705,
 3.24938727698478,
 3.5352200524751227,
 4.5393691773567273,
 4.6501896689809721,
 5.8445444821709573,
 4.4908174273710229,
 3.9092365738158938,
 3.5859361501658666,
 4.3590451213619819,
 3.9636906280309629,
 3.5391785415784054,
 3.7330592807388263,
 4.0213113778245182,
 3.0660839302883258,
 3.304216826503195,
 3.5336979152891619,
 3.9824712832804039,
 4.4219201077166561,
 4.5598540933536604,
 4.5453284588595935,
 4.8000860724321281,
 4.2359115965844216,
 4.5694812016100217,
 5.4827220245021442,
 5.5003912624586846,
 4.6215062761363406,
 4.6261889679782593,
 5.1787039300585223,
 5.0080480612983429,
 5.8514391218028319,
 5.7193643329871477,
 5.3515496433525085,
 5.468083988834338,
 5.5652556927116361,
 6.1420705038106815,
 5.6009750918359034,
 7.0079125298337219,
 5.6893012377781282,
 5.0398315700550684,
 5.3841401440708339,
 5.4744539647443986,
 5.4011296947523375,
 3.7679089365989142,
 3.9216790435346116,
 4.417057233959186,
 5.4601979156345921,
 3.9027580864710547,
 3.8837727035223781,
 4.0148914981103818,
 4.6893447125885759,
 5.5403096825867095,
 5.6119770432042273,
 6.3419518586996739,
 5.8096672392378981,
 4.8247333428456551,
 4.1014119613341506,
 4.2104289136118727,
 3.9985102613398791,
 4.6439761630330452,
 4.2785996132641175,
 4.3643232943918822,
 4.1620154784226155,
 4.6475219808201826,
 4.0912322187424675,
 5.0331226107551315,
 4.3507721232700964,
 3.9005695343581506,
 3.6824656524114512,
 3.8827666164175927,
 4.2059189332575597,
 4.7319272623164572,
 4.1943133409480069,
 5.5204772561182027,
 5.5151451995066028,
 5.2122539411719249,
 5.3512884617140326,
 3.7862863932751005,
 3.7479304172259846,
 4.4582227808426023,
 4.3409288732644802,
 4.5998030240941183,
 4.953678574126533,
 4.6161728049401258,
 4.6810216949238823,
 4.5107469564694416,
 3.7489226344224722,
 3.9418555260608112,
 3.7574080465593838,
 4.2674467663267279,
 4.8712747096027993,
 5.2988822596467413,
 5.4361751951027477,
 5.2886449162057065,
 3.9691757410325934,
 3.7472087487349377,
 4.2338105330380467,
 4.5845402737305019,
 5.4114534917450028,
 4.3418141922570808,
 3.3972238329295488,
 3.2151234552425496,
 3.9508017930836647,
 3.5573595648952656,
 4.2941206906973752,
 4.6637303451146526,
 4.5416287511325404,
 4.7047828869144794,
 4.5769660972057773,
 5.3864431069132737,
 4.2437408951538966,
 4.9931623902909301,
 5.5544144397478146,
 5.6699000737015632,
 5.2951357411419044,
 5.2281381759005203,
 5.560310821875647,
 6.0148279520612151,
 5.0547919163740698,
 4.9152622648891686,
 3.7457652688418062,
 4.4793797633474579,
 2.0794892034022956,
 1.6868244576826836,
 1.9378575065698418,
 1.770083134724648,
 0.79717898747947258,
 0.69524531823257063,
 0.50849503187987999,
 0.56977093496411069,
 0.56318726985696199,
 0.5627527222076969,
 0.58849007672259468,
 0.4708699486436807,
 2.7323085334163393,
 1.3823483194185715,
 1.4399860851627053,
 1.5071363448912738,
 1.7854126448839964,
 0.7047723015037417,
 0.72253909137028449,
 0.69065922097523202,
 0.66093885742909786,
 0.63273161797534661,
 1.0904062022803787,
 0.95288862296105259,
 1.0180201738783423,
 0.74820784573917365,
 0.74229468456133452,
 1.5439175458347609,
 1.5521706017490964,
 3.4492594213822025,
 3.4417255047345234,
 2.6506670322627159,
 2.6705847893890136,
 2.1377331616704849,
 2.193439778709132,
 2.2651912334371911,
 1.6083567131329923,
 0.91565715197395803,
 1.276346874198897,
 1.8901116664911604,
 1.743260714962084,
 2.0667777159260274,
 2.5264850498161544,
 1.7559300707934988,
 1.8223816327958509,
 1.5349856831331712,
 0.69056225588136733,
 0.7992473993684639,
 0.81213144788399139,
 0.61400838127952118,
 0.43682504048351545,
 4.229173003058742,
 5.1552277794338686,
 4.6234472735336505,
 5.1956477942777912,
 4.9508814192401056,
 3.8457386993023879,
 3.9316316939313438,
 4.8013692968125312,
 3.6343612698506123,
 3.9953918981267629,
 3.6015540295001363,
 3.1006150426288603,
 3.5797611660294328,
 3.6858587195018799,
 2.6171974318903617,
 2.8884601589942998,
 3.3704065456088625,
 3.1573539105955346,
 3.7572494501448901,
 3.7881786681694289,
 3.777050221847456,
 4.1700474657462889,
 4.5077348902564118,
 3.9651553729468918,
 3.3763768734105621,
 3.2215577081133127,
 3.4091882231042234,
 3.648621827287335,
 4.3142781201133094,
 4.3818870439414841,
 5.7994095668868972,
 5.9245954470579605,
 6.7300474410667963,
 5.1479886115028197,
 5.6581183926232512,
 5.5698689058203374,
 5.7219679273862862,
 5.7417725084738134,
 7.0290717039542745,
 7.1159081533518389,
 7.1993122683597992,
 6.1597513068957834,
 6.6763255683058684,
 4.0161677721167264,
 4.5416613270317221,
 4.9175903828276954,
 4.966611152064802,
 5.467472833561537,
 5.1047541544464696,
 5.0784343910821654,
 5.1450368278593048,
 5.9835003804646414,
 6.3971414177539767,
 4.9739511250916673,
 4.3068329283944164,
 4.3610870287567449,
 4.4814303840528087,
 3.6025874740876005,
 3.8305869674255835,
 3.5148835674076002,
 3.6347941582215388,
 4.1401734215225048,
 4.1642367061953109,
 4.5811303672569652,
 5.4173449631706792,
 4.768932994951542,
 5.0161713190635338,
 5.2158393680734632,
 5.7369121390525395,
 5.4030553119142564,
 4.4433586237830971,
 3.6531908534906838,
 3.9166092262059933,
 4.3745896260166823,
 5.1365847970097924,
 4.4281405020999882,
 4.7893806570244184,
 5.2721288932893824,
 4.3873847721108721,
 4.3994826334486872,
 3.7024989598125222,
 3.6172667853220712,
 4.3137404208297463,
 4.6421761590943049,
 5.4323461557835824,
 4.8911823805705463,
 4.6795951964409701,
 5.4032159563498183,
 4.8745987437585878,
 4.6152546809715016,
 5.0618681956189713,
 5.1773328011044146,
 3.9176641557254834,
 4.4544488025865281,
 4.0696029535362941,
 3.8850598759034343,
 4.431874143947379,
 4.9282577930151019,
 4.1520771881356051,
 4.5450077377998861,
 4.3873011278371408,
 4.8555663176821477,
 5.2841217870926362,
 4.95251377016859,
 5.1810867715784603,
 5.0324702493331692,
 5.397840128012934,
 6.1111321317155793,
 6.4392954686876047,
 5.9191852311594282,
 5.5222435437813573,
 4.9152292586453576,
 6.2469634776656582,
 5.4615690799275614,
 5.2472079311595943,
 3.9654927739947006,
 4.3464870827424162,
 4.2459005914032151,
 4.7814004644838333,
 4.0741799183216711,
 4.9815798558595503,
 5.9675246422907211,
 6.2544296952880352,
 7.3128025151545639,
 6.5838095353539279,
 6.0460925419953604,
 6.0330251327571744,
 6.3407425770570383,
 6.2111029832461622,
 5.5370609321497009,
 6.0792738119909826,
 6.0906157794838691,
 5.8642347474072842,
 5.7267580510474358,
 5.1316947800926229,
 4.1224436611864164,
 4.8492385501981969,
 5.8125568600727693,
 6.8853447107379306,
 7.6401650450888043,
 7.156548773066886,
 6.3847827368608643,
 7.0412389576158692,
 5.8396259661268051,
 5.4533308421343136,
 3.7400372454774917,
 3.7907015572481457,
 4.1774062882856615,
 4.856960718016186,
 6.1295583999913816,
 4.7472824132434317,
 4.9147404007241224,
 5.7536374543394393,
 4.1175410186375903,
 3.666867583153,
 3.7901707451452689,
 3.9930280372801015,
 4.1239028589651712,
 4.3569471597946965,
 3.6620685657135299,
 4.197542307373662,
 4.5054229373266477,
 4.5338857479051242,
 4.1750167312636011,
 4.2802723648357919,
 5.2857162383410836,
 5.7045244449898798,
 5.7205422455758628,
 6.4086401352924414,
 6.9699121529899362,
 4.806003350974045,
 5.5137927644423126,
 6.5277357041862993,
 5.3777603422110163,
 4.4922803778434579,
 4.285206545337684,
 4.9171840713430415,
 4.8116926351736096,
 5.9033798097458412,
 4.1388211998384197,
 4.6852296474317523,
 5.3252420632450947,
 4.7027593067693108,
 4.3490902706390937,
 4.4480365437213978,
 3.3831484687057172,
 3.4238343082804317,
 4.1557979005177286,
 4.3531859690397612,
 4.3529774641757557,
 4.9489573373180233,
 5.6224960299620355,
 3.6443123834469651,
 4.411813192196461,
 3.5838275589836353,
 3.0299848640815448,
 3.676844046770257,
 4.4920061376857445,
 4.8518404427117945,
 4.9418377570886767,
 5.5325000425156032,
 5.2207593621244719,
 6.3525491483696275,
 5.8931972397350201,
 6.1108524301200946,
 5.4693993830632426,
 4.4490269567448921,
 4.9630945365094572,
 5.9899340499533613,
 4.8896479141321025,
 5.8727481945162499,
 5.2430413804183047,
 5.5456151201852384,
 6.6289185906550818,
 5.7604861918840076,
 6.1972967971699662,
 6.3823065643429429,
 6.5036233580668625,
 6.6264616461473018,
 6.5089669351371402,
 4.6362735961542318,
 4.8882977777376704,
 4.5899991638398028,
 5.8220499442605815,
 5.9253627427122613,
 4.3087252015991009,
 4.7740420946117528,
 4.3288394383557485,
 4.2749818632068397,
 4.7932011459546313,
 5.5986833985070428,
 5.8467227709284737,
 5.7112201085541594,
 6.1887712912613004,
 6.5610608631448315,
 5.4546857405154725,
 4.1512388074179167,
 4.9527347239522568,
 5.0162587526290556,
 5.512875255462971,
 6.2436647523334301,
 4.6282669234946097,
 5.4078064754575976,
 4.8218188089624618,
 6.3123704144305295,
 7.3311541693313309,
 7.3599965411574821,
 7.622775133672274,
 6.7717843015207571,
 7.1017571222233187,
 7.0825728851215963,
 5.4034304322781885,
 5.8442532281151669,
 4.8189316185238082,
 5.277279871593139,
 5.1173836770412855,
 5.253442902504089,
 5.297068729633116,
 5.2359350637019286,
 4.7488502863200965,
 5.1584432663129194,
 5.5101447252858788,
 5.4470211282537333,
 5.4408091732537729,
 4.9596956703800803,
 6.152942447383559,
 5.4600715503755293,
 4.9323593415066522,
 4.7297283777969028,
 4.7511700452694186,
 4.6589298632721388,
 4.945325379082349,
 4.7826379087544284,
 5.2165717939605312,
 6.0153626597994361,
 5.8640775125107778,
 6.7452262892009172,
 6.183635279502079,
 5.7481133706653695,
 6.6144836618072249,
 6.9466051670522546,
 7.5742362171429694,
 7.864607290497557,
 6.7482278143321519,
 5.7448848121000493,
 5.6949174157860423,
 6.786032289412903,
 7.4625878427429422,
 7.1915669364744392,
 5.473151928174822,
 5.1854141856669536,
 5.4939835818015519,
 5.8028008777960993,
 6.846608834813777,
 5.9105780199524656,
 6.8053952863563536,
 6.8414988753658363,
 5.1257580431517571,
 4.2143702404592958,
 4.0827778243921866,
 4.4932839598483865,
 5.7860875047885507,
 3.89495024303063,
 4.6647542739392511,
 3.850361722296805,
 4.74562196344284,
 5.4823455718273477,
 5.6702361677263298,
 6.2581422886908982,
 7.0486269370596126,
 6.8519357309668294,
 5.111844207655901,
 5.8235545981358294,
 6.1737354974545005,
 4.4142627837725641,
 4.6415380830762007,
 5.4287284615592259,
 5.2904237576361206,
 4.7626194714164107,
 5.9974209384230033,
 6.4427881883655616,
 6.720031868268026,
 6.6708665205107431,
 5.4745288177652558,
 5.906833398809022,
 6.5436488143930767,
 7.0809137104671187,
 6.6888882491623445,
 7.346485282171642,
 7.3639078112756788,
 6.6457223833100052,
 5.7233736188015616,
 4.2521781845741309,
 4.91140569945712,
 4.6211663607291102,
 4.1997704338763953,
 4.8682505975811932,
 4.4748157562258983,
 3.9204151229829609,
 4.7049130651301336,
 5.7501709752419741,
 6.3532488105924658,
 4.8339373876262721,
 5.3379185953434698,
 5.583532319418353,
 5.8835760235801917,
 5.2431156202443345,
 5.2412357254437234,
 4.4643625022757121,
 5.2436862486327271,
 5.7165879284257821,
 5.7749384356772486,
 6.7509076884809769,
 6.5350495164696447,
 3.8623138724949899,
 3.1522465083714839,
 3.3953072185610846,
 3.6060907809445704,
 3.435402708031086,
 3.5562350466777835,
 3.8647248041101383,
 4.2826642792884488,
 5.2151724333503537,
 5.1460126853746413,
 5.0196391383552719,
 4.6242452891026478,
 3.4403986597167782,
 3.5917220023888632,
 3.6188822317486959,
 4.5104092123705479,
 5.0726983837765918,
 5.1826949919655032,
 4.9745869058359844,
 4.672783876597653,
 6.0764181577103251,
 6.463722715376047,
 6.3769472860698295,
 5.4530730156591982,
 5.4335882957696251,
 5.3437238302259127,
 4.2060184847849662,
 4.2324426607659271,
 4.7240886189832114,
 5.727669932169718,
 6.7494255062941262,
 7.1496161086441106,
 6.2230750173630414,
 5.5363006572653948,
 5.4958697508728118,
 5.2389476731272389,
 5.9502134084398097,
 4.7761642309468986,
 4.1471322072141472,
 5.062388806387208,
 5.2268529535943573,
 5.6951095668574716,
 5.1033242231515938,
 3.8007806434834608,
 4.174274571517385,
 4.4606807494176914,
 3.71861154980708,
 4.1103493519761276,
 4.4188760025766172,
 4.3531651537046816,
 3.7204240557957684,
 4.0959515363157752,
 4.7596830338818359,
 4.7316396845506503,
 3.6863269900630389,
 4.2320356063973543,
 4.157404976036009,
 4.2211304221373904,
 5.0835576784356284,
 5.4628979266501556,
 5.4237595830199004,
 6.1078844699641346,
 6.7794004427878427,
 5.2863874355828901,
 5.3614537185288471,
 5.4332344647440136,
 4.4056880797108695,
 4.8432820861521746,
 5.1610177843407303,
 4.7048051288447503,
 4.9328652641922872,
 3.0582137348311864,
 3.5586696198890841,
 3.6231519710717341,
 3.1868388359066526,
 3.4530685854424616,
 3.7925698223244857,
 4.3358682161768796,
 4.9455055338007341,
 4.4305547994294665,
 5.484889410074457,
 5.6705880608933725,
 6.6007902011568342,
 6.6024312170813966,
 6.9682877112105563,
 7.0951042783871987,
 6.6186973891549279,
 6.8621601697617605,
 3.6390805960231045,
 3.9747505498842677,
 3.3131491690399599,
 3.5386493188865882,
 3.0318117519797845,
 3.4113593522595242,
 3.090230635463366,
 3.1175957881801137,
 3.2459590786662296,
 3.3043349101746626,
 3.4396718270401889,
 3.3036673069264713,
 3.8085133617146978,
 3.4988066171439001,
 4.0685109631021756,
 4.9836383981675265,
 4.3075841995608677,
 2.5598538291128015,
 2.3448453319806966,
 2.7185255848295213,
 3.2628545289346036,
 2.6139108925761096,
 3.1118749490269666,
 3.6632348890806137,
 3.2595981475683162,
 3.2449551760379429,
 3.6193077786015344,
 2.6963907892489738,
 3.2993391439034152,
 3.9453128153397747,
 3.9446166527857507,
 2.525081246556792,
 2.7041558377141994,
 2.936828042300633,
 3.0025773020166668,
 3.6642324336004077,
 3.9760444743727428,
 3.4112749490163949,
 3.8356897799532499,
 2.3596027680842915,
 2.7731335872610101,
 2.579626880171968,
 3.0477482605652666,
 3.3270053077620259,
 2.8471421059378819,
 2.5998266609520515,
 2.7562030914054954,
 2.753885694721224,
 2.3241941370355566,
 2.7505794333446718,
 2.9875012424513518,
 2.8722387832745744,
 3.2724188692789848,
 3.0356066291533477,
 3.5933764089221851,
 3.0864829918444534,
 3.2314390523219143,
 3.4516649187167472,
 3.316108987386305,
 4.3145844007148106,
 4.5504515034791879,
 3.4737035106852825,
 2.8459018324395271,
 3.3937358436291181,
 4.3082512513105868,
 5.1487847777444093,
 4.9913058648976882,
 2.1226362338251721,
 2.4747561308216977,
 2.5871150138829915,
 1.9271780187491367,
 0.80707390815265345,
 0.58821444730363881,
 0.65620006768193684,
 0.69533981834399627,
 0.73481754538631927,
 0.74951991092989478,
 4.0478933480921544,
 4.8460262951343944,
 5.0465161751225107,
 4.8776701001856742,
 4.5730119274115388,
 5.0769369454655964,
 5.1949952163218986,
 4.9247987473150685,
 3.4404147734882402,
 2.9005816767251034,
 1.3844627298904921,
 0.43490689508059743,
 0.43657769444695305,
 2.3532788099693542,
 2.6353733845556526,
 3.1679385563104461,
 3.0939205446677533,
 0.96034078876732609,
 0.6545285737008828,
 0.63205450757784032,
 0.61913389566795773,
 1.5672531079948173,
 1.7322589129438331,
 1.5915464607085106,
 2.0771494024063757,
 2.4560529539751004,
 2.5566264304318489,
 1.7290286567944082,
 1.5131999238933584,
 0.7842255615630942,
 0.49979359781786403,
 4.6805659498531975,
 3.9382277433268502,
 3.8890425995330964,
 4.562582186925388,
 5.3649117974256431,
 4.1288806319065854,
 3.779984050917776,
 3.5334452594218551,
 4.1736341505292875,
 4.786230339665388,
 4.8188858590406074,
 4.0247350295605777,
 3.5270280816538944,
 1.6584562945424035,
 0.8247658362584962,
 0.71886612451239518,
 0.69124868253826333,
 0.90317872578911695,
 0.85487012481049041,
 1.0185738628253591,
 0.9034990041325156,
 5.0395006726328795,
 4.5156517366403515,
 4.0352592569070422,
 4.1468049492766639,
 2.8253313012057393,
 2.4556348886638255,
 2.7861132232304202,
 3.5376677479528036,
 4.2490453652037319,
 2.7314056599180043,
 2.5041820144915237,
 1.4617482308480683,
 1.6752380235807935,
 1.2212701957656185,
 0.93485847161670765,
 0.92044507623922778,
 0.89411165217001476,
 1.0809231070815759,
 0.89099360808654815,
 0.98260124436762175,
 0.85554602024036841,
 0.56790652925583007,
 0.58665495634009934,
 0.60831485041296451,
 0.76457089242298926,
 0.86742860763264029,
 0.85828480116318584,
 0.61031076132721607,
 2.3426074151907192,
 1.3285257787103864,
 1.5649015227572098,
 1.9113855871876961,
 1.6215635802157087,
 1.5539942410246528,
 1.5935091676380861,
 1.5298987087236688,
 1.2747999222107855,
 0.74053907668394769,
 0.48887197820025419,
 1.5753575313672945,
 1.8702234941913489,
 1.159784590774287,
 1.3355780974459468,
 1.4022738039489797,
 0.65020216441592482,
 0.63673228135116222,
 0.53542041507186311,
 0.47285383619198917,
 0.56256918340120099,
 0.60775696536048684,
 0.66947973622219781,
 1.9927047601643344,
 2.4247978448386958,
 3.0579521578351025,
 3.913724633523588,
 2.8776664087580306,
 3.4926617740258425,
 1.1798069087733432,
 1.2153758350073913,
 1.4966518130650788,
 1.8181286234293532,
 1.9497098593157176,
 1.0975707935556809,
 1.7434333808113158,
 2.1496965117699633,
 2.1436236005492169,
 2.7002687108842234,
 2.4625842224042831,
 2.0249556991635176,
 2.5302451898124709,
 2.2887225253969969,
 2.5481094338231642,
 3.8805377223692261,
 3.9617196025854464,
 2.9703362188484714,
 3.5548713444348308,
 4.4380069633843151,
 3.5983253653318856,
 4.2580060681597649,
 4.4806040923643469,
 3.0370903464534842,
 2.6898284186431116,
 2.6224487739482916,
 3.0602599557252463,
 3.3271079071587897,
 2.8215706030354188,
 2.6179655758223275,
 2.6978530417555824,
 2.8485180664613807,
 3.0417084941963672,
 3.6286770525658252,
 3.898826232475046,
 4.7329549138849147,
 5.5742928958189415,
 6.0555835667098057,
 5.0099404727929633,
 4.8150492716546465,
 5.8301953825410822,
 6.3406234917842497,
 5.2825626370443892,
 4.5376903929145573,
 5.165823772807018,
 4.2357474685602678,
 3.2953429626542698,
 3.1281631010343585,
 3.418045958357451,
 3.6673097718450718,
 3.6465391779244878,
 3.5795223243832899,
 3.5450696408598703,
 3.9311618670127295,
 4.7717101581999799,
 5.3692936641847373,
 6.6441995377573617,
 5.2133658728560448,
 6.2324292216805235,
 5.6204178488840828,
 6.714883223779383,
 7.0144337251751772,
 6.5750476710075869,
 5.4110926159870019,
 5.7994740899197792,
 7.035941273262214,
 6.0066944581502248,
 4.8739229077445598,
 5.2701962391778165,
 4.9028527283665984,
 5.025073251109446,
 5.132367676140313,
 5.1823388025414561,
 4.9819326871260881,
 5.5371358710601335,
 6.5089820020976408,
 5.2190198663766605,
 4.6055465416640073,
 4.3985667126146852,
 4.6082568209325272,
 3.7925780286218052,
 3.7455746642310519,
 4.0216317357576106,
 4.1257705191524581,
 5.319806696921594,
 5.5696512786024961,
 7.0368584756868113,
 7.6698388644241131,
 5.1100342604266178,
 5.8776344730130514,
 6.2910470885984449,
 6.6449495431170762,
 6.0186466957862885,
 5.7369850083430194,
 6.058537478070912,
 4.7841191126680176,
 5.1383370128940555,
 6.1407020071678353,
 6.6758906039572832,
 7.4815463453461311,
 6.9395045396824671,
 7.4399520893139339,
 6.9341157118287624,
 5.1915902776507954,
 4.0565553676622521,
 4.2050943809124854,
 5.2201901835220967,
 5.229558263314555,
 5.7148461414506091,
 6.2078978135333287,
 4.4390834767520015,
 3.8744488518150586,
 4.6588516596498017,
 3.9650346909406977,
 3.7348527797445774,
 4.3199839474412816,
 4.012871381764322,
 3.2506624568888638,
 3.4857310539639474,
 3.1036871941060307,
 3.1159543176796838,
 3.0312211725296523,
 3.548119206144821,
 3.3591098611897023,
 4.2841898073717397,
 3.7512213217301085,
 4.3479180498252417,
 5.4233488537286556,
 3.8711921693114144,
 4.0256273930217299,
 4.8598314679832022,
 4.5144793546706374,
 4.1986268193961518,
 5.0230580685544091,
 4.730461061024247,
 3.1634518818695785,
 3.2347428576879311,
 3.2218125194291636,
 3.7600713942976536,
 4.485189681559449,
 4.9138922336772524,
 4.4431716167230775,
 4.2436922110996695,
 4.5963753160815166,
 4.7146571718445722,
 4.6462733713879736,
 4.9537761888842855,
 5.7562073838329963,
 3.9662525167034466,
 2.6160068086400159,
 3.3125756306236616,
 3.8349219295409296,
 4.6954960435524686,
 5.0793396461808689,
 4.0617158393085386,
 4.6502793963929783,
 3.6619608898375224,
 3.8584954610778568,
 4.8001038995586276,
 5.0329597005281643,
 4.9159558322718393,
 4.7280281313222412,
 2.9803914231265898]

From the MS-SR-TIS paper:

Wang-Landau MSTIS: Initialization:

  1. Define database of stable states $I$
  2. Define each stable state $I$ by an interface $\lambda_{0I}$ and a set of TIS interfaces $\lambda_{iI}$
  3. Select a stable state configuration as an initial configuration
  4. Create an initial path using the minus interface move and set the current interface to 0 (the minus interface)
  5. Set all the DOPs to 1 ($\ln DOP = 0$)

Main loop: repeat one of the following moves in random order with specified frequncy:

  1. Shooting move: select random slice from the path, change its momentum, integrate forward and backward in time until (stable state found or path exceeds max length)
  2. Reversal move
  3. Interface exchange move
  4. State swap

Adaptive version:

adaptively add to the database of stable states $I$ somehow, e.g. by cluster analysis, potential minimization, etc.


In [ ]:
path = r