opan.const

Defines objects bearing assorted constants for Open Anharmonic.

Module-Level Members

opan.const.infty

str – Unicode infinity symbol

opan.const.atom_num

dict – Atomic number lookup from element symbol

Note

Keys for atom_num are all uppercase (e.g., ‘AR’ for argon)

opan.const.atom_sym

dict – Element symbol lookup from atomic number, returned as all uppercase

Classes

Overview

Constants Classes

CIC – Application-internal code information constants

DEF – Default values for parameters intended to be user-adjustable

PHYS – Physical constants

PRM – Internal computation parameters, intended to be non-user-adjustable

UNITS – Functions returning text strings of units descriptions

Enumeration Classes

EnumIterMeta – Metaclass for iterable enumerations supporting membership testing with in

OpanEnum – Superclass for enumerations

Plain Enumerations

EnumCheckGeomMismatch – Mismatch type found during check_geom() comparison checks of two geometries.

EnumDispDirection – Displacement direction along a particular mode

EnumFileType – Various file types relevant to the software packages

EnumMassPertType – Type of atomic mass perturbation being applied

EnumSoftware – Implemented computational software packages

EnumTopType – Molecular top classification

Anharmonic (VPT2) HDF5 Repository Enumerations

EnumAnharmRepoData – Displacement-specific values

EnumAnharmRepoParam – Displacement-nonspecific values

Units Enumerations

Units implemented for numerical conversions for various physical quantities.

EnumUnitsRotConst – Rotational constants

API

class opan.const.CIC

Bases: object

Container for application-internal code information constants

These may need expansion into dictionaries keyed by EnumSoftware enum values, depending on the atoms supported by various software packages. They may also require adjustment to accommodate ‘special’ atom types such as ghost atoms and point charges.

Members

MAX_ATOMIC_NUM = 103

int – Maximum atomic number supported

MIN_ATOMIC_NUM = 1

int – Minimum atomic number supported

class opan.const.DEF

Bases: object

Container for default parameter values (possibly user-adjustable)

FILE_EXTS = {'ORCA': {'GRAD': 'engrad', 'HESS': 'hess', 'INPUTFILE': 'txt', 'OUTPUT': 'out', 'XYZ': 'XYZ'}}

dict of dict – Dictionary of dictionaries of file extensions for geometry, gradient, hessian, etc. files from the various software suites.

Access as FILE_EXTS[EnumSoftware][EnumFileType]

GRAD_COORD_MATCH_TOL = 1e-07

float – Max precision of GRAD geometries (currently ORCA-specific)

HESS_COORD_MATCH_TOL = 1e-06

float – Max precision of HESS geometries (currently ORCA-specific)

HESS_IR_MATCH_TOL = 0.01

float – Max precision of freqs in IR spectrum block (currently ORCA-specific)

MASS_PERT_MAG = 0.0001

float – Relative magnitude of atomic mass perturbations

ORTHONORM_TOL = 1e-08

float – Acceptable deviation from Kronecker delta for orthonormality testing

XYZ_COORD_MATCH_TOL = 1e-12

float – Max tolerable deviation between XYZ geoms (currently ORCA-specific)

class opan.const.EnumAnharmRepoData

Bases: opan.const.OpanEnum

Enumeration class for datatypes in VPT2 HDF5 repository.

Contains enumeration parameters to indicate the type of data to be retrieved from the on-disk HDF5 repository in the VPT2 anharmonic calculations of the opan.vpt2 submodule.

Enum Values

ENERGY = 'ENERGY'

Energy value at the given displacement

GEOM = 'GEOM'

Geometry at the given displacement (max precision available)

GRAD = 'GRAD'

Cartesian gradient vector

HESS = 'HESS'

Cartesian Hessian matrix

class opan.const.EnumAnharmRepoParam

Bases: opan.const.OpanEnum

Enumeration class for parameters in VPT2 HDF5 repository.

Contains enumeration parameters to indicate the parameter value to be retrieved from the on-disk HDF5 repository in the VPT2 anharmonic calculations of the opan.vpt2 submodule.

Enum Values

ATOMS = 'ATOMS'

Length-N vector of all-caps atomic symbols

CTR_MASS = 'CTR_MASS'

Cartesian center of mass of system, with perturbations applied, if any

INCREMENT = 'INCREMENT'

Displacement increment in \(\mathrm{B}\,\mathrm{u^{1/2}}\). Note that these are not atomic units, which would instead be \(\mathrm{B}\,\mathrm{m_e^{1/2}}\).

PERT_MODE = 'PERT_MODE'

opan.const.EnumMassPertType indicating perturbation type

