KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
Kernel_Update_c.cpp
Go to the documentation of this file.
2
4#include "kids/debug_utils.h"
5#include "kids/hash_fnv1a.h"
6#include "kids/linalg.h"
7#include "kids/macro_utils.h"
8#include "kids/vars_list.h"
9
10namespace PROJECT_NS {
11
12const std::string Kernel_Update_c::getName() { return "Kernel_Update_c"; }
13
15
16void Kernel_Update_c::setInputDataSet_impl(std::shared_ptr<DataSet>& DS) {
17 dt_ptr = DS->def(DATA::iter::dt);
18 E = DS->def(DATA::model::rep::E);
19 T = DS->def(DATA::model::rep::T);
20 L = DS->def(DATA::model::rep::L);
21 R = DS->def(DATA::model::rep::R);
22 U = DS->def(DATA::integrator::U);
23 Udt = DS->def(DATA::integrator::Udt);
24 succ_ptr = DS->def(DATA::iter::succ);
25 frez_ptr = DS->def(DATA::iter::frez);
27}
28
30 if (frez_ptr[0]) return stat;
31
32 for (int iP = 0; iP < Dimension::P; ++iP) {
33 // local variables for iP-th of swarm
34 kids_real* E = this->E + iP * Dimension::F;
35 kids_real* T = this->T + iP * Dimension::FF;
36 kids_real* L = this->L + iP * Dimension::F;
37 kids_complex* R = this->R + iP * Dimension::FF;
38 kids_complex* U = this->U + iP * Dimension::FF;
39 kids_complex* Udt = this->Udt + iP * Dimension::FF;
40
42 case RepresentationPolicy::Diabatic: {
43 for (int i = 0; i < Dimension::F; ++i)
44 invexpidiagdt[i] = exp(-phys::math::im * E[i] * scale * dt_ptr[0]);
47 break;
48 }
49 case RepresentationPolicy::Adiabatic: {
50 for (int i = 0; i < Dimension::F; ++i)
51 invexpidiagdt[i] = exp(-phys::math::im * L[i] * scale * dt_ptr[0]);
54 break;
55 }
56 default: // representation_policy::force, representation_policy::density
57 // LOG(FATAL);
58 break;
59 }
60 }
61 return stat;
62}
63}; // namespace PROJECT_NS
#define ARRAY_MATMUL3_TRANS2(_A, _B, _C, _D, _n1, _n2, _n0, _n3)
#define ARRAY_MATMUL(_A, _B, _C, _n1, _n2, _n3)
static RepresentationPolicy::_type ele_repr_type
representation for electronic dynamics
kids_real * E
Eigenvalue for diabatic V.
kids_real * T
Eigenvector for diabatic V.
kids_complex * Udt
short time propagator
kids_complex * R
Eigenvector for adiabatic effective Hamiltonian Heff = Eδ - id*P/M.
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
kids_complex * U
full propagator along classical path approximation (CPA)
virtual const std::string getName()
Get the name of the kernel.
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
kids_real * L
Eigenvalue for adiabatic effective Hamiltonian Heff = Eδ - id*P/M.
kids_complex * invexpidiagdt
temporary variables
virtual int getType() const
Get the type of the kernel.
provide utils for debugging the code
Provide linalg APIs.
#define FUNCTION_NAME
Definition macro_utils.h:9
VARIABLE< kids_complex > invexpidiagdt
VARIABLE< kids_complex > U
VARIABLE< kids_complex > Udt
VARIABLE< kids_real > dt
VARIABLE< kids_bint > frez
VARIABLE< kids_bint > succ
VARIABLE< kids_real > E
VARIABLE< kids_real > L
VARIABLE< kids_real > T
VARIABLE< kids_complex > R
std::size_t P
Number of parallel trajectories (swarms of trajectories) in each Monte Carlo run.
Definition vars_list.cpp:9
std::size_t F
Number of electronic degrees of freedom.
Definition vars_list.cpp:11
std::size_t FF
Product of F and F (F * F).
Definition vars_list.cpp:21
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
double kids_real
Alias for real number type.
Definition Types.h:59
std::complex< double > kids_complex
Alias for complex number type.
Definition Types.h:60
constexpr std::complex< real_precision > im(0.0L, 1.0L)
Imaginary Unit.
constexpr uint32_t hash(const char *str)
Definition hash_fnv1a.h:12
declaration of variables used in the program.