exatomic.core.atom module

Atomic Position Data

This module provides a collection of dataframes supporting nuclear positions, forces, velocities, symbols, etc. (all data associated with atoms as points).

class exatomic.core.atom.Atom(*args, **kwargs)[source]

Bases: DataFrame

The atom dataframe.

Column

Type

Description

x

float

position in x (req.)

y

float

position in y (req.)

z

float

position in z (req.)

frame

category

non-unique integer (req.)

symbol

category

element symbol (req.)

fx

float

force in x

fy

float

force in y

fz

float

force in z

vx

float

velocity in x

vy

float

velocity in y

vz

float

velocity in z

property nframes

Return the total number of frames in the atom table.

property last_frame

Return the last frame of the atom table.

property unique_atoms

Return unique atom symbols of the last frame.

center(idx=None, frame=None, to=None)[source]

Return a copy of a single frame of the atom table centered around a specific atom index. There is also the ability to center the molecule to the center of nuclear charge (NuclChrg) or center of mass (Mass).

Parameters:
  • idx (int) – Atom index in the atom table

  • frame (int) – Frame to perform the operation on

  • to (str) – Tells the program which centering algorithm to use

Returs:

frame (exatomic.Universe.atom): Atom frame

rotate(theta, axis=None, frame=None, degrees=True)[source]

Return a copy of a single frame of the atom table rotated around the specified rotation axis by the specified angle. As we have the rotation axis and the rotation angle we are able to use the Rodrigues’ formula to get the rotated vectors.

Parameters:
  • theta (float) – The angle that you wish to rotate by

  • axis (list) – The axis of rotation

  • frame (int) – The frame that you wish to rotate

  • degrees (bool) – If true convert from degrees to radians

Returns:

frame (exatomic.Universe.atom) – Atom frame

translate(dx=0, dy=0, dz=0, vector=None, frame=None, units='au')[source]

Return a copy of a single frame of the atom table translated by some specified distance.

Note

Vector can be used instead of dx, dy, dz as it will be decomposed into those components. If vector and any of the others are specified the values in vector will be used.

Parameters:
  • dx (float) – Displacement distance in x

  • dy (float) – Displacement distance in y

  • dz (float) – Displacement distance in z

  • vector (list) – Displacement vector

  • units (str) – Units that are used for the displacement

Returns:

frame (exatomic.Universe.atom) – Atom frame

align_to_axis(adx0, adx1, axis=None, frame=None, center_to=None)[source]

This a short method to center and align the molecule along some defined axis.

Parameters:
  • adx0 (int) – Atom to place at the origin

  • adx1 (int) – Atom to align along the axis

  • axis (list) – Axis that the vector adx0-adx1 will align to

  • frame (int) – Frame to align

Returns:

aligned (exatomic.Universe.atom) – Aligned atom frame

to_xyz(tag='symbol', header=False, comments='', columns=None, frame=None, units='Angstrom')[source]

Return atomic data in XYZ format, by default without the first 2 lines. If multiple frames are specified, return an XYZ trajectory format. If frame is not specified, by default returns the last frame in the table.

Parameters:
  • tag (str) – column name to use in place of ‘symbol’

  • header (bool) – if True, return the first 2 lines of XYZ format

  • comment (str, list) – comment(s) to put in the comment line

  • frame (int, iter) – frame or frames to return

  • units (str) – units (default angstroms)

Returns:

ret (str) – XYZ formatted atomic data

get_element_masses()[source]

Compute and return element masses from symbols.

get_atom_labels()[source]

Compute and return enumerated atoms.

Returns:

labels (Series) – Enumerated atom labels (of type int)

classmethod from_small_molecule_data(center=None, ligand=None, distance=None, geometry=None, offset=None, plane=None, axis=None, domains=None, unit='Angstrom')[source]

A minimal molecule builder for simple one-center, homogeneous ligand molecules of various general chemistry molecular geometries. If domains is not specified and geometry is ambiguous (like ‘bent’), it just guesses the simplest geometry (smallest number of domains).

Args

center (str): atomic symbol of central atom ligand (str): atomic symbol of ligand atoms distance (float): distance between central atom and any ligand geometry (str): molecular geometry domains (int): number of electronic domains offset (np.array): 3-array of position of central atom plane (str): cartesian plane of molecule (eg. for ‘square_planar’) axis (str): cartesian axis of molecule (eg. for ‘linear’)

Returns

exatomic.atom.Atom: Atom table of small molecule

class exatomic.core.atom.UnitAtom(*args, **kwargs)[source]

Bases: DataFrame

In unit cell coordinates (sparse) for periodic systems. These coordinates are used to update the corresponding Atom object

classmethod from_universe(universe)[source]
class exatomic.core.atom.ProjectedAtom(*args, **kwargs)[source]

Bases: DataFrame

Projected atom coordinates (e.g. on 3x3x3 supercell). These coordinates are typically associated with their corresponding indices in another dataframe.

Note

This table is computed when periodic two body properties are computed; it doesn’t have meaning outside of that context.

See also

compute_periodic_two().

class exatomic.core.atom.VisualAtom(*args, **kwargs)[source]

Bases: DataFrame

classmethod from_universe(universe)[source]
class exatomic.core.atom.Frequency(*args, **kwargs)[source]

Bases: DataFrame

The Frequency dataframe.

Column

Type

Description

frame

category

non-unique integer (req.)

frequency

float

frequency of oscillation (cm-1) (req.)

freqdx

int

index of frequency of oscillation (req.)

dx

float

atomic displacement in x direction (req.)

dy

float

atomic displacement in y direction (req.)

dz

float

atomic displacement in z direction (req.)

ir_int

float

ir intensity of the vibrational mode

symbol

str

atomic symbol (req.)

label

int

atomic identifier

displacement(freqdx)[source]
ir_spectra(fwhm=15, lineshape='gaussian', xrange=None, res=None, invert_x=False, **kwargs)[source]

Generate an IR spectra with the plotter classes. We can define a gaussian or lorentzian lineshape functions. For the most part we pass all of the kwargs directly into the plotter.Plot class.

Parameters:
  • fwhm (float) – Full-width at half-maximum

  • lineshape (str) – Switch between the different lineshape functions available

  • xrange (list) – X-bounds for the plot

  • res (float) – Resolution for the plot line

  • invert_x (bool) – Invert x-axis

exatomic.core.atom.add_vibrational_mode(uni, freqdx)[source]