33 std::string spo_name(
""),
optimize(
"no");
34 std::string basisset_name(
"LCAOBSet");
37 spoAttrib.
add(spo_name,
"name");
39 spoAttrib.
add(basisset_name,
"basisset");
40 spoAttrib.
add(norbs,
"size");
50 app_log() <<
" SPOSet " << spo_name <<
" is optimizable\n";
52 std::unique_ptr<LCAOrbitalSet> upspo =
53 std::make_unique<LCAOrbitalSet>(spo_name +
"_up", std::unique_ptr<BasisSet_t>(myBasisSet->
makeClone()), norbs,
55 std::unique_ptr<LCAOrbitalSet> dnspo =
56 std::make_unique<LCAOrbitalSet>(spo_name +
"_dn", std::unique_ptr<BasisSet_t>(myBasisSet->
makeClone()), norbs,
58 loadMO(*upspo, *dnspo, cur);
61 auto spinor_set = std::make_unique<SpinorSet>(spo_name);
62 spinor_set->set_spos(std::move(upspo), std::move(dnspo));
69 std::string debugc(
"no");
71 aAttrib.
add(debugc,
"debug");
74 xmlNodePtr occ_ptr =
nullptr;
75 cur = cur->xmlChildrenNode;
76 while (cur !=
nullptr)
78 std::string cname((
const char*)(cur->name));
79 if (cname ==
"occupation")
100 bool success =
putFromH5(up, dn, occ_ptr);
105 app_log() <<
"UP: Single-particle orbital coefficients dims=" << up.
C->rows() <<
" x " << up.
C->cols()
108 app_log() <<
"DN: Single-particle orbital coefficients dims=" << dn.
C->rows() <<
" x " << dn.
C->cols()
133 std::string setname =
"/Super_Twist/eigenset_0";
138 assert(upReal.
rows() == upImag.
rows());
139 assert(upReal.
cols() == upImag.
cols());
142 for (
int i = 0; i < upTemp.rows(); i++)
144 for (
int j = 0; j < upTemp.cols(); j++)
146 upTemp[i][j] =
ValueType(upReal[i][j], upImag[i][j]);
152 setname =
"/Super_Twist/eigenset_1";
157 assert(dnReal.
rows() == dnImag.
rows());
158 assert(dnReal.
cols() == dnImag.
cols());
161 for (
int i = 0; i < dnTemp.rows(); i++)
163 for (
int j = 0; j < dnTemp.cols(); j++)
165 dnTemp[i][j] =
ValueType(dnReal[i][j], dnImag[i][j]);
169 assert(upReal.
rows() == dnReal.
rows());
170 assert(upReal.
cols() == dnReal.
cols());
193 myComm->comm.broadcast_n(up.
C->data(), up.
C->size());
194 myComm->comm.broadcast_n(dn.
C->data(), dn.
C->size());
void resize(size_type n, Type_t val=Type_t())
Resize the container.
bool open(const std::filesystem::path &fname, unsigned flags=H5F_ACC_RDWR)
open a file
helper functions for EinsplineSetBuilder
int rank() const
return the rank
int getBasisSetSize() const
return the size of the basis set
bool put(xmlNodePtr cur)
assign attributes to the set
void close()
close all the open groups and file
Vector< RealType > Occ
occupation number
LCAOSpinorBuilder(ParticleSet &els, ParticleSet &ions, Communicate *comm, xmlNodePtr cur)
constructor
SPOSetBuilder using new LCAOrbitalSet and Soa versions.
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
creates and returns SpinorSet
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Wrapping information on parallelism.
Specialized paritlce class for atomistic simulations.
std::map< std::string, std::unique_ptr< BasisSet_t > > basisset_map_
localized basis set map
QTBase::ValueType ValueType
Final class and should not be derived.
Communicate * myComm
pointer to Communicate
class to handle a set of attributes of an xmlNode
declaration of ProgressReportEngine
std::shared_ptr< OffloadValueMatrix > C
pointer to matrix containing the coefficients
int getOrbitalSetSize() const
return the size of the orbitals
std::string ClassName
class Name
bool putOccupation(LCAOrbitalSet &spo, xmlNodePtr occ_ptr)
std::string h5_path
Path to HDF5 Wavefunction.
bool loadMO(LCAOrbitalSet &up, LCAOrbitalSet &dn, xmlNodePtr cur)
load the up and down MO sets
void push(const std::string &gname, bool createit=true)
push a group to the group stack
void readRealMatrixFromH5(hdf_archive &hin, const std::string &setname, Matrix< LCAOrbitalBuilder::RealType > &Creal) const
read matrix from h5 file
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 ...
virtual SoaBasisSetBase< T > * makeClone() const =0
bool putFromH5(LCAOrbitalSet &up, LCAOrbitalSet &dn, xmlNodePtr)
parse h5 file for spinor info
class to handle linear combinations of basis orbitals used to evaluate the Dirac determinants.
void barrier_and_abort(const std::string &msg) const
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute