API

analysis

class cmdtools.analysis.pcca.KrylovSchur(onseperation='warn')[source]
solve(A, n, massmatrix=None)[source]
class cmdtools.analysis.pcca.PCCA(T=None, n=None, pi='uniform', massmatrix=None, eigensolver=<cmdtools.analysis.pcca.ScipySchur object>, optimizer=<cmdtools.analysis.optimization.Optimizer object>)[source]
solve()[source]
class cmdtools.analysis.pcca.ScipySchur(onseperation='warn')[source]
solve(T, n, massmatrix=None)[source]
cmdtools.analysis.pcca.gramschmidt(X, pi)[source]

Gram Schmidt orthogonalization wrt. scalar product induced by pi

cmdtools.analysis.pcca.krylovschur(A, n, massmatrix=None, onseperation='continue')[source]
cmdtools.analysis.pcca.pcca(T, n, pi='uniform')[source]
cmdtools.analysis.pcca.petsc_matrix(A)[source]
cmdtools.analysis.pcca.scipyschur(T, n, massmatrix=None, onseperation='warn')[source]
class cmdtools.analysis.optimization.Optimizer(maxiter=1000)[source]
solve(X, pi=None)[source]
cmdtools.analysis.optimization.assertstructure(X, pi)[source]
cmdtools.analysis.optimization.fillA(A, X)[source]

Converts the given matrix into a feasible transformation matrix. Algorithm 3.10 from Weber (2006)

cmdtools.analysis.optimization.indexsearch(X)[source]

Return the indices to the rows spanning the largest simplex

cmdtools.analysis.optimization.inner_simplex_algorithm(X)[source]

Return the transformation A mapping those rows of X which span the largest simplex onto the unit simplex.

cmdtools.analysis.optimization.objective(alpha, X, A)[source]

Equation (16) from Röblitz, Weber (2013)

cmdtools.analysis.optimization.optimize(X, A, maxiter=1000)[source]

optimization of A - the feasiblization routine fillA() requires the first column of X to be the constant one-vector - the optimzation criterion expects X^T D X = I (where D is the stationary diagonal matrix)

estimation

class cmdtools.estimation.galerkin.Basis[source]
class cmdtools.estimation.galerkin.Gaussian(timeseries, centers=None, sqd=None, sigma=None, percentile=50)[source]
property propagator
class cmdtools.estimation.galerkin.TransferOperatorGalerkin(basis)[source]

Class resposible for computing the Monte-Carlo estimates of the Perron-Frobenius and Koopman operators wrt to a given Basis

koopman()[source]

K = M^-1 S

mass()[source]

M_ij = 1/n sum_k=(0,…,n) X_ki X_kj

perronfrobenius()[source]

P = S^T M^-1 = K^T

stiffness()[source]

S_ij = 1/n sum_k=(0,…,n-1) X_(k+1,i) X_kj

cmdtools.estimation.galerkin.find_bandwidth(sqd, percentile=50)[source]

Given the square-distance matrix d_ij = (x_i - x_j)^2 compute the standard deviation s for the Gaussian kernel k(x_i,x_j) = exp(-1/(2s^2) d_ij). The heuristic is based on the assumption that we want sum_j k(x_i, x_j) ≈ n exp(-1/(2s^2) med^2) = 1 and hence (2s^2) = med^2 / log n where n is the number of points and med the pairwise median distance.

percentile allows to shift from the median to an arbitrary percentage and thus influences how many points have an influence on the bandwith.

Heuristic taken from “Stein Variational Gradient Descent […], Qiang Liu and Dilin Wang (2016)”.

Input:

sqd: matrix, pairwise squared-distances of the samples percentile: float [0,100], percentile to use instead of median

Output:

sigma: float, the standard deviation of the Gaussian

cmdtools.estimation.galerkin.massmatrix(membership)[source]

Compute the row-stochastic empirical mass function S_ij = St_ij / sum_j St_ij St_ij = 1/n sum_x phi_i(x) phi_j(x), x in traj cf. ([TGDW2019] eqn 12, [W2006] eqn 35)

Parameters

membership (matrix) – row-stochastic membership matrix of shape (#samples x #basis)

Returns

row-stochastic mass matrix S

Return type

matrix

cmdtools.estimation.galerkin.membership(sqd, sigma)[source]

Given square distances and standard deviation, return the row-stochastic Gaussian membership matrix

cmdtools.estimation.galerkin.propagator(membership, lag=1)[source]

Compute the row-stochastic empirical propagator K_ij = Kt_ij / sum_j Kt_ij Kt_ij = 1/n sum_x phi_i(x) phi_j(y), (x,y) in traj cf. ([TGDW2019] eqn 12, [W2006] eqn 35)

Parameters

membership (matrix) – row-stochastic membership matrix of shape (#samples x #basis)

Returns

row-stochastic propagator P

Return type

matrix

cmdtools.estimation.galerkin.sqdist(timeseries, centers, metric='sqeuclidean')[source]
cmdtools.estimation.sqra.sqra(u, A, beta, phi)[source]

Square-root approximation of the generator (of the Overdamped Langevin model)

u: vector of pointwise evaluation of the potential A: adjacency matrix of the discretization beta: inverse temperature phi: the flux constant, determined by the temperature and the discr.

systems

class cmdtools.systems.diffusion.DiffusionProcess(V, epsilon=1)[source]

Representation of the diffusion process dX = -∇V(X) dt + √(2ε) dW

property beta
stationary_dist_nn(x)[source]

Evaluate the non-normalized Boltzmann distribution at x

class cmdtools.systems.diffusion.DoubleWell[source]
dimension = 1
xmax = 2.5
xmin = -2.5
class cmdtools.systems.diffusion.ThreeHolePotential[source]

The Three-Hole Potential from 2006 - Metzner, Schütte, Vanden-Eijnden - Illustration of transition path theory

dimension = 2
xmax = 2
xmin = -2
ymax = 2.5
ymin = -1.5
cmdtools.systems.diffusion.beta_to_epsilon(b)[source]

utils

cmdtools.utils.example_metastab4()[source]

Return the transition matrix for a simple metastable model. The 4 correpsonding states are [A,T,B,B], where A and B are metastable and T is a transition region

cmdtools.utils.get_pi(T, pi='uniform')[source]
cmdtools.utils.is_rowstochastic(P)[source]
cmdtools.utils.order_membership(m)[source]

order the membership matrix, first comes first

cmdtools.utils.randompropagator(n, reversible=True)[source]
cmdtools.utils.rowstochastic(T)[source]