18 RepresentationPolicy::_type from, RepresentationPolicy::_type to,
19 SpacePolicy::_type Stype) {
20 if (from == to)
return 0;
21 int lda = (Stype == SpacePolicy::L) ? fdim : 1;
22 if (from == RepresentationPolicy::Diabatic && to == RepresentationPolicy::Adiabatic) {
24 if (Stype == SpacePolicy::L)
ARRAY_MATMUL(A, A,
T, fdim, fdim, fdim);
26 if (from == RepresentationPolicy::Adiabatic && to == RepresentationPolicy::Diabatic) {
34 std::string rep_string = PM->get_string(
"representation_flag",
LOC(),
"Diabatic");
36 inp_repr_type = RepresentationPolicy::_from(PM->get_string(
"inp_repr_flag",
LOC(), rep_string));
37 ele_repr_type = RepresentationPolicy::_from(PM->get_string(
"ele_repr_flag",
LOC(), rep_string));
38 nuc_repr_type = RepresentationPolicy::_from(PM->get_string(
"nuc_repr_flag",
LOC(), rep_string));
39 tcf_repr_type = RepresentationPolicy::_from(PM->get_string(
"tcf_repr_flag",
LOC(), rep_string));
92 int*
occ_nuc = this->occ_nuc + iP;
96 case RepresentationPolicy::Diabatic: {
101 case RepresentationPolicy::Adiabatic: {
126 int csr1 = 0, csr2 = 0, csr12 = 0;
130 if (std::abs(
TtTold[k1k2]) > maxnorm) {
131 maxnorm = std::abs(
TtTold[k1k2]);
132 csr1 = k1, csr2 = k2, csr12 = k1k2;
136 double vsign = copysign(1.0f,
TtTold[csr12]);
145 TtTold[csr12] = vsign * vset;
166 for (
int b = 0, bb = 0; b < B; ++b, bb +=
Dimension::Fadd1, dVb0 += JFF, dEb0 += JFF) {
169 for (
int j = 0, jik = 0, jbb = bb; j < J; ++j, jbb +=
Dimension::FF) {
170 double scale = dVb0[jbb] / dVb0[bb];
171 for (
int ik = 0; ik <
Dimension::FF; ++ik, ++jik) { dEb0[jik] = dEb0[ik] * scale; }
196 double Emean = 0.0e0;
211 for (
int j = 0; j <
Dimension::N; ++j) Ekin += 0.5f *
p[j] *
p[j] /
m[j];
217 Epes += std::real(
rho_ele[ii]) *
E[i];
221 H[ii] = -2 * Ekin * sqrt(std::max<double>(1.0 + (Epes -
E[i]) / Ekin, 0.0f));
227 case RepresentationPolicy::Force:
228 case RepresentationPolicy::Density:
this file provides Kernel_NADForce class enabling force weighting from electronic properties.
#define ARRAY_MATMUL_TRANS2(_A, _B, _C, _n1, _n2, _n3)
#define ARRAY_MATMUL3_TRANS1(_A, _B, _C, _D, _n1, _n2, _n0, _n3)
#define ARRAY_MATMUL(_A, _B, _C, _n1, _n2, _n3)
#define ARRAY_MATMUL_TRANS1(_A, _B, _C, _n1, _n2, _n3)
static NADForcePolicy::_type NADForce_type
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
static RepresentationPolicy::_type ele_repr_type
representation for electronic dynamics
static RepresentationPolicy::_type nuc_repr_type
representation for nuclear dynamics
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
virtual const std::string getName()
Get the name of the kernel.
virtual int getType() const
Get the type of the kernel.
static RepresentationPolicy::_type representation_type
root representation
virtual void setInputParam_impl(std::shared_ptr< Param > &PM)
Virtual function to set input parameters for the kernel implementation.
static int transform(kids_complex *A, kids_real *T, int fdim, RepresentationPolicy::_type from, RepresentationPolicy::_type to, SpacePolicy::_type Stype)
virtual Status & initializeKernel_impl(Status &stat)
Virtual function to initialize the kernel implementation.
static bool onthefly
flag indicated the ab inition calculation
static RepresentationPolicy::_type tcf_repr_type
representation for intrinsic calculation of TCF
std::complex< double > * R
static RepresentationPolicy::_type inp_repr_type
representatioin for input (quantities)
std::complex< double > * H
Status & executeKernel(Status &stat)
Execute the kernel's algorithm and those of its children.
std::shared_ptr< DataSet > _dataset
Shared pointer to the DataSet object associated with this kernel.
#define LOC()
show the location information for debug
VARIABLE< kids_real > TtTold
VARIABLE< kids_real > vedE
VARIABLE< kids_complex > rho_ele
VARIABLE< kids_int > occ_nuc
VARIABLE< kids_real > Told
VARIABLE< kids_complex > R
VARIABLE< kids_complex > H
std::size_t NFF
Product of N, F, and F (N * F * F).
std::size_t N
Number of nuclear degrees of freedom.
std::size_t PFF
Product of P, F, and F (P * F * F).
std::size_t P
Number of parallel trajectories (swarms of trajectories) in each Monte Carlo run.
std::size_t F
Number of electronic degrees of freedom.
std::size_t Fadd1
F plus 1 (F + 1).
std::size_t FF
Product of F and F (F * F).
std::size_t NF
Product of N and F (N * F).
< http://warp.povusers.org/FunctionParser/fparser.html
void ARRAY_TRANSPOSE(kids_real *A, size_t N1, size_t N2)
double kids_real
Alias for real number type.
std::complex< double > kids_complex
Alias for complex number type.
void EigenSolve(kids_real *E, kids_real *T, kids_real *A, size_t N)
Solve the eigenvalue problem for real matrices.
constexpr std::complex< real_precision > im(0.0L, 1.0L)
Imaginary Unit.
constexpr uint32_t hash(const char *str)
declaration of variables used in the program.