atsim.potentials._modifiers

Module Contents

Functions

modifier(func)
is_modifier(obj)
sum(potential_forms, potential_form_builder) Modifier that sums all the potential instances given as arguments.
product(potential_forms, potential_form_builder) Modifier that takes the product of the potential instances given as arguments.
pow(potential_forms, potential_form_builder) Modifier that takes two arguments and raises the first potential-form to the power of the second.
spline(potential_forms, potential_form_builder) Modifier that smoothly splines between two potential forms by linking them with an intermediate spline.
trans(potential_forms, potential_form_builder) Modifier that takes two arguments the first is a potential form and the second must be an
atsim.potentials._modifiers.modifier(func)[source]
atsim.potentials._modifiers.is_modifier(obj)[source]
atsim.potentials._modifiers.sum(potential_forms, potential_form_builder)[source]

Modifier that sums all the potential instances given as arguments.

Parameters:
  • potential_forms – List of tuples that can be passed to atsim.potentials.config._potential_form_builder.Potential_Form_Builder.create_potential_function() to create potential callables.
  • potential_form_builderatsim.potentials.config._potential_form_builder.Potential_Form_Builder used to create potential instances.
Returns:

Potential callable sums that values from a number of potential instances.

atsim.potentials._modifiers.product(potential_forms, potential_form_builder)[source]

Modifier that takes the product of the potential instances given as arguments.

Parameters:
  • potential_forms – List of tuples that can be passed to atsim.potentials.config._potential_form_builder.Potential_Form_Builder.create_potential_function() to create potential callables.
  • potential_form_builderatsim.potentials.config._potential_form_builder.Potential_Form_Builder used to create potential instances.
Returns:

Potential callable that takes the product of a number of potential instances.

atsim.potentials._modifiers.pow(potential_forms, potential_form_builder)[source]

Modifier that takes two arguments and raises the first potential-form to the power of the second.

e.g. pow(as.buck 1000.0 0.2 32.0, as.constant 2.0)

Would square the given Buckingham potential.
Parameters:
  • potential_forms – List of tuples that can be passed to atsim.potentials.config._potential_form_builder.Potential_Form_Builder.create_potential_function() to create potential callables.
  • potential_form_builderatsim.potentials.config._potential_form_builder.Potential_Form_Builder used to create potential instances.
Returns:

Potential callable that takes the product of a number of potential instances.

atsim.potentials._modifiers.spline(potential_forms, potential_form_builder)[source]

Modifier that smoothly splines between two potential forms by linking them with an intermediate spline.

The potential_forms list must contain a single PotentialFormInstanceTuple entre. The tuple must only define three sections - potential form A -> spline -> potential form B. The extent of the spline is defined by where the middle region starts and potential form B starts.

As a configuration string this might be defined as:

>0 as.zbl 14 8 >=0.8 exp_spline >=1.4 as.buck 180003 0.3 32.0

Which would create a zbl and Buckingham potential connected by a spline when r is between 0.8 and 1.4.

At present the potential form label for the spline must be exp_spline or buck4_spline.

Parameters:
  • potential_forms – List of tuples that can be passed to atsim.potentials.config._potential_form_builder.Potential_Form_Builder.create_potential_function() to create potential callables.
  • potential_form_builderatsim.potentials.config._potential_form_builder.Potential_Form_Builder used to create potential instances.
Returns:

Potential callable representing splined potentials.

atsim.potentials._modifiers.trans(potential_forms, potential_form_builder)[source]

Modifier that takes two arguments the first is a potential form and the second must be an instance of as.constant. This modifier performs the operation:

potential_form(r+X)

where X is the value parameter for the as.constant argument.

e.g. trans(as.buck 1000.0 0.2 32.0, as.constant 2.0)

Parameters:
  • potential_forms – List of tuples that can be passed to atsim.potentials.config._potential_form_builder.Potential_Form_Builder.create_potential_function() to create potential callables.
  • potential_form_builderatsim.potentials.config._potential_form_builder.Potential_Form_Builder used to create potential instances.
Returns:

Potential callable transforms the input to the potential-form.