PERT_VEC = 'PERT_VEC'

Length-3*N vector of perturbation factors (all should be ~1)

REF_MASSES = 'REF_MASSES'

Reference values of atomic masses (unperturbed)

class opan.const.EnumCheckGeomMismatch

Bases: opan.const.OpanEnum

Enumeration for mismatch types in check_geom()

Only mismatches of validly constructed coordinates and atoms vector combinations are represented here; other mismatches/misconfigurations result in raised Exceptions.

Enum Values

ATOMS = 'ATOMS'

Mismatch in individual atom(s)

COORDS = 'COORDS'

Mismatch in individual coordinate(s)

DIMENSION = 'DIMENSION'

Mismatch in dimensions of the two geometries

class opan.const.EnumDispDirection

Bases: opan.const.OpanEnum

Enumeration class for displacement directions.

Contains enumeration parameters to indicate the displacement of the molecular geometry associated with a gradient, hessian or other object.

Enum Values

NEGATIVE = 'NEGATIVE'

Negative displacement along a particular normal mode

NO_DISP = 'NO_DISP'

Non-displaced geometry

POSITIVE = 'POSITIVE'

Positive displacement along a particular normal mode

class opan.const.EnumFileType

Bases: opan.const.OpanEnum

Enumeration class for the file types generated by computational codes.

Enum Values

GRAD = 'GRAD'

Files containing nuclear gradient information

HESS = 'HESS'

Files containing nuclear Hessian information

INPUTFILE = 'INPUTFILE'

Input files for defining computations

OUTPUT = 'OUTPUT'

Files containing computational output

XYZ = 'XYZ'

XYZ atomic coordinates, assumed to follow the Open Babel XYZ specification extlink

class opan.const.EnumIterMeta

Bases: type

Metaclass for enumeration types allowing in membership testing.

__iter__()

Iterate over all defined enumeration values.

Generator iterating over all class variables whose names match their contents. For a properly constructed OpanEnum subclass, these are identical to the enumeration values.

Example:

>>> [val for val in sorted(opan.const.EnumDispDirection)]
['NEGATIVE', 'NO_DISP', 'POSITIVE']
__contains__(value)

Returns True if value is a valid value for the enumeration type, else False.

Example:

>>> 'NO_DISP' in opan.const.EnumDispDirection
True
class opan.const.EnumMassPertType

Bases: opan.const.OpanEnum

Enumeration class for atom mass perturbation types.

Contains enumeration parameters to indicate the type of mass perturbation to be applied to the various atoms of a geometry, in order to: (a) break inertial degeneracy sufficiently to allow VPT2 computation using a lower- symmetry formalism; and (b), in the case of linear molecules, introduce an artificial ‘directional preference’ to the masses of the atoms (BY_COORD enum value) to break the intrinsic degeneracy of the bending modes.

Enum Values

BY_ATOM = 'BY_ATOM'

Atomic masses are perturbed atom-by-atom in an isotropic fashion

BY_COORD = 'BY_COORD'

Atomic masses are perturbed anisotropically, where the perturbation factor for each atom’s mass varies slightly in the x-, y-, and z-directions

NO_PERTURB = 'NO_PERTURB'

Atomic masses are used without modification

class opan.const.EnumSoftware

Bases: opan.const.OpanEnum

Enumeration class for identifying computational chemistry packages.

This enum will be expanded if/when support for additional packages is implemented.

Enum Values

ORCA = 'ORCA'

The ORCA program package

class opan.const.EnumTopType

Bases: opan.const.OpanEnum

Enumeration class for classifying types of molecular tops.

Contains enumeration parameters to indicate the type of molecular top associated with a particular geometry.

Inertial moments with magnitudes less than opan.const.PRM.ZERO_MOMENT_TOL are taken as zero. Nonzero moments by this metric are considered to be equal if their ratio differs from unity by less than opan.const.PRM.EQUAL_MOMENT_TOL. See opan.utils.inertia.principals() and the other functions defined in opan.utils.inertia for more details.

Enum Values

ASYMM = 'ASYMM'

Three unique non-zero moments

ATOM = 'ATOM'

Three zero principal inertial moments

LINEAR = 'LINEAR'

One zero and two equal non-zero moments

SPHERICAL = 'SPHERICAL'

Three equal, non-zero moments

SYMM_OBL = 'SYMM_OBL'

Three non-zero moments; smallest two equal

SYMM_PROL = 'SYMM_PROL'

Three non-zero moments; largest two equal

class opan.const.EnumUnitsRotConst

Bases: opan.const.OpanEnum

Units Enumeration class for rotational constants.

Contains enumeration parameters to indicate the associated/desired units of interpretation/display of a rotational constant.

