16 #ifndef QMCPLUSPLUS_SPLINE_R2R_H 17 #define QMCPLUSPLUS_SPLINE_R2R_H 22 #include "spline2/MultiBspline.hpp" 37 using SplineType =
typename bspline_traits<ST, 3>::SplineType;
38 using BCType =
typename bspline_traits<ST, 3>::BCType;
82 virtual std::string
getClassName()
const override {
return "SplineR2R"; }
83 virtual std::string
getKeyword()
const override {
return "SplineR2R"; }
87 std::unique_ptr<SPOSet>
makeClone()
const override {
return std::make_unique<SplineR2R>(*this); }
110 const size_t npad = getAlignedSize<ST>(
n);
126 const int Nbands =
kPoints.size();
127 const int Nbandgroups =
comm->
size();
128 offset.resize(Nbandgroups + 1, 0);
133 template<
typename GT,
typename BCT>
137 SplineInst = std::make_shared<MultiBspline<ST>>();
140 app_log() <<
"MEMORY " <<
SplineInst->sizeInByte() / (1 << 20) <<
" MB allocated " 141 <<
"for the coefficients in 3D spline orbital representation" << std::endl;
157 for (
int i = 0; i <
D; i++)
158 if (-std::numeric_limits<ST>::epsilon() < ru[i] && ru[i] < 0)
164 bc_sign +=
HalfG[i] * (int)img;
176 std::vector<TT>& ratios)
override;
205 int last = -1)
const;
214 template<
class BSPLINESPO>
void resize(size_type n, Type_t val=Type_t())
Resize the container.
OrbitalSetTraits< ValueType >::HessVector HessVector
CrystalLattice< ST, 3 > PrimLattice
primitive cell
void resizeStorage(size_t n, size_t nvals)
void assign_vgl(int bc_sign, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, int first, int last) const
helper functions for EinsplineSetBuilder
int convertPos(const PointType &r, PointType &ru)
convert position in PrimLattice unit and return sign
BsplineSet is the base class for SplineC2C, SplineC2R, SplineR2R.
Matrix< TT > ratios_private
thread private ratios for reduction when using nested threading, numVP x numThread ...
Tensor< ST, 3 > GGt
, transformation for tensor in LatticeUnit to CartesianUnit, e.g. Hessian
A ParticleSet that handles virtual moves of a selected particle of a given physical ParticleSet Virtu...
Soa Container for D-dim vectors.
SplineR2R(const std::string &my_name)
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
void evaluateDetRatios(const VirtualParticleSet &VP, ValueVector &psi, const ValueVector &psiinv, std::vector< TT > &ratios) override
Vector< ST, aligned_allocator< ST > > vContainer_type
Tensor_t G
Reciprocal unit vectors. G(j,i) i=vector and j=x,y,z.
bool isComplex() const override
OrbitalSetTraits< ValueType >::ValueVector ValueVector
int size() const
return the number of tasks
std::unique_ptr< SPOSet > makeClone() const override
make a clone of itself every derived class must implement this to have threading working correctly...
void FairDivideLow(int ntot, int npart, IV &adist)
partition ntot elements among npart
void evaluateVGH(const ParticleSet &P, const int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi) override
evaluate the values, gradients and hessians of this single-particle orbital set
virtual std::string getKeyword() const override
Wrapping information on parallelism.
void assign_vgh(int bc_sign, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, int first, int last) const
std::shared_ptr< std::vector< ST > > coef_copy_
Copy of original splines for orbital rotation.
void evaluateVGHGH(const ParticleSet &P, const int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, GGGVector &grad_grad_grad_psi) override
evaluate the values, gradients, hessians, and grad hessians of this single-particle orbital set ...
Each SplineC2X needs a reader derived from BsplineReader.
Specialized paritlce class for atomistic simulations.
General SplineSetReader to handle any unitcell.
std::vector< int > offset
band offsets used for communication
A collection of functions for dividing fairly.
size_type size() const
return the current size
QTBase::ValueType ValueType
void applyRotation(const ValueMatrix &rot_mat, bool use_stored_copy) override
apply rotation to all the orbitals
bool read_splines(hdf_archive &h5f)
void gather_tables(Communicate *comm)
void set_spline(SingleSplineType *spline_r, SingleSplineType *spline_i, int twist, int ispline, int level)
void assign_vghgh(int bc_sign, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, GGGVector &grad_grad_grad_psi, int first=0, int last=-1) const
OrbitalSetTraits< ValueType >::ValueVector ValueVector
typename BsplineSet::ValueType TT
BsplineSet is a SPOSet derived class and serves as a base class for B-spline SPO C2C/C2R/R2R implemen...
void bcast_tables(Communicate *comm)
SingleParticlePos toUnit(const TinyVector< T1, D > &r) const
Convert a cartesian vector to a unit vector.
bool isRotationSupported() const override
return true if this SPOSet can be wrappered by RotatedSPO
void storeParamsBeforeRotation() override
Store an original copy of the spline coefficients for orbital rotation.
AntiSymTensor< T, D > transpose(const AntiSymTensor< T, D > &rhs)
vContainer_type myV
intermediate result vectors
bool write_splines(hdf_archive &h5f)
void evaluateVGL(const ParticleSet &P, const int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi) override
evaluate the values, gradients and laplacians of this single-particle orbital set ...
void create_spline(GT &xyz_g, BCT &xyz_bc)
OrbitalSetTraits< ValueType >::GradHessVector GGGVector
OrbitalSetTraits< ValueType >::GradVector GradVector
void evaluateValue(const ParticleSet &P, const int iat, ValueVector &psi) override
evaluate the values of this single-particle orbital set
typename bspline_traits< ST, 3 >::BCType BCType
UBspline_3d_d SingleSplineType
typename bspline_traits< ST, 3 >::SplineType SplineType
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
TinyVector< int, D > HalfG
sign bits at the G/2 boundaries
virtual std::string getClassName() const override
return class name
void resize(size_type n)
resize myData
void gatherv(T *sb, T *rb, int n, IT &counts, IT &displ, int dest)
void assign_vgl_from_l(int bc_sign, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi)
assign_vgl_from_l can be used when myL is precomputed and myV,myG,myL in cartesian ...
std::vector< SPOSet::PosType > kPoints
kpoints for each unique orbitals.
void assign_v(int bc_sign, const vContainer_type &myV, ValueVector &psi, int first, int last) const
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)
std::shared_ptr< MultiBspline< ST > > SplineInst
multi bspline set
class to match ST real spline with BsplineSet::ValueType (real) SPOs