pyiron_contrib.atomistics.atomicrex.function_factory module
- class pyiron_contrib.atomistics.atomicrex.function_factory.AbstractMetaFunction(*args, **kwargs)[source]
Bases:
DataContainer
,MetaFunctionMixin
- class pyiron_contrib.atomistics.atomicrex.function_factory.BaseFunctionMixin[source]
Bases:
object
- set_max_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set max values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.max_val = constant. Defaults to None.
factor ([type], optional) – param.max_val = abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- set_min_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set min values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.min_val = constant. Defaults to None.
factor ([type], optional) – param.min_val = -abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- class pyiron_contrib.atomistics.atomicrex.function_factory.Constant(*args, **kwargs)[source]
Bases:
SpecialFunction
- class pyiron_contrib.atomistics.atomicrex.function_factory.ExpA(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.ExpB(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.ExpGaussian(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.ExtendedMishinCuF(*args, **kwargs)[source]
Bases:
SpecialFunction
- class pyiron_contrib.atomistics.atomicrex.function_factory.FunctionFactory[source]
Bases:
PyironFactory
Class to conveniently create different function objects. for detailed information about the function visit the atomicrex documentation.
- static MishinCuV(identifier, E1, E2, alpha1, alpha2, r01, r02, delta, cutoff, h, S1, rs1, S2, rs2, S3, rs3, species=['*', '*'])[source]
- static equidistant_spline(identifier, n_nodes, cutoff, initial_value_func, min_distance=0.0, derivative_left=0.0, d_left_enabled=True, derivative_right=0.0, d_right_enabled=False, endpoint_val=0.0, species=['*', '*'])[source]
Convenience function to create a spline function with equidistant node points.
- Parameters
identifier (str) – function identifier. Should be unique within the job
n_nodes (int) – number of node points
cutoff (float) – values after are 0
initial_value_func (function(x)) – function to calculate start values for nodes.
min_distance (float, optional) – x coordinate of first node point. Defaults to 0.
derivative_left (int, optional) – . Defaults to 0.
d_left_enabled (bool, optional) – Whether to fit. Defaults to True.
derivative_right (int, optional) – [description]. Defaults to 0.
d_right_enabled (bool, optional) – Whether to fit. Should be False for most functions, beside Embedding terms. Defaults to False.
endpoint_val (float, None, bool, optional) – Start val for endpoint, enabled=False if float, if False endpoint is not included. If None endpoint is included, enabled and start_val is calculated like other points. Defaults to 0.0, which should be used in most cases.
species (list of str, optional) – Only needs to be changed for multi element fits. Defaults to [“*”, “*”].
- Returns
[description]
- Return type
[type]
- static exp_B_screening(identifier, cutoff, rc, alpha, exponent, species=['*', '*'], is_screening_function=True)[source]
- static exp_gaussian_screening(identifier, cutoff, stddev, alpha, exponent, species=['*', '*'], is_screening_function=True)[source]
- static extendedMishinCuF(identifier, F0, F2, f3, f4, f5, f6, a3, a4, a5, a6, d3, d4, d5, species=['*'])[source]
- static gaussians_sum(n_gaussians, eta, identifier, node_points=None, cutoff=None, initial_prefactors=None, min_prefactors=None, max_prefactors=None, species=['*', '*'])[source]
- static poly(identifier, cutoff, species=['*', '*'])[source]
TAKE CARE !!! The polynomial function implemented in atomicrex does not handle derivatives at the cutoff right now, i.e. when using this as a pair function or similar there will be massive jumps in forces.
- static spline(identifier, cutoff, derivative_left=0, derivative_right=0, species=['*', '*'])[source]
- class pyiron_contrib.atomistics.atomicrex.function_factory.FunctionParameter(*args, **kwargs)[source]
Bases:
DataContainer
Function parameter. For detailed information about the attributes see the atomicrex documentation. Objects should only be created using the add_parameter method of the FunctionParameterList class.
- class pyiron_contrib.atomistics.atomicrex.function_factory.FunctionParameterList(*args, **kwargs)[source]
Bases:
DataContainer
- add_parameter(param, start_val, enabled=True, reset=False, min_val=None, max_val=None, tag=None, fitable=True)[source]
Add a function parameter named param to a function. This needs to be done manually for user functions and not for special functions.
- Parameters
param (str) – Name of the parameter. Must exactly match the name in the function expression.
start_val (float) – Starting value of the parameter
enabled (bool, optional) – Determines if the paremeter is varied during fitting. Defaults to True.
reset (bool, optional) – Determine if the parameter should be reset every iteration
False. (Can help with global optimization. Defaults to) –
min_val (float, optional) – Highly recommended for global optimization. Defaults to None.
max_val (float, optional) – Highly recommended for global optimization. Defaults to None.
tag (str, optional) – [description]. Only necessary for ABOP potentials .Defaults to None.
fitable (bool, optional) – [description]. Changing could cause bugs. Defaults to True.
- class pyiron_contrib.atomistics.atomicrex.function_factory.GaussianFunc(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.MetaFunctionMixin[source]
Bases:
object
- set_max_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set max values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.max_val = constant. Defaults to None.
factor ([type], optional) – param.max_val = abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- set_min_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set min values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.min_val = constant. Defaults to None.
factor ([type], optional) – param.min_val = -abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- class pyiron_contrib.atomistics.atomicrex.function_factory.MishinCuF(*args, **kwargs)[source]
Bases:
SpecialFunction
- class pyiron_contrib.atomistics.atomicrex.function_factory.MishinCuRho(*args, **kwargs)[source]
Bases:
SpecialFunction
- class pyiron_contrib.atomistics.atomicrex.function_factory.MorseA(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.MorseB(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.MorseC(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.Node(*args, **kwargs)[source]
Bases:
FunctionParameter
Function parameter, but for spline interpolation.
- class pyiron_contrib.atomistics.atomicrex.function_factory.NodeList(*args, **kwargs)[source]
Bases:
DataContainer
- add_node(x, start_val, enabled=True, reset=False, min_val=None, max_val=None)[source]
Add a node to the spline interpolation function.
- Parameters
x (float) – x coordinate of the node. Does not change during fitting.
start_val (float) – Initial y coordinate of the node.
enabled (bool, optional) – Determines if y is changed during fitting. Defaults to True.
reset (bool, optional) – Determines if y should be reset every iteration. Defaults to False.
min_val (float, optional) – Highly recommended for global optimization. Defaults to None.
max_val (float, optional) – Highly recommended for global optimization. Defaults to None.
- create_from_arrays(x, y, min_vals=None, max_vals=None)[source]
Convenience function to create nodes from lists or arrays of values. Allows to easily start the fitting process with physically motivated values or values taken from previous potentials. Creates len(x) nodes at position x with starting values y. All given arrays must have the same length.
- Parameters
x (list or array) – x values of the nodes
y (list or array) – corresponding y (starting) values
min_vals ([type], optional) – Highly recommended for global optimization. Defaults to None.
max_vals ([type], optional) – Highly recommended for global optimization. Defaults to None.
- class pyiron_contrib.atomistics.atomicrex.function_factory.Poly(*args, **kwargs)[source]
Bases:
DataContainer
,BaseFunctionMixin
Polynomial interpolation function.
- class pyiron_contrib.atomistics.atomicrex.function_factory.PolyCoeff(*args, **kwargs)[source]
Bases:
FunctionParameter
Function parameter, but for polynomial interpolation.
- class pyiron_contrib.atomistics.atomicrex.function_factory.PolyCoeffList(*args, **kwargs)[source]
Bases:
DataContainer
- add_coeff(n, start_val, enabled=True, reset=False, min_val=None, max_val=None)[source]
Add a term in the form of a*x^n.
- Parameters
n (int) – Order n of the coefficient
start_val (float) – Starting value of a.
enabled (bool, optional) – Determines if it should be fitted. Defaults to True.
reset (bool, optional) – Determines if it should be reset after each iteration. Defaults to False.
min_val (float, optional) – Highly recommended for global optimization. Defaults to None.
max_val (float, optional) – Highly recommended for global optimization. Defaults to None.
- class pyiron_contrib.atomistics.atomicrex.function_factory.RsMinusRPowN(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.SpecialFunction(*args, **kwargs)[source]
Bases:
DataContainer
,BaseFunctionMixin
Analytic functions defined within atomicrex should inherit from this class https://atomicrex.org/potentials/functions.html#index-1 https://atomicrex.org/potentials/functions.html#specialized-functions
- property func
- class pyiron_contrib.atomistics.atomicrex.function_factory.Spline(*args, **kwargs)[source]
Bases:
DataContainer
,BaseFunctionMixin
Spline interpolation function
- set_max_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set max values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.max_val = constant. Defaults to None.
factor ([type], optional) – param.max_val = abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- set_min_values(constant=None, factor=None, filter_func=None)[source]
Convenience function so set min values for all parameters at once. Can either use a constant value or a factor. If both are given factor is used.
- Parameters
constant ([type], optional) – param.min_val = constant. Defaults to None.
factor ([type], optional) – param.min_val = -abs(start_val)*factor. Defaults to None.
filter_func ([type], optional) – Optional function to filter params. Should take param as argument and return True or False. Defaults to None.
- Raises
ValueError – Raises when constant and factor are None.
- class pyiron_contrib.atomistics.atomicrex.function_factory.UserFunction(*args, **kwargs)[source]
Bases:
DataContainer
,BaseFunctionMixin
Analytic functions that are not implemented in atomicrex can be provided as user functions. All parameters defined in the function should be added using the UserFunction.parameters.add_parameter() method.
- class pyiron_contrib.atomistics.atomicrex.function_factory.XpowNCutoff(*args, **kwargs)[source]
Bases:
SpecialFunction
- property func
- pyiron_contrib.atomistics.atomicrex.function_factory.plot(func, x=array([0.01, 0.02997143, 0.04994286, 0.06991429, 0.08988571, 0.10985714, 0.12982857, 0.1498, 0.16977143, 0.18974286, 0.20971429, 0.22968571, 0.24965714, 0.26962857, 0.2896, 0.30957143, 0.32954286, 0.34951429, 0.36948571, 0.38945714, 0.40942857, 0.4294, 0.44937143, 0.46934286, 0.48931429, 0.50928571, 0.52925714, 0.54922857, 0.5692, 0.58917143, 0.60914286, 0.62911429, 0.64908571, 0.66905714, 0.68902857, 0.709, 0.72897143, 0.74894286, 0.76891429, 0.78888571, 0.80885714, 0.82882857, 0.8488, 0.86877143, 0.88874286, 0.90871429, 0.92868571, 0.94865714, 0.96862857, 0.9886, 1.00857143, 1.02854286, 1.04851429, 1.06848571, 1.08845714, 1.10842857, 1.1284, 1.14837143, 1.16834286, 1.18831429, 1.20828571, 1.22825714, 1.24822857, 1.2682, 1.28817143, 1.30814286, 1.32811429, 1.34808571, 1.36805714, 1.38802857, 1.408, 1.42797143, 1.44794286, 1.46791429, 1.48788571, 1.50785714, 1.52782857, 1.5478, 1.56777143, 1.58774286, 1.60771429, 1.62768571, 1.64765714, 1.66762857, 1.6876, 1.70757143, 1.72754286, 1.74751429, 1.76748571, 1.78745714, 1.80742857, 1.8274, 1.84737143, 1.86734286, 1.88731429, 1.90728571, 1.92725714, 1.94722857, 1.9672, 1.98717143, 2.00714286, 2.02711429, 2.04708571, 2.06705714, 2.08702857, 2.107, 2.12697143, 2.14694286, 2.16691429, 2.18688571, 2.20685714, 2.22682857, 2.2468, 2.26677143, 2.28674286, 2.30671429, 2.32668571, 2.34665714, 2.36662857, 2.3866, 2.40657143, 2.42654286, 2.44651429, 2.46648571, 2.48645714, 2.50642857, 2.5264, 2.54637143, 2.56634286, 2.58631429, 2.60628571, 2.62625714, 2.64622857, 2.6662, 2.68617143, 2.70614286, 2.72611429, 2.74608571, 2.76605714, 2.78602857, 2.806, 2.82597143, 2.84594286, 2.86591429, 2.88588571, 2.90585714, 2.92582857, 2.9458, 2.96577143, 2.98574286, 3.00571429, 3.02568571, 3.04565714, 3.06562857, 3.0856, 3.10557143, 3.12554286, 3.14551429, 3.16548571, 3.18545714, 3.20542857, 3.2254, 3.24537143, 3.26534286, 3.28531429, 3.30528571, 3.32525714, 3.34522857, 3.3652, 3.38517143, 3.40514286, 3.42511429, 3.44508571, 3.46505714, 3.48502857, 3.505, 3.52497143, 3.54494286, 3.56491429, 3.58488571, 3.60485714, 3.62482857, 3.6448, 3.66477143, 3.68474286, 3.70471429, 3.72468571, 3.74465714, 3.76462857, 3.7846, 3.80457143, 3.82454286, 3.84451429, 3.86448571, 3.88445714, 3.90442857, 3.9244, 3.94437143, 3.96434286, 3.98431429, 4.00428571, 4.02425714, 4.04422857, 4.0642, 4.08417143, 4.10414286, 4.12411429, 4.14408571, 4.16405714, 4.18402857, 4.204, 4.22397143, 4.24394286, 4.26391429, 4.28388571, 4.30385714, 4.32382857, 4.3438, 4.36377143, 4.38374286, 4.40371429, 4.42368571, 4.44365714, 4.46362857, 4.4836, 4.50357143, 4.52354286, 4.54351429, 4.56348571, 4.58345714, 4.60342857, 4.6234, 4.64337143, 4.66334286, 4.68331429, 4.70328571, 4.72325714, 4.74322857, 4.7632, 4.78317143, 4.80314286, 4.82311429, 4.84308571, 4.86305714, 4.88302857, 4.903, 4.92297143, 4.94294286, 4.96291429, 4.98288571, 5.00285714, 5.02282857, 5.0428, 5.06277143, 5.08274286, 5.10271429, 5.12268571, 5.14265714, 5.16262857, 5.1826, 5.20257143, 5.22254286, 5.24251429, 5.26248571, 5.28245714, 5.30242857, 5.3224, 5.34237143, 5.36234286, 5.38231429, 5.40228571, 5.42225714, 5.44222857, 5.4622, 5.48217143, 5.50214286, 5.52211429, 5.54208571, 5.56205714, 5.58202857, 5.602, 5.62197143, 5.64194286, 5.66191429, 5.68188571, 5.70185714, 5.72182857, 5.7418, 5.76177143, 5.78174286, 5.80171429, 5.82168571, 5.84165714, 5.86162857, 5.8816, 5.90157143, 5.92154286, 5.94151429, 5.96148571, 5.98145714, 6.00142857, 6.0214, 6.04137143, 6.06134286, 6.08131429, 6.10128571, 6.12125714, 6.14122857, 6.1612, 6.18117143, 6.20114286, 6.22111429, 6.24108571, 6.26105714, 6.28102857, 6.301, 6.32097143, 6.34094286, 6.36091429, 6.38088571, 6.40085714, 6.42082857, 6.4408, 6.46077143, 6.48074286, 6.50071429, 6.52068571, 6.54065714, 6.56062857, 6.5806, 6.60057143, 6.62054286, 6.64051429, 6.66048571, 6.68045714, 6.70042857, 6.7204, 6.74037143, 6.76034286, 6.78031429, 6.80028571, 6.82025714, 6.84022857, 6.8602, 6.88017143, 6.90014286, 6.92011429, 6.94008571, 6.96005714, 6.98002857, 7.]))[source]