25 Phi_(
std::move(spos)),
27 params_supplied_(false),
43 std::copy(param_list.begin(), param_list.end(), params_data_alias);
50 for (
int i = 0; i < nel; i++)
51 for (
int j = nel; j < nmo; j++)
52 rot_indices.emplace_back(i, j);
57 rot_indices.reserve(nmo * (nmo - 1) / 2);
61 for (
int i = 0; i < nel; i++)
62 for (
int j = nel; j < nmo; j++)
63 rot_indices.emplace_back(i, j);
66 for (
int i = 0; i < nel; i++)
67 for (
int j = i + 1; j < nel; j++)
68 rot_indices.emplace_back(i, j);
71 for (
int i = nel; i < nmo; i++)
72 for (
int j = i + 1; j < nmo; j++)
73 rot_indices.emplace_back(i, j);
77 const std::vector<ValueType>& param,
80 assert(rot_indices.size() == param.size());
85 for (
int i = 0; i < rot_indices.size(); i++)
87 const int p = rot_indices[i].first;
88 const int q = rot_indices[i].second;
99 std::vector<ValueType>& param)
101 assert(rot_indices.size() == param.size());
104 for (
int i = 0; i < rot_indices.size(); i++)
106 const int p = rot_indices[i].first;
107 const int q = rot_indices[i].second;
108 param[i] = rot_mat[q][p];
115 std::vector<ValueType> delta_param(nact_rot);
120 auto* delta_param_data_alias = (
RealType*)delta_param.data();
124 delta_param_data_alias[i] = active[loc] -
myVars[i];
146 hout.
push(
"RotatedSPOs");
149 hout.
push(
"rotation_global");
150 const std::string rot_global_name = std::string(
"rotation_global_") +
SPOSet::getName();
157 hout.
push(
"rotation_history");
164 for (
size_t i = 0; i < rows; i++)
165 for (
size_t j = 0; j < cols; j++)
167 std::string rot_hist_name = std::string(
"rotation_history_") +
SPOSet::getName();
168 hout.
write(tmp, rot_hist_name);
174 hout.
push(
"rotation_params");
175 std::string rot_params_name = std::string(
"rotation_params_") +
SPOSet::getName();
178 auto* params_data_alias = (
RealType*)params.data();
180 params_data_alias[i] =
myVars[i];
182 hout.
write(params, rot_params_name);
190 hin.
push(
"RotatedSPOs",
false);
192 bool grp_hist_exists = hin.
is_group(
"rotation_history");
193 bool grp_global_exists = hin.
is_group(
"rotation_global");
194 if (!grp_hist_exists && !grp_global_exists)
195 app_warning() <<
"Rotation parameters not found in VP file";
198 if (grp_global_exists)
200 hin.
push(
"rotation_global",
false);
201 const std::string rot_global_name = std::string(
"rotation_global_") +
SPOSet::getName();
203 std::vector<int> sizes(1);
205 throw std::runtime_error(
"Failed to read rotation_global in VP file");
209 std::ostringstream tmp_err;
210 tmp_err <<
"Expected number of full rotation parameters (" <<
myVarsFull_.size()
211 <<
") does not match number in file (" << sizes[0] <<
")";
212 throw std::runtime_error(tmp_err.str());
220 else if (grp_hist_exists)
222 hin.
push(
"rotation_history",
false);
223 std::string rot_hist_name = std::string(
"rotation_history_") +
SPOSet::getName();
224 std::vector<int> sizes(2);
226 throw std::runtime_error(
"Failed to read rotation history in VP file");
232 hin.
read(tmp, rot_hist_name);
233 for (
size_t i = 0; i < rows; i++)
236 for (
size_t j = 0; j < cols; j++)
245 hin.
push(
"rotation_params",
false);
246 std::string rot_param_name = std::string(
"rotation_params_") +
SPOSet::getName();
248 std::vector<int> sizes(1);
250 throw std::runtime_error(
"Failed to read rotation_params in VP file");
255 if (nparam != nparam_actual)
257 std::ostringstream tmp_err;
258 tmp_err <<
"Expected number of rotation parameters (" << nparam <<
") does not match number in file (" 259 << nparam_actual <<
")";
260 throw std::runtime_error(tmp_err.str());
263 std::vector<ValueType> params(sizes[0]);
264 hin.
read(params, rot_param_name);
265 auto* params_data_alias = (
RealType*)params.data();
266 for (
int i = 0; i < nparam; i++)
267 myVars[i] = params_data_alias[i];
287 const size_t nmo =
Phi_->getOrbitalSetSize();
304 const size_t nmo =
Phi_->getOrbitalSetSize();
313 app_log() <<
"Orbital rotation using global rotation" << std::endl;
315 app_log() <<
"Orbital rotation using history" << std::endl;
322 if (nparams_active !=
params_.size())
323 throw std::runtime_error(
324 "The number of supplied orbital rotation parameters does not match number prdouced by the slater " 328 auto registerParameter = [
this](
const int i,
const int p,
const int q,
opt_variables_type& optvars,
329 std::vector<ValueType>& params,
bool real_part) {
330 std::stringstream sstr;
331 std::string label = real_part ?
"_r" :
"_i";
332 sstr <<
my_name_ <<
"_orb_rot_" << (p < 10 ?
"0" :
"") << (p < 100 ?
"0" :
"") << (p < 1000 ?
"0" :
"") << p <<
"_" 333 << (q < 10 ?
"0" :
"") << (q < 100 ?
"0" :
"") << (q < 1000 ?
"0" :
"") << q << label;
339 optvars.insert(sstr.str(), 0.0);
343 for (
int i = 0; i < nparams_active; i++)
356 for (
int i = 0; i < nfull_rot; i++)
363 app_log() << std::string(16,
' ') <<
"Parameter name" << std::string(15,
' ') <<
"Value\n";
370 std::vector<ValueType> param(
N);
372 auto* param_data_alias = (
RealType*)param.data();
375 param_data_alias[i] =
myVars[i];
384 const size_t nmo =
Phi_->getOrbitalSetSize();
397 Phi_->applyRotation(rot_mat, use_stored_copy);
402 const std::vector<ValueType>& old_param,
403 std::vector<ValueType>& new_param)
405 const size_t nmo =
Phi_->getOrbitalSetSize();
411 Phi_->applyRotation(new_rot_mat,
true);
416 const std::vector<ValueType>& old_param,
419 std::vector<ValueType>& new_param,
422 assert(delta_param.size() == act_rot_inds.size());
423 assert(old_param.size() == full_rot_inds.size());
424 assert(new_param.size() == full_rot_inds.size());
426 const size_t nmo = new_rot_mat.rows();
427 assert(new_rot_mat.rows() == new_rot_mat.cols());
440 BLAS::gemm(
'N',
'N', nmo, nmo, nmo, 1.0, delta_rot_mat.data(), nmo, old_rot_mat.data(), nmo, 0.0, new_rot_mat.data(),
452 const size_t nmo =
Phi_->getOrbitalSetSize();
464 Phi_->applyRotation(rot_mat, use_stored_copy);
478 const int n = mat.rows();
479 std::vector<std::complex<RealType>> mat_h(
n *
n, 0);
480 std::vector<RealType> eval(
n, 0);
481 std::vector<std::complex<RealType>> work(2 *
n, 0);
482 std::vector<RealType> rwork(3 *
n, 0);
483 std::vector<std::complex<RealType>> mat_d(
n *
n, 0);
484 std::vector<std::complex<RealType>> mat_t(
n *
n, 0);
489 for (
int i = 0; i <
n; ++i)
491 for (
int j = i; j <
n; ++j)
496 mat_h[i +
n * j] = std::complex<RealType>(
std::imag(mat[i][j]), -1.0 *
std::real(mat[i][j]));
497 mat_h[j +
n * i] = std::complex<RealType>(-
std::imag(mat[i][j]), 1.0 *
std::real(mat[i][j]));
510 LAPACK::heev(JOBZ,
UPLO,
N, &mat_h.at(0), LDA, &eval.at(0), &work.at(0), LWORK, &rwork.at(0), info);
513 std::ostringstream msg;
514 msg <<
"heev failed with info = " << info <<
" in RotatedSPOs::exponentiate_antisym_matrix";
515 throw std::runtime_error(msg.str());
518 for (
int i = 0; i <
n; ++i)
520 for (
int j = 0; j <
n; ++j)
522 mat_d[i + j *
n] = (i == j) ?
std::exp(std::complex<RealType>(0.0, eval[i])) : std::complex<RealType>(0.0, 0.0);
529 BLAS::gemm(
'N',
'C',
n,
n,
n, std::complex<RealType>(1.0, 0), &mat_d.at(0),
n, &mat_h.at(0),
n,
530 std::complex<RealType>(0.0, 0.0), &mat_t.at(0),
n);
532 BLAS::gemm(
'N',
'N',
n,
n,
n, std::complex<RealType>(1.0, 0), &mat_h.at(0),
n, &mat_t.at(0),
n,
533 std::complex<RealType>(0.0, 0.0), &mat_d.at(0),
n);
534 for (
int i = 0; i <
n; ++i)
535 for (
int j = 0; j <
n; ++j)
544 const int n = mat.rows();
545 std::vector<ValueType> mat_h(
n *
n, 0);
546 std::vector<RealType> mat_l(
n *
n, 0);
547 std::vector<std::complex<RealType>> mat_cd(
n *
n, 0);
548 std::vector<std::complex<RealType>> mat_cl(
n *
n, 0);
549 std::vector<std::complex<RealType>> mat_ch(
n *
n, 0);
551 for (
int i = 0; i <
n; ++i)
552 for (
int j = 0; j <
n; ++j)
554 mat_h[i +
n * j] = mat[i][j];
565 std::vector<RealType> eval_r(
n, 0);
566 std::vector<RealType> eval_i(
n, 0);
567 std::vector<RealType> work(4 *
n, 0);
568 LAPACK::geev(&JOBL, &JOBR, &
N, &mat_h.at(0), &LDA, &eval_r.at(0), &eval_i.at(0), &mat_l.at(0), &LDA,
nullptr, &LDA,
569 &work.at(0), &LWORK, &info);
571 std::vector<ValueType> eval(
n, 0);
572 std::vector<ValueType> work(2 *
n, 0);
573 std::vector<RealType> rwork(2 *
n, 0);
574 LAPACK::geev(&JOBL, &JOBR, &
N, &mat_h.at(0), &LDA, &eval.at(0), &mat_cl.at(0), &LDA,
nullptr, &LDA, &work.at(0),
575 &LWORK, &rwork.at(0), &info);
579 std::ostringstream msg;
580 msg <<
"heev failed with info = " << info <<
" in RotatedSPOs::log_antisym_matrix";
581 throw std::runtime_error(msg.str());
585 for (
int i = 0; i <
n; ++i)
587 for (
int j = 0; j <
n; ++j)
590 auto tmp = (i == j) ?
std::log(std::complex<RealType>(eval_r[i], eval_i[i])) : std::complex<RealType>(0.0, 0.0);
593 mat_cl[i + j *
n] = std::complex<RealType>(mat_l[i + j *
n], mat_l[i + (j + 1) *
n]);
594 mat_cl[i + (j + 1) *
n] = std::complex<RealType>(mat_l[i + j *
n], -mat_l[i + (j + 1) *
n]);
596 else if (!(eval_i[j] < 0.0))
598 mat_cl[i + j *
n] = std::complex<RealType>(mat_l[i + j *
n], 0.0);
603 mat_cd[i + j *
n] = tmp;
609 BLAS::gemm(
'N',
'N',
n,
n,
n, one, &mat_cl.at(0),
n, &mat_cd.at(0),
n, zero, &mat_ch.at(0),
n);
610 BLAS::gemm(
'N',
'C',
n,
n,
n, one, &mat_ch.at(0),
n, &mat_cl.at(0),
n, zero, &mat_cd.at(0),
n);
613 for (
int i = 0; i <
n; ++i)
614 for (
int j = 0; j <
n; ++j)
617 if (mat_cd[i +
n * j].
imag() > 1
e-12)
619 app_log() <<
"warning: large imaginary value in antisymmetric matrix: (i,j) = (" << i <<
"," << j
620 <<
"), im = " << mat_cd[i +
n * j].imag() << std::endl;
622 output[i][j] = mat_cd[i +
n * j].real();
624 output[i][j] = mat_cd[i +
n * j];
633 std::vector<ValueType>& ratios,
638 Phi_->evaluateDetRatios(VP, psi, psiinv, ratios);
640 const size_t nel = LastIndex - FirstIndex;
641 const size_t nmo =
Phi_->getOrbitalSetSize();
658 for (
int i = 0; i < nel; i++)
659 for (
int j = 0; j < nel; j++)
667 T_orig.resize(nel, nmo);
669 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0),
A, nmo, Ainv, nel,
ValueType(0.0), T_orig.data(), nmo);
679 Phi_->evaluateValue(VP, iat, tmp_psi);
681 for (
int j = 0; j < nmo; j++)
682 psiM_all(iel - FirstIndex, j) = tmp_psi[j];
684 for (
int i = 0; i < nel; i++)
685 for (
int j = 0; j < nel; j++)
696 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0),
A, nmo, Ainv, nel,
ValueType(0.0), T.data(), nmo);
706 dratios(iat, kk) = T(p, q) - T_orig(p, q);
722 const size_t nel = LastIndex - FirstIndex;
723 const size_t nmo =
Phi_->getOrbitalSetSize();
739 for (
int i = 0; i < nel; i++)
740 for (
int j = 0; j < nel; j++)
751 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0),
A, nmo, Ainv, nel,
ValueType(0.0), T.data(), nmo);
761 dlogpsi[kk] = T(p, q);
774 const int& FirstIndex,
775 const int& LastIndex)
777 const size_t nel = LastIndex - FirstIndex;
778 const size_t nmo =
Phi_->getOrbitalSetSize();
791 Bbar.resize(nel, nmo);
806 for (
int i = 0; i < nel; i++)
807 for (
int j = 0; j < nel; j++)
814 for (
int a = 0; a < nel; a++)
815 for (
int i = 0; i < nel; i++)
816 for (
int k = 0; k < 3; k++)
819 for (
int a = 0; a < nel; a++)
821 for (
int i = 0; i < nel; i++)
828 for (
int a = 0, iat = FirstIndex; a < nel; a++, iat++)
834 for (
int i = 0; i < nel; i++)
835 for (
int j = 0; j < nmo; j++)
856 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0),
A, nmo, Ainv, nel,
ValueType(0.0), T.data(), nmo);
857 BLAS::gemm(
'N',
'N', nel, nel, nel,
ValueType(1.0),
B, nmo, Ainv, nel,
ValueType(0.0), Y1.data(), nel);
858 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0), T.data(), nmo, Y1.data(), nel,
ValueType(0.0), Y2.data(), nmo);
859 BLAS::gemm(
'N',
'N', nmo, nel, nel,
ValueType(1.0),
B, nmo, Ainv, nel,
ValueType(0.0), Y3.data(), nmo);
882 dlogpsi[kk] += pref1 * T(p, q);
883 dhpsioverpsi[kk] += pref2 * Y4(p, q);
893 const std::vector<ValueType>& Coeff,
894 const std::vector<size_t>& C2node_up,
895 const std::vector<size_t>& C2node_dn,
908 const std::vector<int>& detData_up,
913 const std::vector<std::vector<int>>& lookup_tbl)
916 bool recalculate(
false);
938 const size_t nmo =
Phi_->getOrbitalSetSize();
939 const size_t nel = P.
last(0) - P.
first(0);
941 const RealType* restrict C_p = Coeff.data();
942 for (
int i = 0; i < Coeff.size(); i++)
944 const size_t upC = C2node_up[i];
945 const size_t dnC = C2node_dn[i];
946 const ValueType tmp1 = C_p[i] * detValues_dn[dnC];
947 const ValueType tmp2 = C_p[i] * detValues_up[upC];
948 for (
size_t k = 0, j = N1; k < NP1; k++, j++)
950 myG_temp[j] += tmp1 * grads_up(upC, k);
951 myL_temp[j] += tmp1 * lapls_up(upC, k);
953 for (
size_t k = 0, j = N2; k < NP2; k++, j++)
955 myG_temp[j] += tmp2 * grads_dn(dnC, k);
956 myL_temp[j] += tmp2 * lapls_dn(dnC, k);
973 table_method_eval(dlogpsi, dhpsioverpsi,
myL_J,
myG_J, nel, nmo, psiCurrent, Coeff, C2node_up, C2node_dn,
974 detValues_up, detValues_dn, grads_up, grads_dn, lapls_up, lapls_dn, M_up, M_dn, Minv_up, Minv_dn,
975 B_grad, B_lapl, detData_up, N1, N2, NP1, NP2, lookup_tbl);
985 const std::vector<ValueType>& Coeff,
986 const std::vector<size_t>& C2node_up,
987 const std::vector<size_t>& C2node_dn,
994 const std::vector<int>& detData_up,
995 const std::vector<std::vector<int>>& lookup_tbl)
998 bool recalculate(
false);
1009 const size_t nmo =
Phi_->getOrbitalSetSize();
1010 const size_t nel = P.
last(0) - P.
first(0);
1012 table_method_evalWF(dlogpsi, nel, nmo, psiCurrent, Coeff, C2node_up, C2node_dn, detValues_up, detValues_dn, M_up,
1013 M_dn, Minv_up, Minv_dn, detData_up, lookup_tbl);
1025 const std::vector<RealType>& Coeff,
1026 const std::vector<size_t>& C2node_up,
1027 const std::vector<size_t>& C2node_dn,
1040 const std::vector<int>& detData_up,
1045 const std::vector<std::vector<int>>& lookup_tbl)
1161 ValueMatrix Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y11, Y23, Y24, Y25, Y26;
1162 ValueMatrix pK1, K1T, TK1T, pK2, K2AiB, TK2AiB, K2XA, TK2XA, K2T, TK2T, MK2T, pK3, K3T, TK3T, pK5, K5T, TK5T;
1164 Table.resize(nel, nmo);
1166 Bbar.resize(nel, nmo);
1168 Y1.resize(nel, nel);
1169 Y2.resize(nel, nmo);
1170 Y3.resize(nel, nmo);
1171 Y4.resize(nel, nmo);
1173 pK1.resize(nmo, nel);
1174 K1T.resize(nmo, nmo);
1175 TK1T.resize(nel, nmo);
1177 pK2.resize(nmo, nel);
1178 K2AiB.resize(nmo, nmo);
1179 TK2AiB.resize(nel, nmo);
1180 K2XA.resize(nmo, nmo);
1181 TK2XA.resize(nel, nmo);
1182 K2T.resize(nmo, nmo);
1183 TK2T.resize(nel, nmo);
1184 MK2T.resize(nel, nmo);
1186 pK3.resize(nmo, nel);
1187 K3T.resize(nmo, nmo);
1188 TK3T.resize(nel, nmo);
1190 pK5.resize(nmo, nel);
1191 K5T.resize(nmo, nmo);
1192 TK5T.resize(nel, nmo);
1195 const int parameter_start_index(0);
1197 const size_t num_unique_up_dets(detValues_up.size());
1198 const size_t num_unique_dn_dets(detValues_dn.size());
1200 const RealType* restrict cptr = Coeff.data();
1201 const size_t nc = Coeff.size();
1202 const size_t* restrict upC(C2node_up.data());
1203 const size_t* restrict dnC(C2node_dn.data());
1208 const int offset1(N1);
1209 const int offset2(N2);
1210 const int NPother(NP2);
1215 for (
int i = 0; i < nel; i++)
1216 for (
int j = 0; j < nmo; j++)
1217 Bbar(i, j) = B_lapl(i, j) + 2 *
dot(
myG_J[i + offset1], B_grad(i, j)) +
myL_J[i + offset1] * M_up(i, j);
1220 const RealType* restrict
A(M_up.data());
1221 const RealType* restrict Ainv(Minv_up.data());
1226 BLAS::gemm(
'N',
'N', nmo, nel, nel,
RealType(1.0),
A, nmo, Ainv, nel,
RealType(0.0), T, nmo);
1228 BLAS::gemm(
'N',
'N', nel, nel, nel,
RealType(1.0),
B, nmo, Ainv, nel,
RealType(0.0), Y1.data(), nel);
1229 BLAS::gemm(
'N',
'N', nmo, nel, nel,
RealType(1.0), T, nmo, Y1.data(), nel,
RealType(0.0), Y2.data(), nmo);
1230 BLAS::gemm(
'N',
'N', nmo, nel, nel,
RealType(1.0),
B, nmo, Ainv, nel,
RealType(0.0), Y3.data(), nmo);
1238 std::vector<RealType> Oi(num_unique_dn_dets);
1240 for (
int index = 0; index < num_unique_dn_dets; index++)
1241 for (
int iat = 0; iat < NPother; iat++)
1242 Oi[index] += lapls_dn(index, iat) + 2 *
dot(grads_dn(index, iat),
myG_J[offset2 + iat]) +
1243 myL_J[offset2 + iat] * detValues_dn[index];
1248 RealType const0(0.0), const1(0.0), const2(0.0);
1249 for (
size_t i = 0; i < nc; ++i)
1252 const size_t up = upC[i];
1253 const size_t down = dnC[i];
1255 const0 += c * detValues_dn[down] * (detValues_up[up] / detValues_up[0]);
1256 const1 += c * Oi[down] * (detValues_up[up] / detValues_up[0]);
1259 std::fill(pK1.begin(), pK1.end(), 0.0);
1260 std::fill(pK2.begin(), pK2.end(), 0.0);
1261 std::fill(pK3.begin(), pK3.end(), 0.0);
1262 std::fill(pK5.begin(), pK5.end(), 0.0);
1268 const int* restrict data_it = detData_up.data();
1269 for (
int index = 0, datum = 0; index < num_unique_up_dets; index++)
1271 const int k = data_it[datum];
1281 const int prows = k;
1282 const int pcols = nel;
1284 const int qrows = nmo;
1285 const int qcols = k;
1298 std::fill(Y5.begin(), Y5.end(), 0.0);
1299 for (
int i = 0; i < k; i++)
1301 BLAS::copy(nel, T + data_it[datum + 1 + k + i], nmo, Y5.data() + i, k);
1304 std::fill(Y6.begin(), Y6.end(), 0.0);
1305 for (
int i = 0; i < k; i++)
1307 BLAS::copy(k, Y5.data() + (data_it[datum + 1 + i]) * k, 1, (Y6.data() + i * k), 1);
1315 std::complex<RealType> logdet = 0.0;
1324 std::fill(Y11.begin(), Y11.end(), 0.0);
1325 for (
int i = 0; i < k; i++)
1327 BLAS::copy(nel, Y4.data() + (data_it[datum + 1 + k + i]), nmo, Y11.data() + i, k);
1330 std::fill(Y23.begin(), Y23.end(), 0.0);
1331 for (
int i = 0; i < k; i++)
1333 BLAS::copy(k, Y11.data() + (data_it[datum + 1 + i]) * k, 1, (Y23.data() + i * k), 1);
1336 BLAS::gemm(
'N',
'N', k, k, k,
RealType(1.0), Y23.data(), k, Y6.data(), k,
RealType(0.0), Y24.data(), k);
1337 BLAS::gemm(
'N',
'N', k, k, k,
RealType(1.0), Y6.data(), k, Y24.data(), k,
RealType(0.0), Y25.data(), k);
1342 std::fill(Y26.begin(), Y26.end(), 0.0);
1343 for (
int i = 0; i < k; i++)
1345 BLAS::copy(k, Y25.data() + i, k, Y26.data() + (data_it[datum + 1 + i]), nel);
1351 std::fill(Y7.begin(), Y7.end(), 0.0);
1352 for (
int i = 0; i < k; i++)
1354 BLAS::copy(k, Y6.data() + i, k, Y7.data() + (data_it[datum + 1 + i]), nel);
1360 for (
int i = 0; i < k; i++)
1362 c_Tr_AlphaI_MI += Y24(i, i);
1365 for (
int p = 0; p < lookup_tbl[index].size(); p++)
1368 const int el_p(lookup_tbl[index][p]);
1370 const size_t up = upC[el_p];
1371 const size_t down = dnC[el_p];
1373 const RealType alpha_1(c * detValues_dn[down] * detValues_up[up] / detValues_up[0] * c_Tr_AlphaI_MI);
1374 const RealType alpha_2(c * detValues_dn[down] * detValues_up[up] / detValues_up[0]);
1375 const RealType alpha_3(c * Oi[down] * detValues_up[up] / detValues_up[0]);
1379 for (
int i = 0; i < k; i++)
1381 BLAS::axpy(nel, alpha_1, Y7.data() + i * nel, 1, pK1.data() + (data_it[datum + 1 + k + i]) * nel, 1);
1382 BLAS::axpy(nel, alpha_2, Y7.data() + i * nel, 1, pK2.data() + (data_it[datum + 1 + k + i]) * nel, 1);
1383 BLAS::axpy(nel, alpha_3, Y7.data() + i * nel, 1, pK3.data() + (data_it[datum + 1 + k + i]) * nel, 1);
1384 BLAS::axpy(nel, alpha_2, Y26.data() + i * nel, 1, pK5.data() + (data_it[datum + 1 + k + i]) * nel, 1);
1392 BLAS::gemm(
'N',
'N', nmo, nmo, nel, 1.0 / const0, T, nmo, pK1.data(), nel,
RealType(0.0), K1T.data(), nmo);
1393 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K1T.data(), nmo, T, nmo,
RealType(0.0), TK1T.data(), nmo);
1395 BLAS::gemm(
'N',
'N', nmo, nmo, nel, 1.0 / const0, Y3.data(), nmo, pK2.data(), nel,
RealType(0.0), K2AiB.data(), nmo);
1396 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K2AiB.data(), nmo, T, nmo,
RealType(0.0), TK2AiB.data(), nmo);
1397 BLAS::gemm(
'N',
'N', nmo, nmo, nel, 1.0 / const0, Y2.data(), nmo, pK2.data(), nel,
RealType(0.0), K2XA.data(), nmo);
1398 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K2XA.data(), nmo, T, nmo,
RealType(0.0), TK2XA.data(), nmo);
1400 BLAS::gemm(
'N',
'N', nmo, nmo, nel, const1 / (const0 * const0), T, nmo, pK2.data(), nel,
RealType(0.0), K2T.data(),
1402 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K2T.data(), nmo, T, nmo,
RealType(0.0), TK2T.data(), nmo);
1403 BLAS::gemm(
'N',
'N', nmo, nel, nmo, const0 / const1, K2T.data(), nmo, Y4.data(), nmo,
RealType(0.0), MK2T.data(),
1406 BLAS::gemm(
'N',
'N', nmo, nmo, nel, 1.0 / const0, T, nmo, pK3.data(), nel,
RealType(0.0), K3T.data(), nmo);
1407 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K3T.data(), nmo, T, nmo,
RealType(0.0), TK3T.data(), nmo);
1409 BLAS::gemm(
'N',
'N', nmo, nmo, nel, 1.0 / const0, T, nmo, pK5.data(), nel,
RealType(0.0), K5T.data(), nmo);
1410 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K5T.data(), nmo, T, nmo,
RealType(0.0), TK5T.data(), nmo);
1413 for (
int mu = 0, k = parameter_start_index; k < (parameter_start_index + parameters_size); k++, mu++)
1419 if (i <= nel - 1 && j > nel - 1)
1424 (-K5T(i, j) + K5T(j, i) + TK5T(i, j) + K2AiB(i, j) - K2AiB(j, i) - TK2AiB(i, j) - K2XA(i, j) +
1425 K2XA(j, i) + TK2XA(i, j) - MK2T(i, j) + K1T(i, j) - K1T(j, i) - TK1T(i, j) -
1426 const2 / const1 * K2T(i, j) + const2 / const1 * K2T(j, i) + const2 / const1 * TK2T(i, j) +
1427 K3T(i, j) - K3T(j, i) - TK3T(i, j) - K2T(i, j) + K2T(j, i) + TK2T(i, j)));
1429 else if (i <= nel - 1 && j <= nel - 1)
1432 -0.5 * (Y4(i, j) - Y4(j, i)) -
1434 (-K5T(i, j) + K5T(j, i) + TK5T(i, j) - TK5T(j, i) + K2AiB(i, j) - K2AiB(j, i) - TK2AiB(i, j) +
1435 TK2AiB(j, i) - K2XA(i, j) + K2XA(j, i) + TK2XA(i, j) - TK2XA(j, i) - MK2T(i, j) + MK2T(j, i) +
1436 K1T(i, j) - K1T(j, i) - TK1T(i, j) + TK1T(j, i) - const2 / const1 * K2T(i, j) +
1437 const2 / const1 * K2T(j, i) + const2 / const1 * TK2T(i, j) - const2 / const1 * TK2T(j, i) + K3T(i, j) -
1438 K3T(j, i) - TK3T(i, j) + TK3T(j, i) - K2T(i, j) + K2T(j, i) + TK2T(i, j) - TK2T(j, i)));
1443 (-K5T(i, j) + K5T(j, i) + K2AiB(i, j) - K2AiB(j, i) - K2XA(i, j) + K2XA(j, i)
1445 + K1T(i, j) - K1T(j, i) - const2 / const1 * K2T(i, j) +
1446 const2 / const1 * K2T(j, i) + K3T(i, j) - K3T(j, i) - K2T(i, j) + K2T(j, i)));
1457 const std::vector<RealType>& Coeff,
1458 const std::vector<size_t>& C2node_up,
1459 const std::vector<size_t>& C2node_dn,
1466 const std::vector<int>& detData_up,
1467 const std::vector<std::vector<int>>& lookup_tbl)
1474 Table.resize(nel, nmo);
1476 Bbar.resize(nel, nmo);
1478 pK4.resize(nmo, nel);
1479 K4T.resize(nmo, nmo);
1480 TK4T.resize(nel, nmo);
1483 const int parameter_start_index(0);
1485 const size_t num_unique_up_dets(detValues_up.size());
1486 const size_t num_unique_dn_dets(detValues_dn.size());
1488 const RealType* restrict cptr = Coeff.data();
1489 const size_t nc = Coeff.size();
1490 const size_t* restrict upC(C2node_up.data());
1491 const size_t* restrict dnC(C2node_dn.data());
1495 const RealType* restrict
A(M_up.data());
1496 const RealType* restrict Ainv(Minv_up.data());
1501 BLAS::gemm(
'N',
'N', nmo, nel, nel,
RealType(1.0),
A, nmo, Ainv, nel,
RealType(0.0), T, nmo);
1504 RealType const0(0.0), const1(0.0), const2(0.0);
1505 for (
size_t i = 0; i < nc; ++i)
1508 const size_t up = upC[i];
1509 const size_t down = dnC[i];
1511 const0 += c * detValues_dn[down] * (detValues_up[up] / detValues_up[0]);
1514 std::fill(pK4.begin(), pK4.end(), 0.0);
1520 const int* restrict data_it = detData_up.data();
1521 for (
int index = 0, datum = 0; index < num_unique_up_dets; index++)
1523 const int k = data_it[datum];
1533 const int prows = k;
1534 const int pcols = nel;
1536 const int qrows = nmo;
1537 const int qcols = k;
1550 std::fill(Y5.begin(), Y5.end(), 0.0);
1551 for (
int i = 0; i < k; i++)
1553 BLAS::copy(nel, T + data_it[datum + 1 + k + i], nmo, Y5.data() + i, k);
1556 std::fill(Y6.begin(), Y6.end(), 0.0);
1557 for (
int i = 0; i < k; i++)
1559 BLAS::copy(k, Y5.data() + (data_it[datum + 1 + i]) * k, 1, (Y6.data() + i * k), 1);
1566 std::complex<RealType> logdet = 0.0;
1571 std::fill(Y7.begin(), Y7.end(), 0.0);
1572 for (
int i = 0; i < k; i++)
1574 BLAS::copy(k, Y6.data() + i, k, Y7.data() + (data_it[datum + 1 + i]), nel);
1577 for (
int p = 0; p < lookup_tbl[index].size(); p++)
1580 const int el_p(lookup_tbl[index][p]);
1582 const size_t up = upC[el_p];
1583 const size_t down = dnC[el_p];
1585 const RealType alpha_4(c * detValues_dn[down] * detValues_up[up] * (1 / psiCurrent));
1587 for (
int i = 0; i < k; i++)
1589 BLAS::axpy(nel, alpha_4, Y7.data() + i * nel, 1, pK4.data() + (data_it[datum + 1 + k + i]) * nel, 1);
1596 BLAS::gemm(
'N',
'N', nmo, nmo, nel,
RealType(1.0), T, nmo, pK4.data(), nel,
RealType(0.0), K4T.data(), nmo);
1597 BLAS::gemm(
'N',
'N', nmo, nel, nmo,
RealType(1.0), K4T.data(), nmo, T, nmo,
RealType(0.0), TK4T.data(), nmo);
1599 for (
int mu = 0, k = parameter_start_index; k < (parameter_start_index + parameters_size); k++, mu++)
1605 if (i <= nel - 1 && j > nel - 1)
1607 dlogpsi[kk] +=
ValueType(detValues_up[0] * (Table(i, j)) * const0 * (1 / psiCurrent) +
1608 (K4T(i, j) - K4T(j, i) - TK4T(i, j)));
1610 else if (i <= nel - 1 && j <= nel - 1)
1612 dlogpsi[kk] +=
ValueType(detValues_up[0] * (Table(i, j) - Table(j, i)) * const0 * (1 / psiCurrent) +
1613 (K4T(i, j) - TK4T(i, j) - K4T(j, i) + TK4T(j, i)));
1617 dlogpsi[kk] +=
ValueType((K4T(i, j) - K4T(j, i)));
1627 auto myclone = std::make_unique<RotatedSPOs>(
my_name_, std::unique_ptr<SPOSet>(
Phi_->makeClone()));
1629 myclone->params_ = this->
params_;
1633 myclone->myVars = this->
myVars;
1643 const std::vector<const ValueType*>& invRow_ptr_list,
1644 std::vector<std::vector<ValueType>>& ratios_list)
const 1647 auto& leader = phi_list.getLeader();
1648 leader.mw_evaluateDetRatios(phi_list, vp_list, psi_list, invRow_ptr_list, ratios_list);
1657 auto& leader = phi_list.getLeader();
1658 leader.mw_evaluateValue(phi_list, P_list, iat, psi_v_list);
1669 auto& leader = phi_list.getLeader();
1670 leader.mw_evaluateVGL(phi_list, P_list, iat, psi_v_list, dpsi_v_list, d2psi_v_list);
1682 auto& leader = phi_list.getLeader();
1683 leader.mw_evaluateVGLWithSpin(phi_list, P_list, iat, psi_v_list, dpsi_v_list, d2psi_v_list, mw_dspin);
1689 const std::vector<const ValueType*>& invRow_ptr_list,
1691 std::vector<ValueType>& ratios,
1692 std::vector<GradType>& grads)
const 1695 auto& leader = phi_list.getLeader();
1696 leader.mw_evaluateVGLandDetRatioGrads(phi_list, P_list, iat, invRow_ptr_list, phi_vgl_v, ratios, grads);
1702 const std::vector<const ValueType*>& invRow_ptr_list,
1704 std::vector<ValueType>& ratios,
1705 std::vector<GradType>& grads,
1706 std::vector<ValueType>& spingrads)
const 1709 auto& leader = phi_list.getLeader();
1710 leader.mw_evaluateVGLandDetRatioGradsWithSpin(phi_list, P_list, iat, invRow_ptr_list, phi_vgl_v, ratios, grads,
1723 auto& leader = phi_list.getLeader();
1724 leader.mw_evaluate_notranspose(phi_list, P_list, first, last, logdet_list, dlogdet_list, d2logdet_list);
1732 auto& leader = phi_list.getLeader();
1733 leader.acquireResource(collection, phi_list);
1739 auto& leader = phi_list.getLeader();
1740 leader.releaseResource(collection, phi_list);
1746 const auto nw = spo_list.size();
1748 phi_list.reserve(nw);
1749 for (
int iw = 0; iw < nw; iw++)
1752 phi_list.emplace_back(*rot.
Phi_);
void resetParametersExclusive(const opt_variables_type &active) override
reset
base class for Single-particle orbital sets
void resize(size_type n, Type_t val=Type_t())
Resize the container.
void writeVariationalParameters(hdf_archive &hout) override
Write the variational parameters for this object to the VP HDF file.
static void log_antisym_matrix(const ValueMatrix &mat, ValueMatrix &output)
static void constructAntiSymmetricMatrix(const RotationIndices &rot_indices, const std::vector< ValueType > ¶m, ValueMatrix &rot_mat)
RotationIndices m_act_rot_inds_
std::vector< ValueType > myVarsFull_
Full set of rotation matrix parameters for use in global rotation method.
bool recompute(int i) const
std::ostream & app_warning()
void write(T &data, const std::string &aname)
write the data to the group aname and check status runtime error is issued on I/O error ...
const ParticleSet & getRefPS() const
ParticleSet this object refers to.
helper functions for EinsplineSetBuilder
const std::string my_name_
name of the object, unique identifier
QTBase::RealType RealType
void evaluateDerivatives(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const int &FirstIndex, const int &LastIndex) override
Parameter derivatives of the wavefunction and the Laplacian of the wavefunction.
void copy_with_complex_cast(const std::complex< double > &source, std::complex< double > &dest)
size_t getTotalNum() const
size_t nel_major_
the number of electrons of the majority spin
void evaluateDerivativesWF(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, int FirstIndex, int LastIndex) override
Parameter derivatives of the wavefunction.
RotatedSPOs(const std::string &my_name, std::unique_ptr< SPOSet > &&spos)
std::vector< std::vector< ValueType > > history_params_
List of previously applied parameters.
ParticleSet::ParticleGradient myG_temp
A ParticleSet that handles virtual moves of a selected particle of a given physical ParticleSet Virtu...
opt_variables_type myVars
Optimizable variables.
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
size_t getTotalNum() const
int refPtcl
Reference particle.
QTBase::ComplexType ComplexType
int first(int igroup) const
return the first index of a group i
static void createRotationIndices(int nel, int nmo, RotationIndices &rot_indices)
Attaches a unit to a Vector for IO.
void mw_evaluateVGLWithSpin(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list, OffloadMatrix< ComplexType > &mw_dspin) const override
evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets ...
ParticleLaplacian L
laplacians of the particles
void mw_evaluateDetRatios(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, const RefVector< ValueVector > &psi_list, const std::vector< const ValueType *> &invRow_ptr_list, std::vector< std::vector< ValueType >> &ratios_list) const override
evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP, of multiple walkers ...
void setRotationParameters(const std::vector< RealType > ¶m_list)
For now, this takes the real optimizable parameters (real rotation coefficients) and converts them to...
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
void buildOptVariables(size_t nel)
Specialized paritlce class for atomistic simulations.
bool getShape(const std::string &aname, std::vector< int > &sizes_out)
read the shape of multidimensional filespace from the group aname this function can be used to query ...
float imag(const float &c)
imaginary part of a scalar. Cannot be replaced by std::imag due to AFQMC specific needs...
std::unique_ptr< SPOSet > makeClone() const override
make a clone of itself every derived class must implement this to have threading working correctly...
size_type size() const
return the current size
ParticleSet::ParticleLaplacian myL_temp
RotationIndices m_full_rot_inds_
static void extractParamsFromAntiSymmetricMatrix(const RotationIndices &rot_indices, const ValueMatrix &rot_mat, std::vector< ValueType > ¶m)
QTBase::ValueType ValueType
ParticleSet::ParticleLaplacian myL_J
void table_method_eval(Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const ParticleSet::ParticleLaplacian &myL_J, const ParticleSet::ParticleGradient &myG_J, const size_t nel, const size_t nmo, const ValueType &psiCurrent, const std::vector< RealType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const GradMatrix &grads_up, const GradMatrix &grads_dn, const ValueMatrix &lapls_up, const ValueMatrix &lapls_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const GradMatrix &B_grad, const ValueMatrix &B_lapl, const std::vector< int > &detData_up, const size_t N1, const size_t N2, const size_t NP1, const size_t NP2, const std::vector< std::vector< int >> &lookup_tbl)
void mw_evaluateVGL(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list) const override
evaluate the values, gradients and laplacians of this single-particle orbital sets of multiple walker...
void mw_evaluate_notranspose(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int first, int last, const RefVector< ValueMatrix > &logdet_list, const RefVector< GradMatrix > &dlogdet_list, const RefVector< ValueMatrix > &d2logdet_list) const override
void InvertWithLog(T *restrict x, int n, int m, T *restrict work, int *restrict pivot, std::complex< T1 > &logdet)
void applyDeltaRotation(const std::vector< ValueType > &delta_param, const std::vector< ValueType > &old_param, std::vector< ValueType > &new_param)
static void heev(char &jobz, char &uplo, int &n, std::complex< float > *a, int &lda, float *w, std::complex< float > *work, int &lwork, float *rwork, int &info)
ParticleGradient G
gradients of the particles
OrbitalSetTraits< ValueType >::ValueVector ValueVector
CASTTYPE & getCastedElement(size_t i) const
NewTimer & createGlobalTimer(const std::string &myname, timer_levels mylevel)
class to handle a set of variables that can be modified during optimizations
int where(int i) const
return the locator of the i-th Index
IndexType OrbitalSetSize
number of Single-particle orbitals
void mw_evaluateValue(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list) const override
evaluate the values this single-particle orbital sets of multiple walkers
std::vector< std::pair< int, int > > RotationIndices
int last(int igroup) const
return the last index of a group i
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
void evaluateDerivRatios(const VirtualParticleSet &VP, const opt_variables_type &optvars, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios, int FirstIndex, int LastIndex) override
Determinant ratios and parameter derivatives of the wavefunction for virtual moves.
static void createRotationIndicesFull(int nel, int nmo, RotationIndices &rot_indices)
void clear()
clear the variable set
size_type size() const
return the size
ParticleSet::ParticleGradient myG_J
float conj(const float &c)
Workaround to allow conj on scalar to return real instead of complex.
static RefVectorWithLeader< SPOSet > extractPhiRefList(const RefVectorWithLeader< SPOSet > &spo_list)
void push(const std::string &gname, bool createit=true)
push a group to the group stack
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)
static void exponentiate_antisym_matrix(ValueMatrix &mat)
Define determinant operators.
void table_method_evalWF(Vector< ValueType > &dlogpsi, const size_t nel, const size_t nmo, const ValueType &psiCurrent, const std::vector< RealType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const std::vector< int > &detData_up, const std::vector< std::vector< int >> &lookup_tbl)
std::vector< std::reference_wrapper< T > > RefVector
CASTTYPE & getCastedLeader() const
static void constructDeltaRotation(const std::vector< ValueType > &delta_param, const std::vector< ValueType > &old_param, const RotationIndices &act_rot_inds, const RotationIndices &full_rot_inds, std::vector< ValueType > &new_param, ValueMatrix &new_rot_mat)
void apply_rotation(const std::vector< ValueType > ¶m, bool use_stored_copy)
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
void mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads) const override
evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ra...
bool is_group(const std::string &aname)
check if aname is a group
std::unique_ptr< SPOSet > Phi_
static void copy(int n, const T *restrict a, T *restrict b)
static void axpy(int n, double x, const double *a, double *b)
bool use_global_rot_
Use global rotation or history list.
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
LatticeGaussianProduct::ValueType ValueType
void read(T &data, const std::string &aname)
read the data from the group aname and check status runtime error is issued on I/O error ...
void applyFullRotation(const std::vector< ValueType > &full_param, bool use_stored_copy)
std::vector< ValueType > params_
list of supplied orbital rotation parameters.
void applyRotationHistory()
const std::string & getName() const
return object name
T Invert(T *restrict x, int n, int m, T *restrict work, int *restrict pivot)
inverse a matrix
static void gemm(char Atrans, char Btrans, int M, int N, int K, double alpha, const double *A, int lda, const double *restrict B, int ldb, double beta, double *restrict C, int ldc)
double B(double x, int k, int i, const std::vector< double > &t)
bool params_supplied_
true if SPO parameters (orbital rotation parameters) have been supplied by input
A D-dimensional Array class based on PETE.
void readVariationalParameters(hdf_archive &hin) override
Read the variational parameters for this object from the VP HDF file.
NewTimer & apply_rotation_timer_
timer for apply_rotation
static void geev(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *alphar, double *alphai, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info)
void print(std::ostream &os, int leftPadSpaces=0, bool printHeader=false) const
void acquireResource(ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const override
acquire a shared resource from collection
void releaseResource(ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const override
return a shared resource to collection
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to collection
void mw_evaluateVGLandDetRatioGradsWithSpin(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads, std::vector< ValueType > &spingrads) const override
evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ra...