environment objects#

This module implements the generic EnvObject class. All objects aimed at defining the atom’s environment will derive from this class.

This will help ensure that those objects share common properties and methods, which will ease their use inside a Configuration class.

class atomsmltr.environment.envbase.EnvObject(tag: str = None)[source]#

Bases: Plottable

Defines a generic (abstract) class for environment objects.

Notably, this makes sure that:

  1. they are Plottable objects

  2. they feature a get_value() method that satisfies our vectorization convention

  3. they have a tag property.

Parameters:

tag (str, optional (default=None)) – a tag identifying the object. If None is given, a random tag will be generated

copy(new_tag: str = None)[source]#

returns a copy of the object.

Parameters:

new_tag (str, optional) – a tag for the copy, if None is given a random tag is generated.

Returns:

object_copy – a copy of the object

Return type:

EnvObject

gen_info_string(**kwargs)[source]#

generates an info string

Returns:

info_string – a string with information on the atom

Return type:

str

abstractmethod gen_infostring_obj()[source]#

generates an InfoString object.

Returns:

an InfoString object

Return type:

InfoString

abstractmethod get_value(position: ndarray, nocheck=False) ndarray[source]#

Returns the EnvObject ‘value’ at a given position

Parameters:
  • position (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates in the lab frame

  • nocheck (bool, optional) – if set to True, function will not check that the shape of position matches requirements, by default False

Returns:

intensity – laser intensity at position

Return type:

float or array of shape (n1, n2, …, 1)

Notes

position is an array_like object, with shape (3,) or (n1, n2, .., 3). In all cases, the last dimension contains cordinates (x, y, z), in meter and in the lab frame

Note

this is an abstract method, and the actual method has to be implemented for each child class.

print_info()[source]#

prints the atom infostring

property tag: str#

the object tag

Type:

str

abstract property type#

a description of the object type

Type:

str

abstract property vector#

True it the object value is vectorial, False if scalar

Type:

bool