IMLCV.implementations package#
Subpackages#
Submodules#
IMLCV.implementations.CV module#
- IMLCV.implementations.CV.NoneCV()#
- Return type:
- IMLCV.implementations.CV.affine_2d(old, new)#
old: set of coordinates in the original space, new: set of coordinates in the new space
- IMLCV.implementations.CV.append_trans(v)#
- IMLCV.implementations.CV.dihedral(numbers)#
from https://stackoverflow.com/questions/20305272/dihedral-torsion- angle-from-four-points-in-cartesian- coordinates-in-python.
- IMLCV.implementations.CV.distance_descriptor()#
- IMLCV.implementations.CV.get_feature_cov(c_0, c_tau, nl=None, nl_tau=None, w=None, trans=None, epsilon=0.1, smallest_correlation=1e-12, max_functions=None)#
- Return type:
- IMLCV.implementations.CV.get_inv_sigma_weighing(cv_0, nli, remove_mean=True)#
- IMLCV.implementations.CV.get_non_constant_trans(c, c_t=None, nl=None, nl_t=None, w=None, epsilon=1e-14, max_functions=None, tr=None)#
- IMLCV.implementations.CV.get_normalize_trans(c, remove_mu=True, range=Ellipsis)#
- IMLCV.implementations.CV.get_remove_mean_trans(c, range=Ellipsis)#
- IMLCV.implementations.CV.get_sinkhorn_divergence_2(nli, pi, alpha_rematch=0.1, jacobian=True, scale_z=False)#
Get a function that computes the sinkhorn divergence between two point clouds. p_i and nli are the points to match against.
- Return type:
- IMLCV.implementations.CV.kernel_dist(p1, p2, xi=2.0)#
- IMLCV.implementations.CV.position_index(indices, sp)#
- IMLCV.implementations.CV.project_distances(a)#
- IMLCV.implementations.CV.rotate_2d(alpha)#
- IMLCV.implementations.CV.sb_descriptor(r_cut, n_max, l_max, reduce=True, reshape=True, chunk_size_atoms=None, chunk_size_neigbourgs=None, bessel_fun='jax', mul_Z=True)#
- Return type:
- IMLCV.implementations.CV.scale_cv_trans(array, lower=0.0, upper=1.0)#
axis 0 is batch axis
- IMLCV.implementations.CV.sinkhorn_divergence_2(x1, x2, nl1, nl2, z_scale, alpha=0.01, jacobian=False, lse=True, exp_factor=None, mass_weight=True, dist_fun=<function kernel_dist>, scale_std=True, xi=2.0)#
caluculates the sinkhorn divergence between two CVs. If x2 is batched, the resulting divergences are stacked
- Return type:
- IMLCV.implementations.CV.soap_descriptor(r_cut, n_max, l_max, sigma_a, r_delta, reduce=True, reshape=True, num=50, basis='cos', mul_Z=True)#
- Return type:
- IMLCV.implementations.CV.stack_reduce(op=<function mean>)#
IMLCV.implementations.CvDiscovery module#
- class IMLCV.implementations.CvDiscovery.Decoder(latents, layers, nunits, dim, parent=<flax.linen.module._Sentinel object>, name=None)#
Bases:
Module- scope: Scope | None = None#
- class IMLCV.implementations.CvDiscovery.Encoder(latents, layers, nunits, dim, parent=<flax.linen.module._Sentinel object>, name=None)#
Bases:
Module- scope: Scope | None = None#
- class IMLCV.implementations.CvDiscovery.TranformerAutoEncoder(*, outdim, descriptor=None, pre_scale=True, post_scale=True, nunits=250, nlayers=3, lr=0.0001, num_epochs=100, batch_size=32)#
Bases:
Transformer- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.CvDiscovery.TransformerMAF(*, outdim, descriptor=None, pre_scale=True, post_scale=True, eps=1e-05, eps_pre=1e-05, max_features=500, max_features_pre=500, sym=True, use_w=True, min_t_frac=0.1, trans=None, T_scale=1.0)#
Bases:
Transformer- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.CvDiscovery.TransoformerLDA(*, outdim, descriptor=None, pre_scale=True, post_scale=True, solver='eigen', method='pymanopt', min_gradient_norm=0.001, min_step_size=0.001, max_iterations=25)#
Bases:
Transformer- harmonic = True#
- kernel = False#
- optimizer = None#
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.CvDiscovery.VAE(latents, layers, nunits, dim, parent=<flax.linen.module._Sentinel object>, name=None)#
Bases:
Module- encode(x)#
- classmethod reparameterize(rng, mean, logvar)#
- scope: Scope | None = None#
- setup()#
Initializes a Module lazily (similar to a lazy
__init__).setupis called once lazily on a module instance when a module is bound, immediately before any other methods like__call__are invoked, or before asetup-defined attribute onselfis accessed.This can happen in three cases:
Immediately when invoking
apply(),init()orinit_and_output().Once the module is given a name by being assigned to an attribute of another module inside the other module’s
setupmethod (see__setattr__()):>>> class MyModule(nn.Module): ... def setup(self): ... submodule = nn.Conv(...) ... # Accessing `submodule` attributes does not yet work here. ... # The following line invokes `self.__setattr__`, which gives ... # `submodule` the name "conv1". ... self.conv1 = submodule ... # Accessing `submodule` attributes or methods is now safe and ... # either causes setup() to be called once.
Once a module is constructed inside a method wrapped with
compact(), immediately before another method is called orsetupdefined attribute is accessed.
IMLCV.implementations.MdEngine module#
IMLCV.implementations.bias module#
- class IMLCV.implementations.bias.BiasMTD(*, collective_variable, start=0, step=1, finalized=False, slice_exponent=1.0, log_exp_slice=True, slice_mean=False, q0s, sigmas, K, Ks, tempering=0.0)#
Bases:
BiasA sum of Gaussian hills, for instance used in metadynamics: Adapted from Yaff.
V = sum_{\alpha} K_{\alpha}} exp{-sum_{i} \frac{(q_i-q_{i,\alpha}^0)^2}{2sigma^2}}
where \alpha loops over deposited hills and i loops over collective variables.
- classmethod create(cvs, K, sigmas, tempering=0.0, start=None, step=None, finalized=False)#
_summary_
- Parameters:
cvs (
CollectiveVariable) – _description_K – _description_
sigmas – _description_
start – _description_. Defaults to None.
step – _description_. Defaults to None.
tempering – _description_. Defaults to 0.0.
- Return type:
Self
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- update_bias(md)#
update the bias.
Can only change the properties from _get_args
- class IMLCV.implementations.bias.GridBias(*, collective_variable, start=0, step=1, finalized=False, slice_exponent=1.0, log_exp_slice=True, slice_mean=False, n, bounds, vals, order=1)#
Bases:
BiasBias interpolated from lookup table on uniform grid.
values are caluclated in bin centers
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.bias.HarmonicBias(*, collective_variable, start=0, step=1, finalized=False, slice_exponent=1.0, log_exp_slice=True, slice_mean=False, q0, k, k_max=None, y0=None, r0=None)#
Bases:
BiasHarmonic bias potential centered arround q0 with force constant k.
- static create(cvs, q0, k, k_max=None, start=None, step=None, finalized=True)#
generate harmonic potentia;
- Parameters:
cvs (
CollectiveVariable) – CVq0 (
CV) – rest pos spring
- Return type:
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.bias.MinBias(*, collective_variable, start=0, step=1, finalized=False, slice_exponent=1.0, log_exp_slice=True, slice_mean=False, biases, fun)#
Bases:
CompositeBias- classmethod create(biases)#
- Return type:
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
- class IMLCV.implementations.bias.RbfBias(*, collective_variable, start=0, step=1, finalized=False, slice_exponent=1.0, log_exp_slice=True, slice_mean=False, rbf, offset=0.0)#
Bases:
BiasBias interpolated from lookup table on uniform grid.
values are caluclated in bin centers
- classmethod create(cvs, vals, cv, start=None, step=None, kernel='gaussian', epsilon=None, smoothing=0.0, degree=None, finalized=True, slice_exponent=1, log_exp_slice=True, slice_mean=False)#
- Return type:
-
rbf:
RBFInterpolator#
- replace(**updates)#
Returns a new object replacing the specified fields with new values.
IMLCV.implementations.energy module#
- class IMLCV.implementations.energy.AseEnergy(atoms, calculator=None)#
Bases:
EnergyConversion to ASE energy
- property cell#
- property coordinates#
- class IMLCV.implementations.energy.Cp2kEnergy(atoms, input_file, input_kwargs, cp2k_path=None, **kwargs)#
Bases:
AseEnergy- default_parameters = {'auto_write': False, 'basis_set': None, 'basis_set_file': None, 'charge': None, 'cutoff': None, 'force_eval_method': None, 'inp': '', 'max_scf': None, 'poisson_solver': None, 'potential_file': None, 'print_level': 'LOW', 'pseudo_potential': None, 'stress_tensor': True, 'uks': False, 'xc': None}#