mics

mixtures

class mics.mixtures.mixture[source]

A mixture of independently collected samples (MICS)

Parameters:
  • samples (list or tuple) – a list of samples.
  • title (str, optional) – a title.
  • verbose (bool, optional) – a verbosity tag.
  • tol (float, optional) – a tolerance.
free_energies(reference=0)[source]

Returns a data frame containing the relative free energies of the datasetd samples of a mixture, as well as their standard errors.

reweighting(potential, properties={}, derivatives={}, combinations={}, conditions=Empty DataFrame Columns: [] Index: [], reference=0, **kwargs)[source]

Performs reweighting of the properties computed by functions from the mixture to the samples determined by the provided potential with all parameter values.

Parameters:
  • potential (string)
  • properties (dict of strings)
  • combinations (dict of strings)
  • derivatives (dict of tuples)
  • conditions (pandas.DataFrame)
  • verbose (boolean)
  • **kwargs

samples

class mics.samples.pool(label='', verbose=False)[source]

A pool of independently collected samples.

class mics.samples.sample(dataset, potential, autocorr=None, label=None, batchsize=None, verbose=False, **kwargs)[source]

A sample of configurations collected at a specific equilibrium state, aimed to be part of a mixture of independently collected samples (MICS).

Args:
dataset (pandas.DataFrame):
a data frame whose rows represent configurations datasetd according to a given probability distribution and whose columns contain a number of properties evaluated for such configurations.
potential (function):
the reduced potential that defines the equilibrium sample. This function might for instance receive x and return the result of an element-wise calculation involving x[“a”], x[“b”], etc, with “a”, “b”, etc being names of properties in dataset.
autocorr (function, optional):
a function similar to potential, but whose result is an autocorrelated property to be used for determining the effective dataset size. If omitted, potential will be used to for this purpose.
Note:
Formally, functions potential and autocorr must receive x and return y, where length(y) == nrow(x).

utils

mics.utils.covariance(y, ym, b)[source]

Computes the covariance matrix of the rows of matrix y among themselves. The method of Overlap Batch Mean (OBM) is employed with blocks of size b.

mics.utils.cross_covariance(y, ym, z, zm, b)[source]

Computes the cross-covariance matrix between the rows of matrix y with those of matrix z. The method of Overlap Batch Mean (OBM) is employed with blocks of size b.

mics.utils.genfunc(function, variables, constants)[source]

Returns a function based on the passed argument.

mics.utils.multimap(functions, sample)[source]

Applies a list of functions to DataFrame sample and returns a numpy matrix whose number of rows is equal to the length of list functions and whose number of columns is equal to the number of rows in sample.

Note

Each function of the array might for instance receive x and return the result of an element-wise calculation involving x[“A”], x[“B”], etc, with “A”, “B”, etc being names of properties in DataFrame sample.

mics.utils.overlapSampling(u)[source]

Computes the relative free energies of all sampled states using the Overlap Sampling method of Lee and Scott (1980).

mics.utils.pinv(A)[source]

Computes the Moore-Penrose pseudoinverse of a symmetric matrix using eigenvalue decomposition.