Source code for CDTK.Dynamics.Models.testModels

#*  **************************************************************************
#*
#*  CDTK, Chemical Dynamics Toolkit
#*  A modular system for chemical dynamics applications and more
#*
#*  Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016
##  Newton is free software: you can redistribute it and/or modify
#*
#*  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/>.
#*
#*  **************************************************************************
##  Newton, a modular system for mixed quantum-classical dynamics
##  Copyright (C) 2012 - 2014
##  O. Vendrell, DESY
##
#*  Copyright (C) 2020, 2021, 2022, 2023
#*  Ludger Inhester, DESY, ludger.inhester@cfel.de
#*
##  This file is part of Newton.
##
##  Newton 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/>.
##
##  $Id$

import math as mt
import numpy as np
import CDTK.Tools.Conversion as cv

k = 3000.0 * cv.ic2au
d0 = 1.0 * cv.an2au
omega = 3500.0 * cv.ic2au
omega2 = omega**2
delta = 4.0
lambd = 1.0

[docs] def tetrahedron(x): """ Energy of four particles interacting via harmonic two body terms E = 0.5*k \Sum_{i>j} (dij - d0)**2 """ d1 = x[0:3] - x[3:6] d2 = x[0:3] - x[6:9] d3 = x[0:3] - x[9:12] d4 = x[3:6] - x[6:9] d5 = x[3:6] - x[9:12] d6 = x[6:9] - x[9:12] D12 = np.dot(d1,d1) D22 = np.dot(d2,d2) D32 = np.dot(d3,d3) D42 = np.dot(d4,d4) D52 = np.dot(d5,d5) D62 = np.dot(d6,d6) D1 = D12**0.5 D2 = D22**0.5 D3 = D32**0.5 D4 = D42**0.5 D5 = D52**0.5 D6 = D62**0.5 S2 = D12 + D22 + D32 + D42 + D52 + D62 S02 = 6.0*d0**2 SDD = -2.0*d0*(D1 + D2 + D3 + D4 + D5 + D6) return 0.5*k*(S2 + S02 + SDD)
[docs] def crossing2D(x): """ Simple avoided crossing between two PES """ w11 = 0.5*(1-mt.tanh(x[0]/delta)) + 0.5*omega2*x[1]**2 w00 = 0.5*(1+mt.tanh(x[0]/delta)) + 0.5*omega2*x[1]**2 w01 = lambd*x[1] w10 = w01 h = np.array([[w00,w01],[w10,w11]],float) E = 0.5*(w00 + w11) D = 0.5*mt.sqrt( (w00 - w11)**2 + 4.0*w01**2 ) return E-D,E+D