String expressions of these units are provided in UNITS.rot_const.

Todo

Add link to exposition(?) of how RotConst expression is developed, once written.

Enum Values

ANGFREQ_ATOMIC = 'ANGFREQ_ATOMIC'

Angular frequency in atomic units, \(\frac{1}{\mathrm{T_a}}\)

ANGFREQ_SECS = 'ANGFREQ_SECS'

Angular frequency in SI units, \(\frac{1}{\mathrm s}\) (NOT \(\mathrm{Hz}\)!)

CYCFREQ_ATOMIC = 'CYCFREQ_ATOMIC'

Cyclic frequency in atomic units, \(\frac{\mathrm{cyc}}{\mathrm{T_a}}\)

CYCFREQ_HZ = 'CYCFREQ_HZ'

Cyclic frequency in \(\mathrm{Hz}\), \(\frac{\mathrm{cyc}}{\mathrm s}\)

CYCFREQ_MHZ = 'CYCFREQ_MHZ'

Cyclic frequency in \(\mathrm{MHz}\), millions of \(\frac{\mathrm{cyc}}{\mathrm s}\)

INV_INERTIA = 'INV_INERTIA'

Inverse moment of inertia, \(\frac{1}{\mathrm{u\,B^2}}\). Note that the mass units here are not atomic units, which would require \(\frac{1}{\mathrm{m_e\,B^2}}\).

WAVENUM_ATOMIC = 'WAVENUM_ATOMIC'

Wavenumbers in atomic units, \(\frac{\mathrm{cyc}}{\mathrm{B}}\)

WAVENUM_CM = 'WAVENUM_CM'

Wavenumbers in conventional units, \(\frac{\mathrm{cyc}}{\mathrm{cm}}\)

class opan.const.OpanEnum

Bases: object

Superclass for enumeration objects.

Metaclassed with EnumIterMeta to allow direct iteration and membership testing of enumeration values on the subclass type.

class opan.const.PHYS

Bases: object

Container for physical constants

Members

ANG_PER_BOHR = 0.52917721067

float – Angstroms per Bohr radius (source: NIST extlink)

LIGHT_SPEED = 137.036

float – Speed of light in atomic units, \(\frac{B}{T_a}\). Calculated from the NIST extlink value for the speed of light in vacuum, \(2.99792458e8\ \frac{m}{s}\), using ANG_PER_BOHR and SEC_PER_TA as conversion factors

ME_PER_AMU = 1822.8885

float – Electron mass per unified atomic mass unit (source: NIST extlink)

PLANCK = 6.283185307179586

float – Standard Planck constant, equal to \(2\pi\) in atomic units of \(\frac{\mathrm{E_h\,T_a}}{\mathrm{cyc}}\)

PLANCK_BAR = 1.0

float – Reduced Planck constant, unity by definition in the atomic units of \(\mathrm{E_h\,T_a}\)

SEC_PER_TA = 2.4188843265e-17

float – Seconds per atomic time unit (source: NIST extlink)

class opan.const.PRM

Bases: object

Container for internal computation parameters (not user-adjustable)

Members

EQUAL_MOMENT_TOL = 0.001

float – Minimum deviation-ratio from unity below which two principal inertial moments are considered equal

MAX_SANE_DIPDER = 100.0

float – Trap value for aberrantly large dipole derivative values in ORCA if dipoles are not calculated in a NUMFREQ run

NON_PARALLEL_TOL = 0.001

float – Minimum angle deviation (degrees) required for two vectors to be considered non-parallel

ZERO_MOMENT_TOL = 0.001

float – Threshold value below which moments are considered equal to zero; units of \(\mathrm{u\,B^2}\)

ZERO_VEC_TOL = 1e-06

float – Vector magnitude below which a vector is considered equal to the zero vector; dimensionless or units of \(\mathrm{B}\)

class opan.const.UNITS

Bases: object

Container for dicts providing strings describing the various display units available for physical quantities.

Dictionary keys are the enum values provided in the corresponding EnumUnits[...] class in this module (opan.const).

Dictionary Enum Physical Quantity
rot_const EnumUnitsRotConst Rotational constant
rot_const = {'ANGFREQ_ATOMIC': '1/Ta', 'ANGFREQ_SECS': '1/s', 'CYCFREQ_ATOMIC': 'cyc/Ta', 'CYCFREQ_HZ': 'cyc/s', 'CYCFREQ_MHZ': 'MHz', 'INV_INERTIA': '1/(amu*B^2)', 'WAVENUM_ATOMIC': 'cyc/B', 'WAVENUM_CM': 'cyc/cm'}

dict