atomsmltr.environment.fields.force package#
The atomsmltr.environment.fields.force subpackage provides definitions for forces
Those are mostly direct implementations of generic Fields objects from atomsmltr.environment.fields.generic
Examples
Setup a gravitational force
import numpy as np
from atomsmltr.environment import ConstantForce
from atomsmltr.atoms import Ytterbium
m = Ytterbium().mass # kg
g = 9.81 # m/s^2
direction = np.array([0, 0, -1]) # along -z
grav_force = m * g * direction
gravity = ConstantForce(field_value=grav_force, tag="gravity")
See also
- class atomsmltr.environment.fields.force.ConstantForce(field_value: ndarray = (0, 0, 0), tag: str = None)[source]#
Bases:
Force,ConstantFieldA constant Force
- property type#
a description of the object type
- Type:
str
- class atomsmltr.environment.fields.force.Force(*args, **kwargs)[source]#
Bases:
FieldA generic force field class. Used to set some properties common to all forces objects, and to have a way to identify magnetic field objects.
- property type#
a description of the object type
- Type:
str
- property unit#
returns the unit of the field
- Type:
str
- class atomsmltr.environment.fields.force.GradientForce(origin: ndarray, slope: float, gradient_direction: ndarray, field_direction: ndarray, offset: float = 0.0, tag: str = None)[source]#
Bases:
Force,GradientFieldA perfect force gradient
- property type#
a description of the object type
- Type:
str