37 case SystemPolicy::SB: {
42 double HSB[4] = {bias, delta, delta, -bias};
46 case SystemPolicy::FMO: {
51 for (
int i = 0, ik = 0; i < 7; ++i) {
56 case SystemPolicy::SF3a: {
62 case SystemPolicy::SF3b: {
68 case SystemPolicy::SF5a: {
74 case SystemPolicy::SF5b: {
80 case SystemPolicy::FCP: {
84 for (
int i = 0, ik = 0; i < 9; ++i) {
89 case SystemPolicy::AGG: {
93 for (
int k = 0; k <
Dimension::F; ++k, ++ik)
Hsys[ik] = (i - k == 1 || k - i == 1) ? delta : 0.0f;
97 case SystemPolicy::CYC: {
101 for (
int k = 0; k <
Dimension::F; ++k, ++ik)
Hsys[ik] = (i - k == 1 || k - i == 1) ? delta : 0.0f;
107 case SystemPolicy::Read: {
108 std::string system_readfile =
_param->get_string(
"system_readfile",
LOC(),
"system.dat");
109 std::ifstream ifs(system_readfile);
110 std::string H_unit_str;
111 std::string firstline;
112 getline(ifs, firstline);
113 std::stringstream sstr(firstline);
119 if (ifs >> val)
Hsys[i] = val / H_unit;
137 case CouplingPolicy::SB: {
138 Q[0] = 1.0f,
Q[1] = 0.0f,
Q[2] = 0.0f,
Q[3] = -1.0f;
141 case CouplingPolicy::SE: {
143 for (
int i = 0, idx = 0; i <
nbath; ++i) {
145 for (
int k = 0; k <
Dimension::F; ++k, ++idx)
Q[idx] = (i == j && i == k) ? 1.0f : 0.0f;
151 std::string coupling_readfile =
_param->get_string(
"coupling_readfile",
LOC(),
"coupling.dat");
152 std::ifstream ifs(coupling_readfile);
155 if (ifs >> tmp)
Q[i] = tmp;
161 for (
int ibath = 0, idx = 0; ibath <
nbath; ++ibath) {
162 for (
int j = 0; j <
Nb; ++j) {
169 if (iL >
L)
throw std::runtime_error(
" Q shoule be sparsed!");
201 for (
int ibath = 0, idxR = 0; ibath <
nbath; ++ibath) {
202 for (
int j = 0; j <
Nb; ++j, ++idxR) {
209 for (
int ibath = 0, idxR = 0; ibath <
nbath; ++ibath) {
210 for (
int j = 0; j <
Nb; ++j, ++idxR) {
211 double Eq =
omegas[j] * (0 + 0.5);
212 double Ec = 0.5 *
p[idxR] *
p[idxR] + 0.5 *
omegas[j] *
omegas[j] *
x[idxR] *
x[idxR];
213 double scale = sqrt(Eq / Ec);
214 x[idxR] =
x[idxR] * scale;
215 p[idxR] =
p[idxR] * scale;
240 for (
int ibath = 0, idxR = 0; ibath <
nbath; ++ibath) {
241 for (
int j = 0; j <
Nb; ++j, ++idxR) {
246 vpes[0] = 0.5 * term;
251 case CouplingPolicy::SB: {
253 for (
int ibath = 0, idxR = 0; ibath <
nbath; ++ibath) {
254 for (
int j = 0; j <
Nb; ++j, ++idxR) { term +=
coeffs[j] *
x[idxR]; }
260 case CouplingPolicy::SE: {
262 for (
int j = 0; j <
Nb; ++j, ++idxR) {
V[idxV] +=
coeffs[j] *
x[idxR]; }
267 for (
int ibath = 0, idxR = 0, idxQ0 = 0; ibath <
nbath; ++ibath, idxQ0 +=
Dimension::FF) {
268 for (
int j = 0; j <
Nb; ++j, ++idxR) {
269 double cxj =
coeffs[j] *
x[idxR];
270 for (
int i = 0, idxQ = idxQ0; i <
Dimension::FF; ++i, ++idxQ) {
V[i] +=
Q[idxQ] * cxj; }
279 for (
int ibath = 0, idxQ0 = 0, idxdV = 0; ibath <
nbath; ++ibath, idxQ0 +=
Dimension::FF) {
280 for (
int j = 0; j <
Nb; ++j) {
281 for (
int i = 0, idxQ = idxQ0; i <
Dimension::FF; ++i, ++idxQ, ++idxdV) {
this file provides Kernel_NADForce class enabling force weighting from electronic properties.
#define ARRAY_CLEAR(_A, _n)
static int rand_gaussian(kids_real *res_arr, int N=1, kids_real sigma=1.0, kids_real mu=0.0)
std::vector< std::shared_ptr< Kernel > > _child_kernels
Vector containing shared pointers to the child kernels of this kernel.
std::shared_ptr< Param > _param
Shared pointer to the Param object associated with this kernel.
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.
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
SystemPolicy::_type system_type
virtual int getType() const
Get the type of the kernel.
virtual Status & initializeKernel_impl(Status &stat)
Virtual function to initialize the kernel implementation.
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
kids_real * Xnj
used in Stochastic Schrodinger Equation Methods
kids_real * coeffs
save coupling coefficients (only for simple model, L=1)
virtual const std::string getName()
Get the name of the kernel.
NSampPolicy::_type nsamp_type
CouplingPolicy::_type coupling_type
kids_real * omegas
save discrete frequencies (only for simple model, L=1)
kids_real * CL
save coupling coefficients with Qj (Qj has L no. of nonzero elements)
virtual void setInputParam_impl(std::shared_ptr< Param > &PM)
Virtual function to set input parameters for the kernel implementation.
kids_real * QL
save coulping matrix, each and L no. of nonzero elements
static uval parse(const std::string &str)
CONSTEXPR_DECOR value_type conv(const uval &u)
#define LOC()
show the location information for debug
const double HSF5b_data[]
const double HSF5a_data[]
const double HSF3b_data[]
const double HSF3a_data[]
VARIABLE< kids_real > p_sigma
VARIABLE< kids_real > x_sigma
VARIABLE< kids_real > omegas
VARIABLE< kids_real > coeffs
VARIABLE< kids_real > Xnj
VARIABLE< kids_real > hess
VARIABLE< kids_real > vpes
VARIABLE< kids_real > grad
VARIABLE< kids_real > mass
std::size_t PN
Product of P and N (P * N).
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 P
Number of parallel trajectories (swarms of trajectories) in each Monte Carlo run.
std::size_t NN
Product of N and N (N * N).
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).
< http://warp.povusers.org/FunctionParser/fparser.html
double kids_real
Alias for real number type.
constexpr dimension7 energy_d
[M*L^2/T^2] force integrate length
static CONSTTYPE real_precision au_2_wn
static CONSTTYPE real_precision au_2_ev
constexpr uint32_t hash(const char *str)
declaration of variables used in the program.