20 #ifndef QMCPLUSPLUS_BSPLINE_READER_H 21 #define QMCPLUSPLUS_BSPLINE_READER_H 24 #include <einspline/bspline_base.h> 30 struct SPOSetInputInfo;
62 std::ostringstream oo;
63 oo << bandgroup.
myName <<
".g" << MeshSize[0] <<
"x" << MeshSize[1] <<
"x" << MeshSize[2] <<
".h5";
69 template<
typename GT,
typename BCT>
75 for (
int j = 0; j < 3; ++j)
77 xyz_grid[j].start = 0.0;
78 xyz_grid[j].end = 1.0;
83 xyz_bc[j].lCode = ANTIPERIODIC;
84 xyz_bc[j].rCode = ANTIPERIODIC;
88 xyz_bc[j].lCode = PERIODIC;
89 xyz_bc[j].rCode = PERIODIC;
100 template<
typename SPE>
110 bspline.setOrbitalSetSize(numOrbs);
117 const std::vector<BandInfo>& cur_bands = bandgroup.
myBands;
118 for (
int iorb = 0; iorb <
N; iorb++)
120 int ti = cur_bands[iorb].TwistIndex;
122 bspline.MakeTwoCopies[iorb] = (num < (numOrbs - 1)) && cur_bands[iorb].MakeTwoCopies;
123 num +=
bspline.MakeTwoCopies[iorb] ? 2 : 1;
126 app_log() <<
"NumDistinctOrbitals " <<
N <<
" numOrbs = " << numOrbs << std::endl;
134 for (
int i = 0; i < 3; i++)
139 app_log() <<
" TwistIndex = " << cur_bands[0].TwistIndex <<
" TwistAngle " << twist0 << std::endl;
150 inline std::string
psi_g_path(
int ti,
int spin,
int ib)
const 152 std::ostringstream path;
153 path <<
"/electrons/kpoint_" << ti <<
"/spin_" << spin <<
"/state_" << ib <<
"/psi_g";
162 inline std::string
psi_r_path(
int ti,
int spin,
int ib)
const 164 std::ostringstream path;
165 path <<
"/electrons/kpoint_" << ti <<
"/spin_" << spin <<
"/state_" << ib <<
"/psi_r";
192 const std::vector<BandInfo>& bigspace,
194 std::vector<int>& band2spo);
double bspline(double x, const std::vector< double > &t, const std::vector< double > &c, int k)
helper functions for EinsplineSetBuilder
class to read state range information from sposet input
int getLastSPO() const
return the indext of the last SPO set
Communicate * myComm
communicator
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
ParticleSet & TargetPtcl
quantum particle set
std::string myName
name of this band
Define helper class to sort bands according to the band and twist and functions.
void check_twists(SPE &bspline, const BandInfoGroup &bandgroup) const
initialize twist-related data for N orbitals
Builder class for einspline-based SPOSet objects.
void setCheckNorm(bool new_checknorm)
Set the checkNorm variable.
int getNumSPOs() const
return the number of SPOs
int getNumDistinctOrbitals() const
return the size of this band
Wrapping information on parallelism.
SingleParticlePos k_cart(const SingleParticlePos &kin) const
conversion of a reciprocal-vector
Each SplineC2X needs a reader derived from BsplineReader.
TinyVector< int, 3 > MeshSize
std::vector< std::vector< int > > spo2band
map from spo index to band index
int TwistIndex
twist index set by the full band not by the subset
int getFirstSPO() const
return the indext of the first SPO set
collection of orbital info for SPOSet instance or builder
void setCommon(xmlNodePtr cur)
setting common parameters
AntiSymTensor< T, D > transpose(const AntiSymTensor< T, D > &rhs)
std::string getSplineDumpFileName(const BandInfoGroup &bandgroup) const
std::string psi_g_path(int ti, int spin, int ib) const
return the path name in hdf5
bool ReadGvectors_ESHDF()
read gvectors for each twist
BsplineReader(EinsplineSetBuilder *e)
bool set_grid(const TinyVector< int, 3 > &halfg, GT *xyz_grid, BCT *xyz_bc) const
read gvectors and set the mesh, and prepare for einspline
virtual std::unique_ptr< SPOSet > create_spline_set(const std::string &my_name, int spin, const BandInfoGroup &bandgroup)=0
create the actual spline sets
const auto & getLattice() const
void initialize_spo2band(int spin, const std::vector< BandInfo > &bigspace, SPOSetInfo &sposet, std::vector< int > &band2spo)
build index tables to map a state to band with k-point folidng
std::vector< TinyVector< double, OHMMS_DIM > > primcell_kpoints
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
EinsplineSetBuilder * mybuilder
pointer to the EinsplineSetBuilder
bool rotate
apply orbital rotations
std::string psi_r_path(int ti, int spin, int ib) const
return the path name in hdf5
void setRotate(bool new_rotate)
Set the orbital rotation flag.
bool checkNorm
mesh size check the norm of orbitals
std::vector< BandInfo > myBands
Bands that belong to this group.
bool saveSplineCoefs
save spline coefficients to storage