#* **************************************************************************
#*
#* 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
[docs]
class ObservableCharge(object):
"""
Compute the positive charge on atoms
"""
def __init__(self,**opts):
"""
Init an ObservableCharge 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_CHARGE = opts.get('external_CHARGE',None)
self._ONAME = 'ob_charge'
[docs]
def getCharge(self, state_current, **opts):
"""
Return the positive charges on atoms
Inputs:
- a_x: molecular coordinates in bohr
- state_current: current electronic state
"""
# run Molcas calculation for atomic charges
if self.external_CHARGE is None:
raise ValueError('external charge not defined')
# charge
charge = self.external_CHARGE(state_current)
return charge
def _update_logfile(self):
pass