40 TEST_CASE(
"RotatedSPOs via SplineR2R",
"[wavefunction]")
54 lattice.R = {3.37316115, 3.37316115, 0.0, 0.0, 3.37316115, 3.37316115, 3.37316115, 0.0, 3.37316115};
68 ions_.R[0] = {0.0, 0.0, 0.0};
69 ions_.R[1] = {1.68658058, 1.68658058, 1.68658058};
73 elec_.
R[0] = {0.0, 0.0, 0.0};
74 elec_.
R[1] = {0.0, 1.0, 0.0};
78 tspecies(chargeIdx, upIdx) = -1;
81 const char* particles = R
"(<tmp> 82 <determinantset type="einspline" href="diamondC_1x1x1.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion" meshfactor="1.0" precision="float" size="8"/> 92 xmlNodePtr ein1 = xmlFirstElementChild(root);
104 #if !defined(QMC_COMPLEX) 106 spo->storeParamsBeforeRotation();
108 auto rot_spo = std::make_unique<RotatedSPOs>(
"one_rotated_set", std::move(spo));
111 const auto orbitalsetsize = rot_spo->getOrbitalSetSize();
115 rot_spo->buildOptVariables(elec_.
R.
size());
119 rot_spo->evaluate_notranspose(elec_, 0, elec_.
R.
size(), psiM_bare, dpsiM_bare, d2psiM_bare);
144 const auto rot_size = rot_spo->m_act_rot_inds_.size();
146 std::vector<RealType> param(rot_size);
147 for (
auto i = 0; i < rot_size; i++)
149 param[i] = 0.01 *
static_cast<RealType>(i);
151 rot_spo->apply_rotation(param,
false);
157 rot_spo->evaluate_notranspose(elec_, 0, elec_.
R.
size(), psiM_rot, dpsiM_rot, d2psiM_rot);
170 rot_mat[0][0] = 0.99726;
171 rot_mat[0][1] = -0.00722;
172 rot_mat[0][2] = 0.00014;
173 rot_mat[0][3] = -0.00982;
174 rot_mat[0][4] = -0.01979;
175 rot_mat[0][5] = -0.02976;
176 rot_mat[0][6] = -0.03972;
177 rot_mat[0][7] = -0.04969;
178 rot_mat[1][0] = -0.00722;
179 rot_mat[1][1] = 0.97754;
180 rot_mat[1][2] = -0.05955;
181 rot_mat[1][3] = -0.06945;
182 rot_mat[1][4] = -0.07935;
183 rot_mat[1][5] = -0.08925;
184 rot_mat[1][6] = -0.09915;
185 rot_mat[1][7] = -0.10905;
186 rot_mat[2][0] = -0.00014;
187 rot_mat[2][1] = 0.05955;
188 rot_mat[2][2] = 0.99821;
189 rot_mat[2][3] = -0.00209;
190 rot_mat[2][4] = -0.00239;
191 rot_mat[2][5] = -0.00269;
192 rot_mat[2][6] = -0.00299;
193 rot_mat[2][7] = -0.00329;
194 rot_mat[3][0] = 0.00982;
195 rot_mat[3][1] = 0.06945;
196 rot_mat[3][2] = -0.00209;
197 rot_mat[3][3] = 0.99751;
198 rot_mat[3][4] = -0.00289;
199 rot_mat[3][5] = -0.00329;
200 rot_mat[3][6] = -0.00368;
201 rot_mat[3][7] = -0.00408;
202 rot_mat[4][0] = 0.01979;
203 rot_mat[4][1] = 0.07935;
204 rot_mat[4][2] = -0.00239;
205 rot_mat[4][3] = -0.00289;
206 rot_mat[4][4] = 0.99661;
207 rot_mat[4][5] = -0.00388;
208 rot_mat[4][6] = -0.00438;
209 rot_mat[4][7] = -0.00488;
210 rot_mat[5][0] = 0.02976;
211 rot_mat[5][1] = 0.08925;
212 rot_mat[5][2] = -0.00269;
213 rot_mat[5][3] = -0.00329;
214 rot_mat[5][4] = -0.00388;
215 rot_mat[5][5] = 0.99552;
216 rot_mat[5][6] = -0.00508;
217 rot_mat[5][7] = -0.00568;
218 rot_mat[6][0] = 0.03972;
219 rot_mat[6][1] = 0.09915;
220 rot_mat[6][2] = -0.00299;
221 rot_mat[6][3] = -0.00368;
222 rot_mat[6][4] = -0.00438;
223 rot_mat[6][5] = -0.00508;
224 rot_mat[6][6] = 0.99422;
225 rot_mat[6][7] = -0.00647;
226 rot_mat[7][0] = 0.04969;
227 rot_mat[7][1] = 0.10905;
228 rot_mat[7][2] = -0.00329;
229 rot_mat[7][3] = -0.00408;
230 rot_mat[7][4] = -0.00488;
231 rot_mat[7][5] = -0.00568;
232 rot_mat[7][6] = -0.00647;
233 rot_mat[7][7] = 0.99273;
238 for (
auto i = 0; i < rot_mat.size1(); i++)
240 val1 += psiM_bare[0][i] * rot_mat[i][0];
241 val2 += psiM_bare[1][i] * rot_mat[i][0];
248 std::vector<double> grad1(3);
249 std::vector<double> grad2(3);
250 for (
auto j = 0; j < grad1.size(); j++)
252 for (
auto i = 0; i < rot_mat.size1(); i++)
254 grad1[j] += dpsiM_bare[0][i][j] * rot_mat[i][0];
255 grad2[j] += dpsiM_bare[1][i][j] * rot_mat[i][0];
260 CHECK(dpsiM_rot[0][0][0] == Approx(grad1[0]).epsilon(0.0001));
261 CHECK(dpsiM_rot[0][0][1] == Approx(grad1[1]).epsilon(0.0001));
262 CHECK(dpsiM_rot[0][0][2] == Approx(grad1[2]).epsilon(0.0001));
263 CHECK(dpsiM_rot[1][0][0] == Approx(grad2[0]).epsilon(0.0001));
264 CHECK(dpsiM_rot[1][0][1] == Approx(grad2[1]).epsilon(0.0001));
265 CHECK(dpsiM_rot[1][0][2] == Approx(grad2[2]).epsilon(0.0001));
269 for (
auto i = 0; i < rot_mat.size1(); i++)
271 lap1 += d2psiM_bare[0][i] * rot_mat[i][0];
272 lap2 += d2psiM_bare[1][i] * rot_mat[i][0];
276 CHECK(
std::real(d2psiM_rot[0][0]) == Approx(lap1).epsilon(0.0001));
277 CHECK(
std::real(d2psiM_rot[1][0]) == Approx(lap2).epsilon(0.0001));
282 TEST_CASE(
"RotatedSPOs createRotationIndices",
"[wavefunction]")
290 CHECK(rot_ind.size() == 2);
296 CHECK(full_rot_ind.size() == 3);
301 CHECK(rot_ind2.size() == 2);
305 CHECK(full_rot_ind2.size() == 3);
310 CHECK(rot_ind3.size() == 4);
314 CHECK(full_rot_ind3.size() == 6);
317 TEST_CASE(
"RotatedSPOs constructAntiSymmetricMatrix",
"[wavefunction]")
327 ValueMatrix m3(nmo, nmo);
329 std::vector<ValueType> params = {0.1, 0.2};
334 std::vector<ValueType> expected_data = { 0.0, -0.1, -0.2,
339 ValueMatrix expected_m3(expected_data.data(), 3, 3);
344 std::vector<ValueType> params_out(2);
352 TEST_CASE(
"RotatedSPOs exponentiate matrix",
"[wavefunction]")
358 std::vector<SPOSet::ValueType> mat1_data = {0.0};
362 CHECK(m1(0, 0) == ValueApprox(1.0));
365 std::vector<SPOSet::ValueType> mat2_data = { 0.0, -0.1,
373 std::vector<ValueType> expected_rot2 = { 0.995004165278026, -0.0998334166468282,
374 0.0998334166468282, 0.995004165278026 };
377 ValueMatrix expected_m2(expected_rot2.data(), 2, 2);
379 CHECKED_ELSE(check_matrix_result2.result) { FAIL(check_matrix_result2.result_message); }
383 std::vector<ValueType> m3_input_data = { 0.0, -0.3, -0.1,
388 std::vector<ValueType> expected_rot3 = { 0.950580617906092, -0.302932713402637, -0.0680313164049401,
389 0.283164960565074, 0.935754803277919, -0.210191705950743,
390 0.127334574917630, 0.180540076694398, 0.975290308953046 };
394 ValueMatrix m3(m3_input_data.data(), 3, 3);
395 ValueMatrix expected_m3(expected_rot3.data(), 3, 3);
403 using cmplx_t = std::complex<RealType>;
404 std::vector<cmplx_t> m3_input_data_cplx = {cmplx_t(0, 0), cmplx_t(0.3, 0.1), cmplx_t(0.1, -0.3),
405 cmplx_t(-0.3, 0.1), cmplx_t(0, 0), cmplx_t(0.2, 0.01),
406 cmplx_t(-0.1, -0.3), cmplx_t(-0.2, 0.01), cmplx_t(0, 0)};
408 std::vector<cmplx_t> expected_rot_cmplx = {cmplx_t(0.90198269, -0.00652118), cmplx_t(0.27999104, 0.12545423),
409 cmplx_t(0.12447606, -0.27704993), cmplx_t(-0.29632557, 0.06664911),
410 cmplx_t(0.93133822, -0.00654092), cmplx_t(0.19214149, 0.05828413),
411 cmplx_t(-0.06763124, -0.29926537), cmplx_t(-0.19210869, -0.03907491),
412 cmplx_t(0.93133822, -0.00654092)};
430 std::vector<SPOSet::ValueType> mat1_data = {1.0};
435 CHECK(out_m1(0, 0) == ValueApprox(0.0));
438 std::vector<ValueType> start_rot2 = { 0.995004165278026, -0.0998334166468282,
439 0.0998334166468282, 0.995004165278026 };
441 std::vector<SPOSet::ValueType> mat2_data = { 0.0, -0.1,
445 ValueMatrix rot_m2(start_rot2.data(), 2, 2);
446 ValueMatrix out_m2(2, 2);
451 CHECKED_ELSE(check_matrix_result2.result) { FAIL(check_matrix_result2.result_message); }
454 std::vector<ValueType> start_rot3 = { 0.950580617906092, -0.302932713402637, -0.0680313164049401,
455 0.283164960565074, 0.935754803277919, -0.210191705950743,
456 0.127334574917630, 0.180540076694398, 0.975290308953046 };
458 std::vector<ValueType> m3_input_data = { 0.0, -0.3, -0.1,
462 ValueMatrix rot_m3(start_rot3.data(), 3, 3);
463 ValueMatrix out_m3(3, 3);
468 CHECKED_ELSE(check_matrix_result3.result) { FAIL(check_matrix_result3.result_message); }
471 using cmplx_t = std::complex<RealType>;
472 std::vector<cmplx_t> m3_input_data_cplx = {cmplx_t(0, 0), cmplx_t(0.3, 0.1), cmplx_t(0.1, -0.3),
473 cmplx_t(-0.3, 0.1), cmplx_t(0, 0), cmplx_t(0.2, 0.01),
474 cmplx_t(-0.1, -0.3), cmplx_t(-0.2, 0.01), cmplx_t(0, 0)};
476 std::vector<cmplx_t> start_rot_cmplx = {cmplx_t(0.90198269, -0.00652118), cmplx_t(0.27999104, 0.12545423),
477 cmplx_t(0.12447606, -0.27704993), cmplx_t(-0.29632557, 0.06664911),
478 cmplx_t(0.93133822, -0.00654092), cmplx_t(0.19214149, 0.05828413),
479 cmplx_t(-0.06763124, -0.29926537), cmplx_t(-0.19210869, -0.03907491),
480 cmplx_t(0.93133822, -0.00654092)};
497 TEST_CASE(
"RotatedSPOs exp-log matrix",
"[wavefunction]")
507 ValueMatrix rot_m4(nmo, nmo);
510 std::vector<ValueType> params4 = {-1.1, 1.5, 0.2, -0.15};
513 ValueMatrix orig_rot_m4 = rot_m4;
514 ValueMatrix out_m4(nmo, nmo);
523 std::vector<ValueType> params4out(4);
525 for (
int i = 0; i < params4.size(); i++)
531 ValueMatrix rot_m4_cmplx(nmo, nmo);
542 ValueMatrix orig_rot_m4_cmplx = rot_m4_cmplx;
543 ValueMatrix out_m4_cmplx(nmo, nmo);
550 std::vector<ValueType> params4out_cmplx(4);
552 for (
int i = 0; i < params4_cmplx.size(); i++)
554 CHECK(params4_cmplx[i] == ValueApprox(params4out_cmplx[i]));
569 lattice.R = {4.32747284, 0.00000000, 0.00000000, -2.16373642, 3.74770142,
570 0.00000000, 0.00000000, 0.00000000, 6.78114995};
582 ions.R[0] = {0.0, 0.0, 0.0};
587 elec.
R[0] = {0.0, 0.0, 0.0};
592 tspecies(chargeIdx, upIdx) = -1;
597 const char* particles = R
"(<tmp> 598 <sposet_builder type="bspline" href="hcpBe.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion" meshfactor="1.0" precision="double" gpu="no"> 599 <sposet type="bspline" name="spo_ud" spindataset="0" size="2"/> 609 xmlNodePtr sposet_builder = xmlFirstElementChild(root);
610 xmlNodePtr sposet_ptr = xmlFirstElementChild(sposet_builder);
616 spo->storeParamsBeforeRotation();
617 auto rot_spo = std::make_unique<RotatedSPOs>(
"one_rotated_set", std::move(spo));
620 const auto orbitalsetsize = rot_spo->getOrbitalSetSize();
623 rot_spo->buildOptVariables(elec.
R.
size());
628 rot_spo->evaluate_notranspose(elec, 0, elec.
R.
size(), psiM_bare, dpsiM_bare, d2psiM_bare);
637 rot_spo->checkInVariablesExclusive(opt_vars);
639 rot_spo->checkOutVariables(opt_vars);
640 rot_spo->resetParametersExclusive(opt_vars);
646 rot_spo->evaluateDerivatives(elec, opt_vars, dlogpsi, dhpsioverpsi, 0, 1);
656 std::vector<ValueType> params = {0.1};
657 rot_spo->apply_rotation(params,
false);
659 rot_spo->evaluate_notranspose(elec, 0, elec.
R.
size(), psiM_bare, dpsiM_bare, d2psiM_bare);
661 CHECK(
std::real(psiM_bare[0][1]) == Approx(-0.02099012652669549));
666 dhpsioverpsi[0] = 0.0;
668 rot_spo->evaluateDerivatives(elec, opt_vars, dlogpsi, dhpsioverpsi, 0, 1);
674 TEST_CASE(
"RotatedSPOs construct delta matrix",
"[wavefunction]")
687 ValueMatrix rot_m4(nmo, nmo);
695 std::vector<ValueType> old_params = {1.5, 0.2, -0.15, 0.03, -1.1, 0.05};
696 std::vector<ValueType> delta_params = {0.1, 0.3, 0.2, -0.1};
697 std::vector<ValueType> new_params(6);
702 std::vector<ValueType> rot_data4 =
703 { -0.371126931484737, 0.491586564957393, -0.784780958819798, 0.0687480658200083,
704 -0.373372784561548, 0.66111547793048, 0.610450337985578, 0.225542620014052,
705 0.751270334458895, 0.566737323353515, -0.0297901110611425, -0.336918744155143,
706 0.398058348785074, 0.00881931472604944, -0.102867783149713, 0.911531672428406 };
709 ValueMatrix new_rot_m4(rot_data4.data(), 4, 4);
712 CHECKED_ELSE(check_matrix_result4.result) { FAIL(check_matrix_result4.result_message); }
715 std::vector<ValueType> expected_new_param = {1.6813965019790489, 0.3623564254653294, -0.05486544454559908,
716 -0.20574472941408453, -0.9542513302873077, 0.27497788909911774};
717 for (
int i = 0; i < new_params.size(); i++)
718 CHECK(new_params[i] == ValueApprox(expected_new_param[i]));
723 std::vector<ValueType> new_params2(6);
724 std::vector<ValueType> reverse_delta_params = {-0.1, -0.3, -0.2, 0.1};
726 for (
int i = 0; i < new_params2.size(); i++)
727 CHECK(new_params2[i] == ValueApprox(old_params[i]));
738 TEST_CASE(
"RotatedSPOs read and write parameters",
"[wavefunction]")
742 auto fake_spo = std::make_unique<FakeSPO>();
743 fake_spo->setOrbitalSetSize(4);
748 std::vector<SPOSet::ValueType> vs_values{0.1, 0.15, 0.2, 0.25};
753 for (
size_t i = 0; i < vs.
size(); i++)
754 vs[i] = vs_values_data_real[i];
764 auto fake_spo2 = std::make_unique<FakeSPO>();
765 fake_spo2->setOrbitalSetSize(4);
767 RotatedSPOs rot2(
"fake_rot", std::move(fake_spo2));
778 for (
size_t i = 0; i < vs.
size(); i++)
779 CHECK(var[i] == Approx(vs[i]));
782 vs_values.push_back(0.0);
783 vs_values.push_back(0.0);
785 for (
size_t i = 0; i < full_var.size(); i++)
786 CHECK(full_var[i] == ValueApprox(vs_values[i]));
790 TEST_CASE(
"RotatedSPOs read and write parameters history",
"[wavefunction]")
793 auto fake_spo = std::make_unique<FakeSPO>();
794 fake_spo->setOrbitalSetSize(4);
800 std::vector<SPOSet::ValueType> vs_values{0.1, 0.15, 0.2, 0.25};
805 for (
size_t i = 0; i < vs.
size(); i++)
806 vs[i] = vs_values_data_real[i];
816 auto fake_spo2 = std::make_unique<FakeSPO>();
817 fake_spo2->setOrbitalSetSize(4);
819 RotatedSPOs rot2(
"fake_rot", std::move(fake_spo2));
830 for (
size_t i = 0; i < var.
size(); i++)
831 CHECK(var[i] == Approx(vs[i]));
845 assert(psi.size() == 3);
854 for (
auto& sg : dspin_psi)
870 for (
auto& sg : dspin_psi)
875 const RefVectorWithLeader<ParticleSet>& P_list,
877 const RefVector<ValueVector>& psi_v_list,
878 const RefVector<GradVector>& dpsi_v_list,
879 const RefVector<ValueVector>& d2psi_v_list,
880 OffloadMatrix<ComplexType>& mw_dspin)
const override 882 assert(
this == &spo_list.getLeader());
883 for (
int iw = 0; iw < spo_list.size(); iw++)
885 auto* sg_row = mw_dspin[iw];
887 spo_list[iw].evaluateVGL_spin(P_list[iw], iat, psi_v_list[iw], dpsi_v_list[iw], d2psi_v_list[iw], sg);
910 for (
auto& psi : psi_v_list)
912 assert(psi.get().size() == 3);
926 OffloadMatrix<ComplexType>& mw_dspin)
const override 928 for (
auto& dpsi : dpsi_v_list)
930 assert(dpsi.get().size() == 3);
931 dpsi.get()[0][0] = 0.321;
932 dpsi.get()[0][1] = 0.654;
933 dpsi.get()[0][2] = 0.987;
935 for (
auto&
m : mw_dspin)
949 RotatedSPOs rot_spo0(
"rotated0", std::make_unique<DummySPOSetWithoutMW>(
"no mw 0"));
950 RotatedSPOs rot_spo1(
"rotated1", std::make_unique<DummySPOSetWithoutMW>(
"no mw 1"));
967 for (
int iw = 0; iw < spo_list.size(); iw++)
969 CHECK(psi_v_list[iw].
get()[0] == ValueApprox(123.));
970 CHECK(psi_v_list[iw].
get()[1] == ValueApprox(456.));
971 CHECK(psi_v_list[iw].
get()[2] == ValueApprox(789.));
984 for (
auto&
m : dspin)
987 for (
int iw = 0; iw < spo_list.size(); iw++)
989 CHECK(dpsi_v_list[iw].
get()[0][0] == ValueApprox(0.123));
990 CHECK(dpsi_v_list[iw].
get()[0][1] == ValueApprox(0.456));
991 CHECK(dpsi_v_list[iw].
get()[0][2] == ValueApprox(0.789));
993 for (
auto&
m : mw_dspin)
1008 RotatedSPOs rot_spo0(
"rotated0", std::make_unique<DummySPOSetWithMW>(
"mw 0"));
1009 RotatedSPOs rot_spo1(
"rotated1", std::make_unique<DummySPOSetWithMW>(
"mw 1"));
1026 for (
int iw = 0; iw < spo_list.size(); iw++)
1028 CHECK(psi_v_list[iw].
get()[0] == ValueApprox(321.));
1029 CHECK(psi_v_list[iw].
get()[1] == ValueApprox(654.));
1030 CHECK(psi_v_list[iw].
get()[2] == ValueApprox(987.));
1041 for (
int iw = 0; iw < spo_list.size(); iw++)
1043 CHECK(dpsi_v_list[iw].
get()[0][0] == ValueApprox(0.321));
1044 CHECK(dpsi_v_list[iw].
get()[0][1] == ValueApprox(0.654));
1045 CHECK(dpsi_v_list[iw].
get()[0][2] == ValueApprox(0.987));
1047 for (
auto&
m : mw_dspin)
void resetParametersExclusive(const opt_variables_type &active) override
reset
base class for Single-particle orbital sets
void writeVariationalParameters(hdf_archive &hout) override
Write the variational parameters for this object to the VP HDF file.
a class that defines a supercell in D-dimensional Euclean space.
void set_use_global_rotation(bool use_global_rotation)
Use history list (false) or global rotation (true)
void setName(const std::string &aname)
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)
void setSimulationCell(const SimulationCell &simulation_cell)
set simulation cell
class that handles xmlDoc
std::vector< ValueType > myVarsFull_
Full set of rotation matrix parameters for use in global rotation method.
void writeToHDF(const std::string &filename, qmcplusplus::hdf_archive &hout) const
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
std::string getClassName() const override
return class name
const std::string my_name_
name of the object, unique identifier
QTBase::RealType RealType
void evaluate_spin(const ParticleSet &P, int iat, ValueVector &psi, ValueVector &dspin_psi) override
evaluate the values of this single-particle orbital set
void checkInVariablesExclusive(opt_variables_type &active) override
check in variational parameters to the global list of parameters used by the optimizer.
void setOrbitalSetSize(int norbs) override
set the OrbitalSetSize
std::vector< std::vector< ValueType > > history_params_
List of previously applied parameters.
TEST_CASE("complex_helper", "[type_traits]")
void readFromHDF(const std::string &filename, qmcplusplus::hdf_archive &hin)
Read variational parameters from an HDF file.
void addParticleSet(std::unique_ptr< ParticleSet > &&p)
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleS...
Builder class for einspline-based SPOSet objects.
opt_variables_type myVars
Optimizable variables.
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
CHECKED_ELSE(check_matrix_result.result)
QTBase::ComplexType ComplexType
static void createRotationIndices(int nel, int nmo, RotationIndices &rot_indices)
void resetIndex()
reset Index
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 ...
Communicate * Controller
Global Communicator for a process.
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
OrbitalSetTraits< ValueType >::ValueVector ValueVector
DummySPOSetWithMW(const std::string &my_name)
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Wrapping information on parallelism.
void buildOptVariables(size_t nel)
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
void evaluateValue(const ParticleSet &P, int iat, SPOSet::ValueVector &psi) override
evaluate the values of this single-particle orbital set
Specialized paritlce class for atomistic simulations.
size_type size() const
return the current size
static void extractParamsFromAntiSymmetricMatrix(const RotationIndices &rot_indices, const ValueMatrix &rot_mat, std::vector< ValueType > ¶m)
QTBase::ValueType ValueType
REQUIRE(std::filesystem::exists(filename))
std::string result_message
Manage a collection of ParticleSet objects.
std::vector< QMCTraits::ValueType > & getMyVarsFull(RotatedSPOs &rot)
OrbitalSetTraits< ValueType >::ValueVector ValueVector
virtual void evaluateVGL_spin(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, ValueVector &dspin)
evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set ...
class to handle a set of variables that can be modified during optimizations
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
void evaluateVGL(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi) override
evaluate the values, gradients and laplacians of this single-particle orbital set ...
static void createRotationIndicesFull(int nel, int nmo, RotationIndices &rot_indices)
opt_variables_type & getMyVars(SPOSet &spo)
size_type size() const
return the size
void evaluate_notranspose(const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet) override
evaluate the values, gradients and laplacians of this single-particle orbital for [first...
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
static void exponentiate_antisym_matrix(ValueMatrix &mat)
DummySPOSetWithoutMW(const std::string &my_name)
std::vector< std::reference_wrapper< T > > RefVector
std::vector< std::vector< QMCTraits::ValueType > > & getHistoryParams(RotatedSPOs &rot)
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)
OrbitalSetTraits< ValueType >::GradVector GradVector
virtual 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
evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets ...
bool parseFromString(const std::string_view data)
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
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
handles acquire/release resource by the consumer (RefVectorWithLeader type).
LatticeGaussianProduct::ValueType ValueType
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
const PoolType & getPool() const
get the Pool object
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
initialize the Antisymmetric wave function for electrons
void readVariationalParameters(hdf_archive &hin) override
Read the variational parameters for this object from the VP HDF file.
const auto & getSimulationCell() const
get simulation cell
Declaration of ParticleSetPool.
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to collection
virtual void evaluate_spin(const ParticleSet &P, int iat, ValueVector &psi, ValueVector &dpsi)
evaluate the values of this single-particle orbital set