Source code for CDTK.Dynamics.ObservableTAS

#*  **************************************************************************
#*
#*  CDTK, Chemical Dynamics Toolkit
#*  A modular system for chemical dynamics applications and more
#*
#*  Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016
#*  Oriol Vendrell, DESY, <oriol.vendrell@desy.de>
#*
#*  Copyright (C) 2017, 2018, 2019
#*  Ralph Welsch, DESY, <ralph.welsch@desy.de>
#*
#*  Copyright (C) 2020, 2021, 2022, 2023
#*  Ludger Inhester, DESY, ludger.inhester@cfel.de
#*
#*  This file is part of CDTK.
#*
#*  CDTK is free software: you can redistribute it and/or modify
#*  it under the terms of the GNU General Public License as published by
#*  the Free Software Foundation, either version 3 of the License, or
#*  (at your option) any later version.
#*
#*  This program is distributed in the hope that it will be useful,
#*  but WITHOUT ANY WARRANTY; without even the implied warranty of
#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#*  GNU General Public License for more details.
#*
#*  You should have received a copy of the GNU General Public License
#*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#*
#*  **************************************************************************
#! /usr/bin/env python

import sys
import string
import os
import math
 
import numpy as np

import CDTK.Tools.Conversion as conv



[docs] class ObservableTAS(object): """ Compute the transient absorption spectra """ def __init__(self,**opts): """ Init an ObservableTAS object - simbox: SimulationBox object default = None - external_TAS: function returning the transition dipoles and energies for TAS computation - _ONAME: name of the observable [ob]servable_[t]ransient[a]bsorption[s]pectra """ self.simbox = opts.get('simbox',None) self.external_TAS = opts.get('external_TAS',None) self._ONAME = 'ob_tas'
[docs] def getDipoleEnergyTAS(self, a_x, state_current, **opts): """ Return the transition dipoles and energies for the TAS calculation Inputs: - a_x: molecular coordinates in bohr - state_current: current electronic state """ X = a_x.copy() natoms = X.size/3 X.shape = (natoms,3) # run Molcas calculation for the absorption spectra if self.external_TAS is None: raise ValueError('external absorption spectra not defined') # DipEn[ MU[XYZ]. EIJ ] DipEn = self.external_TAS(X, state_current) return DipEn
def _update_logfile(self): pass