33 TEST_CASE(
"Einspline SPO from HDF NiO a16 97 electrons",
"[wavefunction]")
38 lattice.R = {3.94055, 3.94055, 7.8811, 3.94055, 3.94055, -7.8811, -7.8811, 7.8811, 0};
50 ions_.R[0] = {0.75, 0.25, 0};
51 ions_.R[1] = {0.75, 0.25, 0.5};
52 ions_.R[2] = {0.75, 0.75, 0.25};
53 ions_.R[3] = {0.75, 0.75, 0.75};
54 ions_.R[4] = {0.25, 0.75, 0};
55 ions_.R[5] = {0.25, 0.25, 0.25};
56 ions_.R[6] = {0.25, 0.75, 0.5};
57 ions_.R[7] = {0.25, 0.25, 0.75};
58 ions_.R[8] = {0, 0, 0};
59 ions_.R[9] = {0, 0, 0.5};
60 ions_.R[10] = {0, 0.5, 0.25};
61 ions_.R[11] = {0, 0.5, 0.75};
62 ions_.R[12] = {0.5, 0.5, 0};
63 ions_.R[13] = {0.5, 0, 0.25};
64 ions_.R[14] = {0.5, 0.5, 0.5};
65 ions_.R[15] = {0.5, 0, 0.75};
69 ions_.convert2Cart(ions_.R);
74 int Niidx =
ispecies.addSpecies(
"Ni");
80 elec_.
R[0] = {0.0, 0.0, 0.0};
81 elec_.
R[1] = {0.0, 1.0, 0.0};
82 elec_.
R[2] = {0.0, 1.1, 0.0};
83 elec_.
R[3] = {0.0, 1.2, 0.0};
84 elec_.
R[4] = {0.0, 1.3, 0.0};
89 tspecies(chargeIdx, upIdx) = -1;
92 const char* particles = R
"(<tmp> 93 <determinantset type="einspline" href="NiO-fcc-supertwist111-supershift000-S4.h5" tilematrix="1 0 0 0 1 1 0 2 -2" twistnum="0" source="ion" meshfactor="1.0" precision="float" size="97" gpu="omptarget"/> 103 xmlNodePtr ein1 = xmlFirstElementChild(root);
113 spo->evaluate_notranspose(elec_, 0, elec_.
R.
size(), psiM, dpsiM, d2psiM);
115 #if !defined(QMC_COMPLEX) 130 CHECK(
std::real(d2psiM[1][0]) == Approx(-2.6130394936).epsilon(0.0001));
131 CHECK(
std::real(d2psiM[1][1]) == Approx(-2.6067698002).epsilon(0.0001));
134 #if defined(QMC_COMPLEX) 147 CHECK(
std::imag(d2psiM[1][0]) == Approx(2.6158618927).epsilon(0.0001));
148 CHECK(
std::imag(d2psiM[1][1]) == Approx(-2.6130394936).epsilon(0.0001));
155 elec_2.
R[0] = elec_.
R[1];
156 elec_2.
R[1] = elec_.
R[0];
158 p_list.push_back(elec_);
159 p_list.push_back(elec_2);
161 std::unique_ptr<SPOSet> spo_2(spo->makeClone());
163 spo_list.push_back(*spo);
164 spo_list.push_back(*spo_2);
170 spo->createResource(spo_res);
186 psi_v_list.push_back(psi);
187 psi_v_list.push_back(psi_2);
188 dpsi_v_list.push_back(dpsi);
189 dpsi_v_list.push_back(dpsi_2);
190 d2psi_v_list.push_back(d2psi);
191 d2psi_v_list.push_back(d2psi_2);
193 spo->mw_evaluateVGL(spo_list, p_list, 0, psi_v_list, dpsi_v_list, d2psi_v_list);
194 #if !defined(QMC_COMPLEX) 199 CHECK(
std::real(psi_v_list[1].
get()[0]) == Approx(-2.6693785191));
202 CHECK(
std::real(dpsi_v_list[1].
get()[0][0]) == Approx(-0.0002679008));
203 CHECK(
std::real(dpsi_v_list[1].
get()[0][1]) == Approx(7.622625351));
204 CHECK(
std::real(dpsi_v_list[1].
get()[0][2]) == Approx(-0.0003001692));
205 CHECK(
std::real(dpsi_v_list[1].
get()[1][0]) == Approx(-0.0002825252));
206 CHECK(
std::real(dpsi_v_list[1].
get()[1][1]) == Approx(7.6229834557));
207 CHECK(
std::real(dpsi_v_list[1].
get()[1][2]) == Approx(-0.0002339484));
209 CHECK(
std::real(d2psi_v_list[1].
get()[0]) == Approx(-2.6130394936).epsilon(0.0001));
210 CHECK(
std::real(d2psi_v_list[1].
get()[1]) == Approx(-2.6067698002).epsilon(0.0001));
213 #if defined(QMC_COMPLEX) 217 CHECK(
std::imag(psi_v_list[1].
get()[1]) == Approx(-2.6693785191));
219 CHECK(
std::imag(dpsi_v_list[1].
get()[0][0]) == Approx(-0.000179037));
220 CHECK(
std::imag(dpsi_v_list[1].
get()[0][1]) == Approx(-7.6221408844));
221 CHECK(
std::imag(dpsi_v_list[1].
get()[0][2]) == Approx(-0.0000232533));
222 CHECK(
std::imag(dpsi_v_list[1].
get()[1][0]) == Approx(-0.0002679008));
223 CHECK(
std::imag(dpsi_v_list[1].
get()[1][1]) == Approx(7.622625351));
224 CHECK(
std::imag(dpsi_v_list[1].
get()[1][2]) == Approx(-0.0003001692));
226 CHECK(
std::imag(d2psi_v_list[1].
get()[0]) == Approx(2.6158618927).epsilon(0.0001));
227 CHECK(
std::imag(d2psi_v_list[1].
get()[1]) == Approx(-2.6130394936).epsilon(0.0001));
231 std::vector<SPOSet::ValueType> ratio_v(nw);
232 std::vector<SPOSet::GradType> grads_v(nw);
242 std::vector<const SPOSet::ValueType*> inv_row_ptr(nw, inv_row.
device_data());
246 spo->mw_evaluateVGLandDetRatioGrads(spo_list, p_list, 0, inv_row_ptr, phi_vgl_v, ratio_v, grads_v);
247 phi_vgl_v.updateFrom();
248 #if !defined(QMC_COMPLEX) a class that defines a supercell in D-dimensional Euclean space.
void setName(const std::string &aname)
void setSimulationCell(const SimulationCell &simulation_cell)
set simulation cell
class that handles xmlDoc
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
TEST_CASE("complex_helper", "[type_traits]")
pointer device_data()
Return the device_ptr matching X if this is a vector attached or owning dual space memory...
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.
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
Derives EinsplineSetBuilder.
Communicate * Controller
Global Communicator for a process.
void resize(const std::array< SIZET, D > &dims)
Resize the container.
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 >::GradMatrix GradMatrix
Wrapping information on parallelism.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
Specialized paritlce class for atomistic simulations.
float imag(const float &c)
imaginary part of a scalar. Cannot be replaced by std::imag due to AFQMC specific needs...
size_type size() const
return the current size
REQUIRE(std::filesystem::exists(filename))
Manage a collection of ParticleSet objects.
OrbitalSetTraits< ValueType >::ValueVector ValueVector
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
std::vector< std::reference_wrapper< T > > RefVector
OrbitalSetTraits< ValueType >::GradVector GradVector
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
handles acquire/release resource by the consumer (RefVectorWithLeader type).
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
const PoolType & getPool() const
get the Pool object
void updateTo(size_type size=0, std::ptrdiff_t offset=0)
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
initialize the Antisymmetric wave function for electrons
A D-dimensional Array class based on PETE.
const auto & getSimulationCell() const
get simulation cell
Declaration of ParticleSetPool.