CDTK.Dynamics.SimulationBox module

class CDTK.Dynamics.SimulationBox.SimulationBox(**opts)[source]

Bases: object

Bunch of atoms given by their cartesian coordinates.

Provides functionality to follow and analyze their classical dynamics

add_ehrenfest_dynamics_cntrl(ed)[source]

Add an Ehrenfest-dynamics object.

ED objects provide energy and gradient functions

add_field_coupling_cntrl(fc)[source]

Add a field-coupling object.

FC objects provide field-coupling functions. invoked from sh.simbox._fc. Loaded after the surface hopping object

add_observable_cntrl(ob)[source]

Add an observable object

OB objects provide observable properties for the molecule

add_population_dynamics_cntrl(pd)[source]
add_surface_hopping_cntrl(sh)[source]

Add a surface-hopping object.

SH objects provide energy and gradient functions

centerOfMassVelocity(**opts)[source]

Compute the velocity vector of the center of mass

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getAdiabaticPopulation()[source]

Return the adiabatic populations and the norm of electronic wavefunction

getKineticEnergy(**opts)[source]

Total kinetic energy of the system of particles

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getMomentum(**opts)[source]

Return total momentum vector (in [au])

Optional arguments: - indices: tuple with indices of a group of atoms - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getPotEnergy(**opts)[source]

Return potential energy (last time or stored) of the system (a.u.)

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getProperty2D_F(a_dir, a_funcX, a_filename, match=None)[source]

Return a 2D function of the system in block form, one block per time step

Input arguments:

a_dir – directory with SimulationBox to be averaged a_filename – file where to store the data in table form

match – load only files matching a_match

On return two arrays with:

time, func_val

getPropertyTable(funcX=None, filename=None, usevel=False, **opts)[source]

Return property as a function of time

Works on a single SimulationBox instance

Input arguments:
funcX – (optional) function of the coordinates

may have more than one return value

filename – (optional) file where to store the data in table form usevel – (optional) if True, velocities are

used instead of positions

on return the following arrays:

time, ekin, etrans, erot, evib, epot

or

time, func_val

if funcX provided

Options

finalTime – final time for property analysis over patial time domain

getPropertyTableDir_E(a_dir, filename=None, match=None, **opts)[source]

Return ensemble averages of various energies

Input arguments:

a_dir – directory with SimulationBox to be averaged

filename – (optional) file where to store the data in table form match – load only files matching a_match

On return two arrays with:

time, func_val

Options

finalTime – final time for property analysis over patial time domain

getPropertyTableDir_F(a_dir, a_funcX, filename=None, match=None, usevel=False, **opts)[source]

Return an ensemble average property as a function of time

Input arguments:

a_dir – directory with SimulationBox to be averaged a_funcX – function of the coordinates;

may have more than one return value

filename – (optional) file where to store the data in table form match – load only files matching match usevel – (optional) if True, velocities are used instead of positions

On return two arrays with:

time, func_val

Options

finalTime – final time for property analysis over patial time domain

getReducedMass()[source]

Return the reduced mass of the molecule

getRotationalEnergy(**opts)[source]

Rotational energy around the center of mass of the system of particles

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getTranslationalEnergy(**opts)[source]

Translational energy of the center of mass of the system of particles

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getVibrationalEnergy(**opts)[source]

Internal energy of the system of particles

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

getVibrationalMomentum(**opts)[source]

Internal momentum of the system of particles

Optional arguments: - stepnum: step number to consider - time: time to consider

** use time OR stepnum

integrate(**opts)[source]

Integrate up to tfinal

load(a_fname, **opts)[source]

Load a simulationbox object from file

loadDirectory(a_dir, match=None, **opts)[source]

Load all simulationbox objects stored in a directory

Input arguments:

a_dir – directory where to load simbox objects from match – (optional) load only files that match “match”

removeCenterMassMotion()[source]

Remove center of mass translational motion

reset()[source]
save(**opts)[source]

Save object using pickle

optional arguments:
  • fname: filename to save to. If not given a random

    hash will be used

stop_protect(**opts)[source]

Protect the running processes via [stop] mechanism

optional arguments:
is_init - whether to be the initialization step

default: False

traj2VTF(**opts)[source]

Generate a trajectory in .vtf format

Useful for plots with VMD

CDTK.Dynamics.SimulationBox.load(filename)[source]

Load a SimulationBox from file and return it