29 TEST_CASE(
"PlaneWave SPO from HDF for BCC H",
"[wavefunction]")
35 lattice.R = {3.77945227, 0.0, 0.0, 0.0, 3.77945227, 0.0, 0.0, 0.0, 3.77945227};
48 ions.R[0] = {0.0, 0.0, 0.0};
49 ions.R[1] = {1.88972614, 1.88972614, 1.88972614};
50 std::vector<int> agroup(2);
57 elec.
R[0] = {0.0, 0.0, 0.0};
58 elec.
R[1] = {0.0, 1.0, 0.0};
63 tspecies(chargeIdx, upIdx) = -1;
64 tspecies(chargeIdx, downIdx) = -1;
71 const char* particles = R
"( 72 <sposet_collection type="PW" href="bccH.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion"> 73 <sposet name="updet" size="1" spindataset="0"> 74 <occupation mode="ground"/> 84 xmlNodePtr pw1 = xmlFirstElementChild(root);
91 const int orbSize = spo->getOrbitalSetSize();
94 spo->evaluateValue(elec, 0, orbs);
100 int basisSize= spo->getBasisSetSize();
101 printf(
"orb size = %d basis set size = %d\n",orbSize, basisSize);
104 double step = 3.78/10;
105 FILE *fspo = fopen(
"spo.dat",
"w");
106 for (
int ix = 0; ix < 10; ix++) {
107 for (
int iy = 0; iy < 10; iy++) {
108 for (
int iz = 0; iz < 10; iz++) {
112 elec.
R[0] = {x, y, z};
115 spo->evaluateValue(elec, 0, orbs);
116 fprintf(fspo,
"%g %g %g",x,y,z);
117 for (
int j = 0; j < orbSize; j++) {
119 fprintf(fspo,
" %g,%g ",orbs[j].
real(),orbs[j].
imag());
121 fprintf(fspo,
" %g ",orbs[j]);
133 TEST_CASE(
"PlaneWave SPO from HDF for LiH arb",
"[wavefunction]")
139 lattice.R = {-3.55, 0.0, 3.55, 0.0, 3.55, 3.55, -3.55, 3.55, 0.0};
152 ions.R[0] = {0.0, 0.0, 0.0};
153 ions.R[1] = {3.55, 3.55, 3.55};
154 std::vector<int> agroup(2);
161 elec.
R[0] = {0.0, 0.0, 0.0};
162 elec.
R[1] = {0.0, 1.0, 0.0};
163 elec.
R[2] = {0.0, 0.0, 1.0};
164 elec.
R[3] = {0.0, 1.0, 1.0};
169 tspecies(chargeIdx, upIdx) = -1;
170 tspecies(chargeIdx, downIdx) = -1;
177 const char* particles = R
"( 178 <sposet_collection type="PW" href="LiH-arb.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion"> 179 <sposet name="updet" size="2" spindataset="0"> 180 <occupation mode="ground"/> 190 xmlNodePtr pw1 = xmlFirstElementChild(root);
197 const int orbSize = spo->getOrbitalSetSize();
200 spo->evaluateValue(elec, 0, orbs);
206 int basisSize= spo->getBasisSetSize();
207 printf(
"orb size = %d basis set size = %d\n",orbSize, basisSize);
210 double step = 3.55/10;
211 FILE *fspo = fopen(
"spo.dat",
"w");
212 for (
int ix = 0; ix < 10; ix++) {
213 for (
int iy = 0; iy < 10; iy++) {
214 for (
int iz = 0; iz < 10; iz++) {
218 elec.
R[0] = {x, y, z};
221 spo->evaluateValue(elec, 0, orbs);
222 fprintf(fspo,
"%g %g %g",x,y,z);
223 for (
int j = 0; j < orbSize; j++) {
225 fprintf(fspo,
" %g,%g ",orbs[j].
real(),orbs[j].
imag());
227 fprintf(fspo,
" %g ",orbs[j]);
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
std::unique_ptr< SPOSet > createSPOSet(xmlNodePtr cur)
create an sposet from xml and save the resulting SPOSet
TEST_CASE("complex_helper", "[type_traits]")
void addParticleSet(std::unique_ptr< ParticleSet > &&p)
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleS...
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
void update(bool skipSK=false)
update the internal data
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 ...
Wrapping information on parallelism.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
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...
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
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Declaration of a builder class for PWOrbitalSet.
Custom container for set of attributes for a set of species.
OrbitalBuilder for Slater determinants in PW basis.
const auto & getSimulationCell() const
get simulation cell
Declaration of ParticleSetPool.