QMCPACK
ParticleSet Class Reference

Specialized paritlce class for atomistic simulations. More...

+ Inheritance diagram for ParticleSet:
+ Collaboration diagram for ParticleSet:

Public Types

enum  quantum_domains { no_quantum_domain = 0, classical, quantum }
 
using Walker_t = Walker< QMCTraits, PtclOnLatticeTraits >
 walker type More...
 
using PropertyContainer_t = Walker_t::PropertyContainer_t
 container type to store the property More...
 
using Buffer_t = PooledData< RealType >
 buffer type for a serialized buffer More...
 
- Public Types inherited from QMCTraits
enum  { DIM = OHMMS_DIM, DIM_VGL = OHMMS_DIM + 2 }
 
using QTBase = QMCTypes< OHMMS_PRECISION, DIM >
 
using QTFull = QMCTypes< OHMMS_PRECISION_FULL, DIM >
 
using RealType = QTBase::RealType
 
using ComplexType = QTBase::ComplexType
 
using ValueType = QTBase::ValueType
 
using PosType = QTBase::PosType
 
using GradType = QTBase::GradType
 
using TensorType = QTBase::TensorType
 
using IndexType = OHMMS_INDEXTYPE
 define other types More...
 
using FullPrecRealType = QTFull::RealType
 
using FullPrecValueType = QTFull::ValueType
 
using PropertySetType = RecordNamedProperty< FullPrecRealType >
 define PropertyList_t More...
 
using PtclGrpIndexes = std::vector< std::pair< int, int > >
 
- Public Types inherited from OhmmsElementBase
enum  { useLIBXML = 0, useLIBXMLPP, usePLAIN }
 enumeration to choose the xml parser More...
 
- Public Types inherited from PtclOnLatticeTraits
using ParticleLayout = CrystalLattice< OHMMS_PRECISION, OHMMS_DIM >
 
using QTFull = QMCTraits::QTFull
 
using Index_t = int
 
using Scalar_t = QTFull::RealType
 
using Complex_t = QTFull::ComplexType
 
using SingleParticleIndex = ParticleLayout::SingleParticleIndex
 
using SingleParticlePos = ParticleLayout::SingleParticlePos
 
using Tensor_t = ParticleLayout::Tensor_t
 
using ParticleIndex = ParticleAttrib< Index_t >
 
using ParticleScalar = ParticleAttrib< Scalar_t >
 
using ParticlePos = ParticleAttrib< SingleParticlePos >
 
using ParticleTensor = ParticleAttrib< Tensor_t >
 
using ParticleGradient = ParticleAttrib< QTFull::GradType >
 
using ParticleLaplacian = ParticleAttrib< QTFull::ValueType >
 
using SingleParticleValue = QTFull::ValueType
 

Public Member Functions

 ParticleSet (const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
 default constructor More...
 
 ParticleSet (const ParticleSet &p)
 copy constructor More...
 
 ~ParticleSet () override
 default destructor More...
 
void create (const std::vector< int > &agroup)
 create grouped particles More...
 
void print (std::ostream &os, const size_t maxParticlesToPrint=0) const
 print particle coordinates to a std::ostream More...
 
bool get (std::ostream &os) const override
 dummy. For satisfying OhmmsElementBase. More...
 
bool put (std::istream &) override
 dummy. For satisfying OhmmsElementBase. More...
 
void reset () override
 dummy. For satisfying OhmmsElementBase. More...
 
bool put (xmlNodePtr cur) override
 initialize ParticleSet from xmlNode More...
 
void setQuantumDomain (quantum_domains qdomain)
 specify quantum_domain of particles More...
 
void set_quantum ()
 
bool is_classical () const
 
bool is_quantum () const
 
bool quantumDomainValid (quantum_domains qdomain) const
 check whether quantum domain is valid for particles More...
 
bool quantumDomainValid () const
 check whether quantum domain is valid for particles More...
 
int addTable (const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
 add a distance table More...
 
auto & getDistTable (int table_ID) const
 get a distance table by table_ID More...
 
const DistanceTableAAgetDistTableAA (int table_ID) const
 get a distance table by table_ID and dyanmic_cast to DistanceTableAA More...
 
const DistanceTableABgetDistTableAB (int table_ID) const
 get a distance table by table_ID and dyanmic_cast to DistanceTableAB More...
 
void resetCollectables ()
 reset all the collectable quantities during a MC iteration More...
 
void update (bool skipSK=false)
 update the internal data More...
 
void createSK ()
 create Structure Factor with PBCs More...
 
bool hasSK () const
 
const StructFactgetSK () const
 return Structure Factor More...
 
void turnOnPerParticleSK ()
 Turn on per particle storage in Structure Factor. More...
 
bool getPerParticleSKState () const
 Get state (on/off) of per particle storage in Structure Factor. More...
 
SpeciesSetgetSpeciesSet ()
 retrun the SpeciesSet of this particle set More...
 
const SpeciesSetgetSpeciesSet () const
 retrun the const SpeciesSet of this particle set More...
 
const std::string & parentName () const
 return parent's name More...
 
void setName (const std::string &aname)
 
const DynamicCoordinatesgetCoordinates () const
 
void resetGroups ()
 
const auto & getSimulationCell () const
 
const auto & getLattice () const
 
auto & getPrimitiveLattice () const
 
const auto & getLRBox () const
 
bool isSameMass () const
 
bool isSpinor () const
 
void setSpinor (bool is_spinor)
 
Index_t getActivePtcl () const
 return active particle id More...
 
const PosTypegetActivePos () const
 
Scalar_t getActiveSpinVal () const
 
const PosTypeactiveR (int iat) const
 return the active position if the particle is active or the return current position if not More...
 
const Scalar_tactiveSpin (int iat) const
 return the active spin value if the particle is active or return the current spin value if not More...
 
void makeMove (Index_t iat, const SingleParticlePos &displ, bool maybe_accept=true)
 move the iat-th particle to active_pos_ More...
 
void makeMoveWithSpin (Index_t iat, const SingleParticlePos &displ, const Scalar_t &sdispl)
 makeMove, but now includes an update to the spin variable More...
 
bool makeMoveAndCheck (Index_t iat, const SingleParticlePos &displ)
 move the iat-th particle to active_pos_ More...
 
bool makeMoveAndCheckWithSpin (Index_t iat, const SingleParticlePos &displ, const Scalar_t &sdispl)
 makeMoveAndCheck, but now includes an update to the spin variable More...
 
void makeVirtualMoves (const SingleParticlePos &newpos)
 Handles virtual moves for all the particles to a single newpos. More...
 
bool makeMoveAllParticles (const Walker_t &awalker, const ParticlePos &deltaR, RealType dt)
 move all the particles of a walker More...
 
bool makeMoveAllParticles (const Walker_t &awalker, const ParticlePos &deltaR, const std::vector< RealType > &dt)
 
bool makeMoveAllParticlesWithDrift (const Walker_t &awalker, const ParticlePos &drift, const ParticlePos &deltaR, RealType dt)
 move all the particles including the drift More...
 
bool makeMoveAllParticlesWithDrift (const Walker_t &awalker, const ParticlePos &drift, const ParticlePos &deltaR, const std::vector< RealType > &dt)
 
void accept_rejectMove (Index_t iat, bool accepted, bool forward_mode=true)
 accept or reject a proposed move Two operation modes: The using and updating distance tables via ParticleSet operate in two modes, regular and forward modes. More...
 
void acceptMove (Index_t iat)
 accept the move and update the particle attribute by the proposed move in regular mode More...
 
void rejectMove (Index_t iat)
 reject a proposed move in regular mode More...
 
void initPropertyList ()
 
int addProperty (const std::string &pname)
 
int addPropertyHistory (int leng)
 
void convert (const ParticlePos &pin, ParticlePos &pout)
 
void convert2Unit (const ParticlePos &pin, ParticlePos &pout)
 
void convert2Cart (const ParticlePos &pin, ParticlePos &pout)
 
void convert2Unit (ParticlePos &pout)
 
void convert2Cart (ParticlePos &pout)
 
void convert2UnitInBox (const ParticlePos &pint, ParticlePos &pout)
 
void convert2CartInBox (const ParticlePos &pint, ParticlePos &pout)
 
void applyBC (const ParticlePos &pin, ParticlePos &pout)
 
void applyBC (ParticlePos &pos)
 
void applyBC (const ParticlePos &pin, ParticlePos &pout, int first, int last)
 
void applyMinimumImage (ParticlePos &pinout) const
 
void loadWalker (Walker_t &awalker, bool pbyp)
 load a Walker_t to the current ParticleSet More...
 
void saveWalker (Walker_t &awalker)
 save this to awalker More...
 
void donePbyP (bool skipSK=false)
 update structure factor and unmark active_ptcl_ More...
 
FullPrecRealType *restrict getPropertyBase ()
 return the address of the values of Hamiltonian terms More...
 
const FullPrecRealType *restrict getPropertyBase () const
 return the address of the values of Hamiltonian terms More...
 
FullPrecRealType *restrict getPropertyBase (int i)
 return the address of the i-th properties More...
 
const FullPrecRealType *restrict getPropertyBase (int i) const
 return the address of the i-th properties More...
 
void setTwist (const SingleParticlePos &t)
 
const SingleParticlePosgetTwist () const
 
void randomizeFromSource (ParticleSet &src)
 Initialize particles around another ParticleSet Used to initialize an electron ParticleSet by an ion ParticleSet. More...
 
const std::string & species_from_index (int i)
 get species name of particle i More...
 
size_t getTotalNum () const
 
void clear ()
 
int groups () const
 return the number of groups More...
 
int first (int igroup) const
 return the first index of a group i More...
 
int last (int igroup) const
 return the last index of a group i More...
 
int getGroupID (int iat) const
 return the group id of a given particle in the particle set. More...
 
int groupsize (int igroup) const
 return the size of a group More...
 
template<typename ATList >
void createAttributeList (ATList &AttribList)
 add attributes to list for IO More...
 
void setMapStorageToInput (const std::vector< int > &mapping)
 
const std::vector< int > & get_map_storage_to_input () const
 
int getNumDistTables () const
 
auto & get_group_offsets () const
 
void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to a collection More...
 
- Public Member Functions inherited from OhmmsElementBase
 OhmmsElementBase (const char *aname="none")
 constructor with a name More...
 
virtual ~OhmmsElementBase ()
 destructor More...
 
const std::string & getName () const
 return the name More...
 
void setName (const std::string &aname)
 set name More...
 
void setIOMode (int imode)
 set iomode More...
 
virtual bool add (xmlNodePtr parent)
 add a xmlNode to the children list of parent More...
 
void put (const std::string &s)
 read from string More...
 
virtual void begin_node (std::ostream &os) const
 write the start of a node More...
 
virtual void end_node (std::ostream &os) const
 write the end of a node More...
 

Static Public Member Functions

static void mw_update (const RefVectorWithLeader< ParticleSet > &p_list, bool skipSK=false)
 batched version of update More...
 
template<CoordsType CT>
static void mw_makeMove (const RefVectorWithLeader< ParticleSet > &p_list, int iat, const MCCoords< CT > &displs)
 batched version of makeMove More...
 
static void mw_makeMove (const RefVectorWithLeader< ParticleSet > &p_list, int iat, const std::vector< SingleParticlePos > &displs)
 
static void mw_makeSpinMove (const RefVectorWithLeader< ParticleSet > &p_list, int iat, const std::vector< Scalar_t > &sdispls)
 batched version makeMove for spin variable only More...
 
template<CoordsType CT>
static void mw_accept_rejectMove (const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< bool > &isAccepted, bool forward_mode=true)
 batched version of acceptMove and rejectMove fused, templated on CoordsType More...
 
static void mw_accept_rejectMove (const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< bool > &isAccepted, bool forward_mode=true)
 batched version of acceptMove and rejectMove fused More...
 
static void mw_accept_rejectSpinMove (const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< bool > &isAccepted)
 batched version of acceptMove and reject Move fused, but only for spins More...
 
static void mw_loadWalker (const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< Walker_t > &walkers, const std::vector< bool > &recompute, bool pbyp)
 batched version of loadWalker More...
 
static void mw_saveWalker (const RefVectorWithLeader< ParticleSet > &psets, const RefVector< Walker_t > &walkers)
 batched version of saveWalker More...
 
static void mw_donePbyP (const RefVectorWithLeader< ParticleSet > &p_list, bool skipSK=false)
 batched version of donePbyP More...
 
static void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< ParticleSet > &p_list)
 acquire external resource and assocaite it with the list of ParticleSet Note: use RAII ResourceCollectionTeamLock whenever possible More...
 
static void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< ParticleSet > &p_list)
 release external resource Note: use RAII ResourceCollectionTeamLock whenever possible More...
 
static RefVectorWithLeader< DistanceTableextractDTRefList (const RefVectorWithLeader< ParticleSet > &p_list, int id)
 
static RefVectorWithLeader< DynamicCoordinatesextractCoordsRefList (const RefVectorWithLeader< ParticleSet > &p_list)
 
static RefVectorWithLeader< StructFactextractSKRefList (const RefVectorWithLeader< ParticleSet > &p_list)
 

Public Attributes

quantum_domains quantum_domain
 quantum_domain of the particles, default = classical More...
 
int current_step
 current MC step More...
 
ParticleIndex GroupID
 Species ID. More...
 
ParticlePos R
 Position. More...
 
ParticleScalar spins
 internal spin variables for dynamical spin calculations More...
 
ParticleGradient G
 gradients of the particles More...
 
ParticleLaplacian L
 laplacians of the particles More...
 
ParticleScalar Mass
 mass of each particle More...
 
ParticleScalar Z
 charge of each particle More...
 
Index_t activeBead
 the index of the active bead for particle-by-particle moves More...
 
Index_t direction
 the direction reptile traveling More...
 
std::vector< TinyVector< int, OHMMS_DIM > > DensityReducedGvecs
 Particle density in G-space for MPC interaction. More...
 
std::vector< ComplexTypeDensity_G
 
Array< RealType, OHMMS_DIMDensity_r
 
std::vector< TinyVector< int, OHMMS_DIM > > VHXCReducedGvecs
 DFT potential. More...
 
std::vector< ComplexTypeVHXC_G [2]
 
Array< RealType, OHMMS_DIMVHXC_r [2]
 
PropertySetType PropertyList
 name-value map of Walker Properties More...
 
PropertyContainer_t Properties
 properties of the current walker More...
 
Buffer_t Collectables
 observables in addition to those registered in Properties/PropertyList More...
 
std::vector< std::vector< FullPrecRealType > > PropertyHistory
 Property history vector. More...
 
std::vector< int > PHindex
 

Protected Member Functions

void computeNewPosDistTables (Index_t iat, const SingleParticlePos &newpos, bool maybe_accept=true)
 compute temporal DistTables and SK for a new particle position More...
 
void acceptMoveForwardMode (Index_t iat)
 actual implemenation for accepting a proposed move in forward mode More...
 
void rejectMoveForwardMode (Index_t iat)
 reject a proposed move in forward mode More...
 
void resize (size_t numPtcl)
 resize internal storage More...
 

Static Protected Member Functions

static void mw_computeNewPosDistTables (const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< SingleParticlePos > &new_positions, bool maybe_accept=true)
 compute temporal DistTables and SK for a new particle position for each walker in a batch More...
 

Protected Attributes

const SimulationCellsimulation_cell_
 reference to global simulation cell More...
 
bool same_mass_
 true if the particles have the same mass More...
 
bool is_spinor_
 true is a dynamic spin calculation More...
 
Index_t active_ptcl_
 the index of the active particle during particle-by-particle moves More...
 
SingleParticlePos active_pos_
 the proposed position of active_ptcl_ during particle-by-particle moves More...
 
Scalar_t active_spin_val_
 the proposed spin of active_ptcl_ during particle-by-particle moves More...
 
std::vector< int > map_storage_to_input_
 Map storage index to the input index. More...
 
SpeciesSet my_species_
 SpeciesSet of particles. More...
 
std::unique_ptr< StructFactstructure_factor_
 Structure factor. More...
 
ResourceHandle< SKMultiWalkerMemmw_structure_factor_data_handle_
 multi walker structure factor data More...
 
std::map< std::string, int > myDistTableMap
 map to handle distance tables More...
 
std::vector< std::unique_ptr< DistanceTable > > DistTables
 distance tables that need to be updated by moving this ParticleSet More...
 
std::vector< std::string > distTableDescriptions
 Descriptions from distance table creation. Same order as DistTables. More...
 
TimerList_t myTimers
 
SingleParticlePos myTwist
 
std::string ParentName
 
size_t TotalNum
 total number of particles More...
 
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
 array to handle a group of distinct particles per species More...
 
std::unique_ptr< DynamicCoordinatescoordinates_
 internal representation of R. It can be an SoA copy of R More...
 
- Protected Attributes inherited from OhmmsElementBase
int myIOMode
 the type of IO mode: default is useLIBXML More...
 
std::string myName
 the name of the node, corresponds to the xml tag More...
 

Detailed Description

Specialized paritlce class for atomistic simulations.

Derived from QMCTraits, ParticleBase<PtclOnLatticeTraits> and OhmmsElementBase. The ParticleLayout class represents a supercell with/without periodic boundary conditions. The ParticleLayout class also takes care of spatial decompositions for efficient evaluations for the interactions with a finite cutoff.

Definition at line 55 of file ParticleSet.h.

Member Typedef Documentation

◆ Buffer_t

buffer type for a serialized buffer

Definition at line 63 of file ParticleSet.h.

◆ PropertyContainer_t

container type to store the property

Definition at line 61 of file ParticleSet.h.

◆ Walker_t

walker type

Definition at line 59 of file ParticleSet.h.

Member Enumeration Documentation

◆ quantum_domains

Enumerator
no_quantum_domain 
classical 
quantum 

Definition at line 65 of file ParticleSet.h.

Constructor & Destructor Documentation

◆ ParticleSet() [1/2]

ParticleSet ( const SimulationCell simulation_cell,
const DynamicCoordinateKind  kind = DynamicCoordinateKind::DC_POS 
)

default constructor

Definition at line 58 of file ParticleSet.cpp.

References ParticleSet::initPropertyList().

60  Properties(0, 0, 1, WP::MAXPROPERTIES),
61  simulation_cell_(simulation_cell),
62  same_mass_(true),
63  is_spinor_(false),
64  active_ptcl_(-1),
65  active_spin_val_(0.0),
67  myTwist(0.0),
68  ParentName("0"),
69  TotalNum(0),
70  group_offsets_(std::make_shared<Vector<int, OMPallocator<int>>>()),
72 {
74 }
quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119
std::string myName
the name of the node, corresponds to the xml tag
std::unique_ptr< DynamicCoordinates > createDynamicCoordinates(const DynamicCoordinateKind kind)
create DynamicCoordinates based on kind
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
bool same_mass_
true if the particles have the same mass
Definition: ParticleSet.h:590
SingleParticlePos myTwist
Definition: ParticleSet.h:637
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
static const TimerNameList_t< PSetTimers > generatePSetTimerNames(std::string &obj_name)
Definition: ParticleSet.cpp:47
bool is_spinor_
true is a dynamic spin calculation
Definition: ParticleSet.h:592
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645
TimerManager< NewTimer > & getGlobalTimerManager()
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ ParticleSet() [2/2]

ParticleSet ( const ParticleSet p)

copy constructor

Definition at line 76 of file ParticleSet.cpp.

References ParticleSet::addTable(), ParticleSet::Collectables, ParticleSet::DistTables, ParticleSet::G, OhmmsElementBase::getName(), ParticleSet::getTotalNum(), ParticleSet::GroupID, ParticleAttrib< T, Alloc >::InUnit, ParticleSet::is_spinor_, ParticleSet::L, ParticleSet::Mass, OhmmsElementBase::myName, ParticleSet::myTwist, RecordNamedProperty< T >::Names, ParticleSet::PropertyHistory, ParticleSet::PropertyList, ParticleSet::quantum_domain, ParticleSet::R, ParticleSet::resize(), ParticleSet::setQuantumDomain(), ParticleSet::spins, ParticleSet::structure_factor_, RecordNamedProperty< T >::Values, and ParticleSet::Z.

77  : Properties(p.Properties),
78  simulation_cell_(p.simulation_cell_),
79  same_mass_(true),
80  is_spinor_(false),
81  active_ptcl_(-1),
82  active_spin_val_(0.0),
83  my_species_(p.getSpeciesSet()),
85  myTwist(0.0),
86  ParentName(p.parentName()),
87  group_offsets_(p.group_offsets_),
88  coordinates_(p.coordinates_->makeClone())
89 {
90  setQuantumDomain(p.quantum_domain);
91 
92  resize(p.getTotalNum());
93  R.InUnit = p.R.InUnit;
94  R = p.R;
95  spins = p.spins;
96  GroupID = p.GroupID;
97  is_spinor_ = p.is_spinor_;
98 
99  //need explicit copy:
100  Mass = p.Mass;
101  Z = p.Z;
102  //std::ostringstream o;
103  //o<<p.getName()<<ObjectTag;
104  //this->setName(o.str());
105  //app_log() << " Copying a particle set " << p.getName() << " to " << this->getName() << " groups=" << groups() << std::endl;
106  myName = p.getName();
107  PropertyList.Names = p.PropertyList.Names;
108  PropertyList.Values = p.PropertyList.Values;
109  PropertyHistory = p.PropertyHistory;
110  Collectables = p.Collectables;
111  //construct the distance tables with the same order
112  for (int i = 0; i < p.DistTables.size(); ++i)
113  addTable(p.DistTables[i]->get_origin(), p.DistTables[i]->getModes());
114 
115  if (p.structure_factor_)
116  structure_factor_ = std::make_unique<StructFact>(*p.structure_factor_);
117  myTwist = p.myTwist;
118 
119  G = p.G;
120  L = p.L;
121 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119
std::string myName
the name of the node, corresponds to the xml tag
PosUnit InUnit
The unit type.
bool same_mass_
true if the particles have the same mass
Definition: ParticleSet.h:590
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: ParticleSet.h:129
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
SingleParticlePos myTwist
Definition: ParticleSet.h:637
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
PropertySetType PropertyList
name-value map of Walker Properties
Definition: ParticleSet.h:112
static const TimerNameList_t< PSetTimers > generatePSetTimerNames(std::string &obj_name)
Definition: ParticleSet.cpp:47
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
std::vector< std::string > Names
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
void resize(size_t numPtcl)
resize internal storage
Definition: ParticleSet.h:683
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
bool is_spinor_
true is a dynamic spin calculation
Definition: ParticleSet.h:592
ParticleScalar Z
charge of each particle
Definition: ParticleSet.h:89
Buffer_t Collectables
observables in addition to those registered in Properties/PropertyList
Definition: ParticleSet.h:126
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87
void setQuantumDomain(quantum_domains qdomain)
specify quantum_domain of particles
TimerManager< NewTimer > & getGlobalTimerManager()
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587
std::vector< T > Values

◆ ~ParticleSet()

~ParticleSet ( )
overridedefault

default destructor

Member Function Documentation

◆ accept_rejectMove()

void accept_rejectMove ( Index_t  iat,
bool  accepted,
bool  forward_mode = true 
)

accept or reject a proposed move Two operation modes: The using and updating distance tables via ParticleSet operate in two modes, regular and forward modes.

Regular mode The regular mode can only be used when the distance tables for particle pairs are fully up-to-date. This is the case after calling ParticleSet::update() in a unit test or after p-by-p moves in a QMC driver. In this mode, the distance tables remain up-to-date after calling ParticleSet::acceptMove and calling ParticleSet::rejectMove is not mandatory.

Forward mode The forward mode assumes that distance table is not fully up-to-date until every particle is accepted or rejected to move once in order. This is the mode used in the p-by-p part of drivers. In this mode, calling ParticleSet::accept_rejectMove is required to handle accept/reject rather than calling individual ParticleSet::acceptMove and ParticleSet::reject. ParticleSet::accept_rejectMove(iel) ensures the distance tables (jel < iel) part is fully up-to-date regardless a move is accepted or rejected. For this reason, the rejecting operation inside ParticleSet::accept_rejectMove involves writing the distances with respect to the old particle position.

Definition at line 671 of file ParticleSet.cpp.

References ParticleSet::acceptMove(), ParticleSet::acceptMoveForwardMode(), ParticleSet::rejectMove(), and ParticleSet::rejectMoveForwardMode().

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), qmcplusplus::TEST_CASE(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), and qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST().

672 {
673  if (forward_mode)
674  if (accepted)
676  else
678  else if (accepted)
679  acceptMove(iat);
680  else
681  rejectMove(iat);
682 }
void acceptMoveForwardMode(Index_t iat)
actual implemenation for accepting a proposed move in forward mode
void rejectMoveForwardMode(Index_t iat)
reject a proposed move in forward mode
void rejectMove(Index_t iat)
reject a proposed move in regular mode
void acceptMove(Index_t iat)
accept the move and update the particle attribute by the proposed move in regular mode ...

◆ acceptMove()

void acceptMove ( Index_t  iat)

accept the move and update the particle attribute by the proposed move in regular mode

update the particle attribute by the proposed move

Parameters
iatthe index of the particle whose position and other attributes to be updated

When the active_ptcl_ is equal to iat, overwrite the position and update the content of the distance tables.

Definition at line 640 of file ParticleSet.cpp.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, ParticleSet::active_spin_val_, ParticleSet::coordinates_, ParticleSet::DistTables, ParticleSet::myTimers, qmcplusplus::PS_accept, ParticleSet::R, ParticleSet::spins, and ParticleSet::update().

Referenced by ParticleSet::accept_rejectMove(), NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(), NonLocalECPComponent::evaluateOneWithForces(), SOECPComponent::evaluateValueAndDerivatives(), NonLocalECPComponent::evaluateValueAndDerivatives(), NonLocalECPotential::makeNonLocalMovesPbyP(), WaveFunctionTester::runRatioTest(), qmcplusplus::TEST_CASE(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_J1_spline(), qmcplusplus::test_LiH_msd(), and BackflowTransformation::testPbyP().

641 {
642 #ifndef NDEBUG
643  if (iat != active_ptcl_)
644  throw std::runtime_error("Bug detected by acceptMove! Request electron is not active!");
645 #endif
646  ScopedTimer update_scope(myTimers[PS_accept]);
647  //Update position + distance-table
648  coordinates_->setOneParticlePos(active_pos_, iat);
649  for (int i = 0; i < DistTables.size(); i++)
650  DistTables[i]->update(iat);
651 
652  R[iat] = active_pos_;
653  spins[iat] = active_spin_val_;
654  active_ptcl_ = -1;
655 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
void update(bool skipSK=false)
update the internal data
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ acceptMoveForwardMode()

void acceptMoveForwardMode ( Index_t  iat)
protected

actual implemenation for accepting a proposed move in forward mode

Parameters
iatthe index of the particle whose position and other attributes to be updated

Definition at line 657 of file ParticleSet.cpp.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, ParticleSet::active_spin_val_, ParticleSet::coordinates_, ParticleSet::DistTables, ParticleSet::myTimers, qmcplusplus::PS_accept, ParticleSet::R, and ParticleSet::spins.

Referenced by ParticleSet::accept_rejectMove().

658 {
659  assert(iat == active_ptcl_);
660  ScopedTimer update_scope(myTimers[PS_accept]);
661  //Update position + distance-table
662  coordinates_->setOneParticlePos(active_pos_, iat);
663  for (int i = 0; i < DistTables.size(); i++)
664  DistTables[i]->updatePartial(iat, true);
665 
666  R[iat] = active_pos_;
667  spins[iat] = active_spin_val_;
668  active_ptcl_ = -1;
669 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ acquireResource()

void acquireResource ( ResourceCollection collection,
const RefVectorWithLeader< ParticleSet > &  p_list 
)
static

acquire external resource and assocaite it with the list of ParticleSet Note: use RAII ResourceCollectionTeamLock whenever possible

Definition at line 953 of file ParticleSet.cpp.

References ParticleSet::extractCoordsRefList(), ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), and ResourceCollection::lendResource().

Referenced by VirtualParticleSet::acquireResource().

954 {
955  auto& ps_leader = p_list.getLeader();
956  ps_leader.coordinates_->acquireResource(collection, extractCoordsRefList(p_list));
957  for (int i = 0; i < ps_leader.DistTables.size(); i++)
958  ps_leader.DistTables[i]->acquireResource(collection, extractDTRefList(p_list, i));
959 
960  if (ps_leader.structure_factor_)
961  p_list.getLeader().mw_structure_factor_data_handle_ = collection.lendResource<SKMultiWalkerMem>();
962 }
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
static RefVectorWithLeader< DynamicCoordinates > extractCoordsRefList(const RefVectorWithLeader< ParticleSet > &p_list)

◆ activeR()

const PosType& activeR ( int  iat) const
inline

return the active position if the particle is active or the return current position if not

Definition at line 265 of file ParticleSet.h.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, and ParticleSet::R.

Referenced by FreeOrbital::evaluate_notranspose(), SplineC2COMPTarget< ST >::evaluate_notranspose(), SplineC2ROMPTarget< ST >::evaluate_notranspose(), PWBasis::evaluateAll(), SplineC2R< ST >::evaluateDetRatios(), SplineC2C< ST >::evaluateDetRatios(), SplineR2R< ST >::evaluateDetRatios(), SplineC2COMPTarget< ST >::evaluateDetRatios(), SplineC2ROMPTarget< ST >::evaluateDetRatios(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceV(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceVGL(), SoaLocalizedBasisSet< COT, ORBT >::evaluateV(), FreeOrbital::evaluateValue(), SHOSet::evaluateValue(), PWOrbitalSet::evaluateValue(), PWRealOrbitalSet::evaluateValue(), HybridRepCplx< SPLINEBASE >::evaluateValue(), HybridRepReal< SPLINEBASE >::evaluateValue(), SplineC2R< ST >::evaluateValue(), SplineC2C< ST >::evaluateValue(), SplineR2R< ST >::evaluateValue(), SplineC2COMPTarget< ST >::evaluateValue(), SplineC2ROMPTarget< ST >::evaluateValue(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGH(), SplineC2R< ST >::evaluateVGH(), SplineR2R< ST >::evaluateVGH(), SplineC2C< ST >::evaluateVGH(), HybridRepCplx< SPLINEBASE >::evaluateVGH(), HybridRepReal< SPLINEBASE >::evaluateVGH(), SplineC2COMPTarget< ST >::evaluateVGH(), SplineC2ROMPTarget< ST >::evaluateVGH(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGHGH(), SplineC2R< ST >::evaluateVGHGH(), SplineR2R< ST >::evaluateVGHGH(), SplineC2C< ST >::evaluateVGHGH(), SplineC2COMPTarget< ST >::evaluateVGHGH(), SplineC2ROMPTarget< ST >::evaluateVGHGH(), FreeOrbital::evaluateVGL(), SHOSet::evaluateVGL(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGL(), HybridRepCplx< SPLINEBASE >::evaluateVGL(), SplineC2R< ST >::evaluateVGL(), HybridRepReal< SPLINEBASE >::evaluateVGL(), SplineR2R< ST >::evaluateVGL(), SplineC2C< ST >::evaluateVGL(), SplineC2COMPTarget< ST >::evaluateVGL(), SplineC2ROMPTarget< ST >::evaluateVGL(), SplineC2COMPTarget< ST >::mw_evaluateDetRatios(), and SplineC2ROMPTarget< ST >::mw_evaluateDetRatios().

266  {
267  // When active_ptcl_ == iat, a move has been proposed.
268  return (active_ptcl_ == iat) ? active_pos_ : R[iat];
269  }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticlePos R
Position.
Definition: ParticleSet.h:79
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601

◆ activeSpin()

const Scalar_t& activeSpin ( int  iat) const
inline

return the active spin value if the particle is active or return the current spin value if not

Definition at line 272 of file ParticleSet.h.

References ParticleSet::active_ptcl_, ParticleSet::active_spin_val_, and ParticleSet::spins.

Referenced by SpinorSet::evaluate_notranspose(), SpinorSet::evaluate_notranspose_spin(), SpinorSet::evaluate_spin(), SpinorSet::evaluateDetSpinorRatios(), SpinorSet::evaluateGradSource(), SpinorSet::evaluateValue(), SpinorSet::evaluateVGL(), and SpinorSet::evaluateVGL_spin().

273  {
274  // When active_ptcl_ == iat, a move has been proposed.
275  return (active_ptcl_ == iat) ? active_spin_val_ : spins[iat];
276  }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603

◆ addProperty()

int addProperty ( const std::string &  pname)
inline

Definition at line 411 of file ParticleSet.h.

References RecordNamedProperty< T >::add(), and ParticleSet::PropertyList.

Referenced by Reptile::Reptile(), and RMC::RMC().

411 { return PropertyList.add(pname.c_str()); }
PropertySetType PropertyList
name-value map of Walker Properties
Definition: ParticleSet.h:112
int add(const std::string &aname)

◆ addPropertyHistory()

int addPropertyHistory ( int  leng)

Definition at line 902 of file ParticleSet.cpp.

References ParticleSet::PHindex, and ParticleSet::PropertyHistory.

Referenced by ForwardWalking::putSpecial().

903 {
904  int newL = PropertyHistory.size();
905  PropertyHistory.push_back(std::vector<FullPrecRealType>(leng, 0.0));
906  PHindex.push_back(0);
907  return newL;
908 }
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: ParticleSet.h:129
std::vector< int > PHindex
Definition: ParticleSet.h:130

◆ addTable()

int addTable ( const ParticleSet psrc,
DTModes  modes = DTModes::ALL_OFF 
)

add a distance table

Parameters
psrcsource particle set
modesbitmask DistanceTable::DTModes

if this->myName == psrc.getName(), AA type. Otherwise, AB type.

Definition at line 307 of file ParticleSet.cpp.

References app_debug, qmcplusplus::app_log(), qmcplusplus::createDistanceTable(), ParticleSet::distTableDescriptions, ParticleSet::DistTables, OhmmsElementBase::getName(), ParticleSet::myDistTableMap, and OhmmsElementBase::myName.

Referenced by qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::create_CN_particlesets(), qmcplusplus::get_two_species_particleset(), InitMolecularSystem::initMolecule(), L2Potential::L2Potential(), LatticeGaussianProduct::LatticeGaussianProduct(), LocalECPotential::LocalECPotential(), NonLocalECPotential::NonLocalECPotential(), ParticleSet::ParticleSet(), EnergyDensityEstimator::put(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), LocalECPotential::resetTargetParticleSet(), L2Potential::resetTargetParticleSet(), CoulombPBCAB::resetTargetParticleSet(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::set_info(), qmcplusplus::setup_He_wavefunction(), SOECPotential::SOECPotential(), qmcplusplus::TEST_CASE(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::testElecCase(), qmcplusplus::testTrialWaveFunction_diamondC_2x1x1(), and VirtualParticleSet::VirtualParticleSet().

308 {
309  if (myName == "none" || psrc.getName() == "none")
310  throw std::runtime_error("ParticleSet::addTable needs proper names for both source and target particle sets.");
311 
312  int tid;
313  std::map<std::string, int>::iterator tit(myDistTableMap.find(psrc.getName()));
314  if (tit == myDistTableMap.end())
315  {
316  std::ostringstream description;
317  tid = DistTables.size();
318  if (myName == psrc.getName())
319  DistTables.push_back(createDistanceTable(*this, description));
320  else
321  DistTables.push_back(createDistanceTable(psrc, *this, description));
322  distTableDescriptions.push_back(description.str());
323  myDistTableMap[psrc.getName()] = tid;
324  app_debug() << " ... ParticleSet::addTable Create Table #" << tid << " " << DistTables[tid]->getName()
325  << std::endl;
326  }
327  else
328  {
329  tid = (*tit).second;
330  app_debug() << " ... ParticleSet::addTable Reuse Table #" << tid << " " << DistTables[tid]->getName() << std::endl;
331  }
332 
333  DistTables[tid]->setModes(DistTables[tid]->getModes() | modes);
334 
335  app_log().flush();
336  return tid;
337 }
std::string myName
the name of the node, corresponds to the xml tag
#define app_debug
Definition: OutputManager.h:75
std::ostream & app_log()
Definition: OutputManager.h:65
std::map< std::string, int > myDistTableMap
map to handle distance tables
Definition: ParticleSet.h:627
std::vector< std::string > distTableDescriptions
Descriptions from distance table creation. Same order as DistTables.
Definition: ParticleSet.h:633
std::unique_ptr< DistanceTable > createDistanceTable(ParticleSet &s, std::ostream &description)
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ applyBC() [1/3]

void applyBC ( const ParticlePos pin,
ParticlePos pout 
)

Definition at line 136 of file ParticleSet.BC.cpp.

Referenced by InitMolecularSystem::initMolecule(), InitMolecularSystem::initWithVolume(), and XMLParticleParser::readXML().

136 { applyBC(pin, pout, 0, pin.size()); }
void applyBC(const ParticlePos &pin, ParticlePos &pout)

◆ applyBC() [2/3]

void applyBC ( ParticlePos pos)

Definition at line 162 of file ParticleSet.BC.cpp.

References ParticleSet::G, ParticleSet::getLattice(), qmcplusplus::Lattice, ParticleSet::R, and ParticleSet::TotalNum.

163 {
164  if (pos.getUnit() == PosUnit::Lattice)
165  {
166  ApplyBConds<ParticlePos, Tensor_t, DIM>::Unit2Unit(pos, 0, TotalNum);
167  }
168  else
169  {
170  ApplyBConds<ParticlePos, Tensor_t, DIM>::Cart2Cart(pos, getLattice().G, getLattice().R, 0, TotalNum);
171  }
172 }
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ applyBC() [3/3]

void applyBC ( const ParticlePos pin,
ParticlePos pout,
int  first,
int  last 
)

Definition at line 138 of file ParticleSet.BC.cpp.

References qmcplusplus::Cartesian, ParticleSet::first(), ParticleSet::getLattice(), ParticleSet::last(), and qmcplusplus::Lattice.

139 {
140  if (pin.getUnit() == PosUnit::Cartesian)
141  {
142  if (pout.getUnit() == PosUnit::Cartesian)
143  ApplyBConds<ParticlePos, Tensor_t, DIM>::Cart2Cart(pin, getLattice().G, getLattice().R, pout, first, last);
144  else if (pout.getUnit() == PosUnit::Lattice)
145  ApplyBConds<ParticlePos, Tensor_t, DIM>::Cart2Unit(pin, getLattice().G, pout, first, last);
146  else
147  throw std::runtime_error("Unknown unit conversion");
148  }
149  else if (pin.getUnit() == PosUnit::Lattice)
150  {
151  if (pout.getUnit() == PosUnit::Cartesian)
152  ApplyBConds<ParticlePos, Tensor_t, DIM>::Unit2Cart(pin, getLattice().R, pout, first, last);
153  else if (pout.getUnit() == PosUnit::Lattice)
154  ApplyBConds<ParticlePos, Tensor_t, DIM>::Unit2Unit(pin, pout, first, last);
155  else
156  throw std::runtime_error("Unknown unit conversion");
157  }
158  else
159  throw std::runtime_error("Unknown unit conversion");
160 }
int first(int igroup) const
return the first index of a group i
Definition: ParticleSet.h:514
int last(int igroup) const
return the last index of a group i
Definition: ParticleSet.h:517
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ applyMinimumImage()

void applyMinimumImage ( ParticlePos pinout) const

Definition at line 174 of file ParticleSet.BC.cpp.

References ParticleSet::getLattice(), and qmcplusplus::SUPERCELL_OPEN.

Referenced by EnergyDensityEstimator::evaluate(), EnergyDensityEstimator::set_ptcl(), and qmcplusplus::TEST_CASE().

175 {
176  if (getLattice().SuperCellEnum == SUPERCELL_OPEN)
177  return;
178  for (int i = 0; i < pinout.size(); ++i)
179  getLattice().applyMinimumImage(pinout[i]);
180 }
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ clear()

void clear ( )
inline

Definition at line 495 of file ParticleSet.h.

References Vector< T, Alloc >::clear(), ParticleSet::coordinates_, ParticleSet::G, ParticleSet::GroupID, ParticleSet::L, ParticleSet::Mass, ParticleSet::R, ParticleSet::spins, ParticleSet::TotalNum, and ParticleSet::Z.

496  {
497  TotalNum = 0;
498 
499  R.clear();
500  spins.clear();
501  GroupID.clear();
502  G.clear();
503  L.clear();
504  Mass.clear();
505  Z.clear();
506 
507  coordinates_->resize(0);
508  }
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
ParticleScalar Z
charge of each particle
Definition: ParticleSet.h:89
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87
void clear()
clear
Definition: OhmmsVector.h:191

◆ computeNewPosDistTables()

void computeNewPosDistTables ( Index_t  iat,
const SingleParticlePos newpos,
bool  maybe_accept = true 
)
protected

compute temporal DistTables and SK for a new particle position

Parameters
iatthe particle that is moved on a sphere
newposa new particle position
maybe_acceptif false, the caller guarantees that the proposed move will not be accepted.

Definition at line 458 of file ParticleSet.cpp.

References ParticleSet::DistTables, ParticleSet::myTimers, and qmcplusplus::PS_newpos.

Referenced by ParticleSet::makeMove(), and ParticleSet::makeMoveAndCheck().

459 {
460  ScopedTimer compute_newpos_scope(myTimers[PS_newpos]);
461 
462  for (int i = 0; i < DistTables.size(); ++i)
463  DistTables[i]->move(*this, newpos, iat, maybe_accept);
464 }
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ convert()

void convert ( const ParticlePos pin,
ParticlePos pout 
)

Definition at line 77 of file ParticleSet.BC.cpp.

References ParticleSet::G, ParticleSet::getLattice(), qmcplusplus::Lattice, ParticleSet::R, and Vector< T, Alloc >::size().

78 {
79  if (pin.getUnit() == pout.getUnit())
80  {
81  pout = pin;
82  return;
83  }
84  if (pin.getUnit() == PosUnit::Lattice)
85  //convert to CartesianUnit
86  {
87  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pin, getLattice().R, pout, 0, pin.size());
88  }
89  else
90  //convert to getLattice()Unit
91  {
92  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pin, getLattice().G, pout, 0, pin.size());
93  }
94 }
size_type size() const
return the current size
Definition: OhmmsVector.h:162
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ convert2Cart() [1/2]

void convert2Cart ( const ParticlePos pin,
ParticlePos pout 
)

Definition at line 105 of file ParticleSet.BC.cpp.

References qmcplusplus::Cartesian, ParticleSet::getLattice(), ParticleSet::R, and Vector< T, Alloc >::size().

Referenced by ParticleSet::convert2CartInBox(), ParticleSet::createSK(), XMLParticleParser::readXML(), and WaveFunctionTester::runNodePlot().

106 {
107  pout.setUnit(PosUnit::Cartesian);
108  if (pin.getUnit() == PosUnit::Cartesian)
109  pout = pin;
110  else
111  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pin, getLattice().R, pout, 0, pin.size());
112 }
size_type size() const
return the current size
Definition: OhmmsVector.h:162
ParticlePos R
Position.
Definition: ParticleSet.h:79
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ convert2Cart() [2/2]

void convert2Cart ( ParticlePos pout)

Definition at line 125 of file ParticleSet.BC.cpp.

References qmcplusplus::Cartesian, ParticleSet::getLattice(), ParticleSet::R, and Vector< T, Alloc >::size().

126 {
127  if (pinout.getUnit() == PosUnit::Cartesian)
128  return;
129  else
130  {
131  pinout.setUnit(PosUnit::Cartesian);
132  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pinout, getLattice().R, 0, pinout.size());
133  }
134 }
size_type size() const
return the current size
Definition: OhmmsVector.h:162
ParticlePos R
Position.
Definition: ParticleSet.h:79
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ convert2CartInBox()

void convert2CartInBox ( const ParticlePos pint,
ParticlePos pout 
)

Definition at line 189 of file ParticleSet.BC.cpp.

References ParticleSet::convert2Cart(), and ParticleSet::convert2UnitInBox().

190 {
191  convert2UnitInBox(pin, pout); // convert to crystalline unit
192  convert2Cart(pout);
193 }
void convert2UnitInBox(const ParticlePos &pint, ParticlePos &pout)
void convert2Cart(const ParticlePos &pin, ParticlePos &pout)

◆ convert2Unit() [1/2]

void convert2Unit ( const ParticlePos pin,
ParticlePos pout 
)

Definition at line 96 of file ParticleSet.BC.cpp.

References ParticleSet::G, ParticleSet::getLattice(), qmcplusplus::Lattice, and Vector< T, Alloc >::size().

Referenced by ParticleSet::convert2UnitInBox().

97 {
98  pout.setUnit(PosUnit::Lattice);
99  if (pin.getUnit() == PosUnit::Lattice)
100  pout = pin;
101  else
102  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pin, getLattice().G, pout, 0, pin.size());
103 }
size_type size() const
return the current size
Definition: OhmmsVector.h:162
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ convert2Unit() [2/2]

void convert2Unit ( ParticlePos pout)

Definition at line 114 of file ParticleSet.BC.cpp.

References ParticleSet::G, ParticleSet::getLattice(), qmcplusplus::Lattice, and Vector< T, Alloc >::size().

115 {
116  if (pinout.getUnit() == PosUnit::Lattice)
117  return;
118  else
119  {
120  pinout.setUnit(PosUnit::Lattice);
121  ConvertPosUnit<ParticlePos, Tensor_t, DIM>::apply(pinout, getLattice().G, 0, pinout.size());
122  }
123 }
size_type size() const
return the current size
Definition: OhmmsVector.h:162
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
const auto & getLattice() const
Definition: ParticleSet.h:251

◆ convert2UnitInBox()

void convert2UnitInBox ( const ParticlePos pint,
ParticlePos pout 
)

Definition at line 182 of file ParticleSet.BC.cpp.

References ParticleSet::convert2Unit(), qmcplusplus::Lattice, and qmcplusplus::put2box().

Referenced by ParticleSet::convert2CartInBox().

183 {
184  pout.setUnit(PosUnit::Lattice);
185  convert2Unit(pin, pout); // convert to crystalline unit
186  put2box(pout);
187 }
void convert2Unit(const ParticlePos &pin, ParticlePos &pout)
void put2box(ParticleAttrib< TinyVector< T, D >> &inout)
inout[i]=inout[i]-floor(inout[i])

◆ create()

void create ( const std::vector< int > &  agroup)

create grouped particles

Parameters
agroupnumber of particles per group

Definition at line 125 of file ParticleSet.cpp.

References ParticleSet::group_offsets_, ParticleSet::GroupID, ParticleSet::resize(), and ParticleSet::TotalNum.

Referenced by qmcplusplus::create_C_pbc_particlesets(), QMCGaussianParserBase::createElectronSet(), qmcplusplus::doSOECPotentialTest(), qmcplusplus::get_two_species_particleset(), GaussianFCHKParser::parse(), RMGParser::parse(), LCAOHDFParser::parse(), QPParser::parse(), GamesAsciiParser::parse(), DiracParser::parse(), XMLParticleParser::readXML(), qmcplusplus::setup_He_wavefunction(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_DiracDeterminant_delayed_update(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminant_second(), qmcplusplus::test_DiracDeterminantBatched_delayed_update(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_DiracDeterminantBatched_second(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), qmcplusplus::testElecCase(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

126 {
127  auto& group_offsets(*group_offsets_);
128  group_offsets.resize(agroup.size() + 1);
129  group_offsets[0] = 0;
130  for (int is = 0; is < agroup.size(); is++)
131  group_offsets[is + 1] = group_offsets[is] + agroup[is];
132  group_offsets.updateTo();
133  const size_t nsum = group_offsets[agroup.size()];
134  resize(nsum);
135  TotalNum = nsum;
136  int loc = 0;
137  for (int i = 0; i < agroup.size(); i++)
138  for (int j = 0; j < agroup[i]; j++, loc++)
139  GroupID[loc] = i;
140 }
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
void resize(size_t numPtcl)
resize internal storage
Definition: ParticleSet.h:683
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ createAttributeList()

void createAttributeList ( ATList &  AttribList)
inline

add attributes to list for IO

Definition at line 531 of file ParticleSet.h.

References ParticleSet::G, ParticleTags::gradtype_tag, ParticleSet::GroupID, ParticleTags::indextype_tag, ParticleTags::ionid_tag, ParticleSet::L, ParticleTags::laptype_tag, ParticleSet::Mass, ParticleTags::position_tag, ParticleTags::postype_tag, ParticleSet::R, ParticleTags::scalartype_tag, OhmmsObject::setObjName(), OhmmsObject::setTypeName(), ParticleSet::spins, ParticleTags::spins_tag, and ParticleSet::Z.

Referenced by XMLParticleParser::XMLParticleParser().

532  {
539  //add basic attributes
540  AttribList.add(R);
541  AttribList.add(spins);
542  AttribList.add(GroupID);
543 
546 
547  G.setObjName("grad");
548  L.setObjName("lap");
549 
550  AttribList.add(G);
551  AttribList.add(L);
552 
553  //more particle attributes
555  Mass.setObjName("mass");
556  AttribList.add(Mass);
557 
559  Z.setObjName("charge");
560  AttribList.add(Z);
561  }
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
void setTypeName(const std::string &tname)
set the type name
Definition: OhmmsObject.h:60
static std::string indextype_tag
the datatype tag for the index-type attribute
Definition: ParticleTags.h:55
static std::string spins_tag
the name for spins attribute
Definition: ParticleTags.h:87
static std::string position_tag
names of particle attributes, e.g., position
Definition: ParticleTags.h:84
static std::string postype_tag
the datatype tag for the pos-type attribute
Definition: ParticleTags.h:64
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
void setObjName(const std::string &oname)
set the object name
Definition: OhmmsObject.h:63
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
static std::string ionid_tag
the name for ionid attribute
Definition: ParticleTags.h:93
ParticleScalar Z
charge of each particle
Definition: ParticleSet.h:89
static std::string gradtype_tag
the datatype tag for the gradient-type attribute
Definition: ParticleTags.h:67
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87
static std::string scalartype_tag
the datatype tag for the scalar-type attribute
Definition: ParticleTags.h:58
static std::string laptype_tag
the datatype tag for the laplacian-type attribute
Definition: ParticleTags.h:70

◆ createResource()

void createResource ( ResourceCollection collection) const

initialize a shared resource and hand it to a collection

Definition at line 944 of file ParticleSet.cpp.

References ResourceCollection::addResource(), ParticleSet::coordinates_, ParticleSet::DistTables, and ParticleSet::structure_factor_.

Referenced by CostFunctionCrowdData::CostFunctionCrowdData(), VirtualParticleSet::createResource(), QMCDriverNew::initializeQMC(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_DiracDeterminantBatched_delayed_update(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), and qmcplusplus::testElecCase().

945 {
946  coordinates_->createResource(collection);
947  for (int i = 0; i < DistTables.size(); i++)
948  DistTables[i]->createResource(collection);
949  if (structure_factor_)
950  collection.addResource(std::make_unique<SKMultiWalkerMem>());
951 }
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ createSK()

void createSK ( )

create Structure Factor with PBCs

Creating StructureFactor.

Currently testing only 1 component for PBCs.

Definition at line 29 of file ParticleSet.BC.cpp.

References SpeciesSet::addAttribute(), qmcplusplus::app_log(), ParticleSet::convert2Cart(), ParticleSet::coordinates_, CrystalLattice< T, D >::explicitly_defined, SimulationCell::getKLists(), ParticleSet::getLattice(), ParticleSet::getLRBox(), OhmmsElementBase::getName(), SpeciesSet::getTotalNum(), ParticleSet::GroupID, ParticleSet::Mass, ParticleSet::my_species_, SpeciesSet::numAttributes(), ParticleSet::R, ParticleSet::simulation_cell_, Vector< T, Alloc >::size(), ParticleSet::structure_factor_, qmcplusplus::SUPERCELL_OPEN, and CrystalLattice< T, D >::SuperCellEnum.

Referenced by qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::doSOECPotentialTest(), XMLParticleParser::readXML(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

30 {
32  throw std::runtime_error("Report bug! structure_factor_ has already been created. Unexpected call sequence.");
33 
34  auto& Lattice = getLattice();
35  auto& LRBox = getLRBox();
36  if (Lattice.explicitly_defined)
37  convert2Cart(R); //make sure that R is in Cartesian coordinates
38 
39  if (Lattice.SuperCellEnum != SUPERCELL_OPEN)
40  {
41  app_log() << "\n Creating Structure Factor for periodic systems " << LRBox.LR_kc << std::endl;
42  structure_factor_ = std::make_unique<StructFact>(LRBox, simulation_cell_.getKLists());
43  }
44 
45  //set the mass array
46  int beforemass = my_species_.numAttributes();
47  int massind = my_species_.addAttribute("mass");
48  if (beforemass == massind)
49  {
50  app_log() << " ParticleSet::createSK setting mass of " << getName() << " to 1.0" << std::endl;
51  for (int ig = 0; ig < my_species_.getTotalNum(); ++ig)
52  my_species_(massind, ig) = 1.0;
53  }
54  for (int iat = 0; iat < GroupID.size(); iat++)
55  Mass[iat] = my_species_(massind, GroupID[iat]);
56 
57  coordinates_->setAllParticlePos(R);
58 }
int numAttributes() const
return the number of attributes in our list
Definition: SpeciesSet.h:59
const auto & getLRBox() const
Definition: ParticleSet.h:253
const std::string & getName() const
return the name
const KContainer & getKLists() const
access k_lists_ read only
std::ostream & app_log()
Definition: OutputManager.h:65
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
Definition: SpeciesSet.cpp:45
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
int getTotalNum() const
return the number of species
Definition: SpeciesSet.h:55
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
size_type size() const
return the current size
Definition: OhmmsVector.h:162
void convert2Cart(const ParticlePos &pin, ParticlePos &pout)
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87
const auto & getLattice() const
Definition: ParticleSet.h:251
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ donePbyP()

void donePbyP ( bool  skipSK = false)

update structure factor and unmark active_ptcl_

Parameters
skipSK update if skipSK is true

The Coulomb interaction evaluation needs the structure factor. For these reason, call donePbyP after the loop of single electron moves before evaluating the Hamiltonian. Unmark active_ptcl_ is more of a safety measure probably not needed.

Definition at line 769 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, ParticleSet::myTimers, qmcplusplus::PS_donePbyP, and ParticleSet::structure_factor_.

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), NonLocalECPotential::makeNonLocalMovesPbyP(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), and qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST().

770 {
771  ScopedTimer donePbyP_scope(myTimers[PS_donePbyP]);
772  coordinates_->donePbyP();
773  if (!skipSK && structure_factor_)
774  structure_factor_->updateAllPart(*this);
775  for (size_t i = 0; i < DistTables.size(); ++i)
776  DistTables[i]->finalizePbyP(*this);
777  active_ptcl_ = -1;
778 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ extractCoordsRefList()

RefVectorWithLeader< DynamicCoordinates > extractCoordsRefList ( const RefVectorWithLeader< ParticleSet > &  p_list)
static

Definition at line 984 of file ParticleSet.cpp.

References RefVectorWithLeader< T >::getLeader().

Referenced by ParticleSet::acquireResource(), ParticleSet::mw_accept_rejectMove(), ParticleSet::mw_computeNewPosDistTables(), and ParticleSet::releaseResource().

986 {
987  RefVectorWithLeader<DynamicCoordinates> coords_list(*p_list.getLeader().coordinates_);
988  coords_list.reserve(p_list.size());
989  for (ParticleSet& p : p_list)
990  coords_list.push_back(*p.coordinates_);
991  return coords_list;
992 }
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ extractDTRefList()

RefVectorWithLeader< DistanceTable > extractDTRefList ( const RefVectorWithLeader< ParticleSet > &  p_list,
int  id 
)
static

Definition at line 975 of file ParticleSet.cpp.

References RefVectorWithLeader< T >::getLeader().

Referenced by ParticleSet::acquireResource(), ParticleSet::mw_accept_rejectMove(), ParticleSet::mw_computeNewPosDistTables(), ParticleSet::mw_donePbyP(), ParticleSet::mw_loadWalker(), ParticleSet::mw_update(), and ParticleSet::releaseResource().

976 {
977  RefVectorWithLeader<DistanceTable> dt_list(*p_list.getLeader().DistTables[id]);
978  dt_list.reserve(p_list.size());
979  for (ParticleSet& p : p_list)
980  dt_list.push_back(*p.DistTables[id]);
981  return dt_list;
982 }
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ extractSKRefList()

RefVectorWithLeader< StructFact > extractSKRefList ( const RefVectorWithLeader< ParticleSet > &  p_list)
static

Definition at line 994 of file ParticleSet.cpp.

References RefVectorWithLeader< T >::getLeader().

Referenced by ParticleSet::mw_donePbyP().

995 {
996  RefVectorWithLeader<StructFact> sk_list(*p_list.getLeader().structure_factor_);
997  sk_list.reserve(p_list.size());
998  for (ParticleSet& p : p_list)
999  sk_list.push_back(*p.structure_factor_);
1000  return sk_list;
1001 }
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ first()

int first ( int  igroup) const
inline

return the first index of a group i

Definition at line 514 of file ParticleSet.h.

References ParticleSet::group_offsets_.

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), ParticleSet::applyBC(), JeeIOrbitalSoA< FT >::build_compact_list(), AGPDeterminantBuilder::buildComponent(), RadialJastrowBuilder::computeJ2uk(), TwoBodyJastrow< FT >::computeU(), J1OrbitalSoA< FT >::computeU(), J1Spin< FT >::computeU(), TwoBodyJastrow< FT >::computeU3(), J1OrbitalSoA< FT >::computeU3(), J1Spin< FT >::computeU3(), AGPDeterminantBuilder::createAGP(), QMCGaussianParserBase::createElectronSet(), RadialJastrowBuilder::createJ2(), SlaterDetBuilder::createMSDFast(), XMLSaveParticle::createNode(), PWOrbitalSetBuilder::createPW(), NonLocalECPotential::evalIonDerivsImpl(), BareKineticEnergy::evaluate(), Backflow_ee< FT >::evaluate(), BareKineticEnergy::evaluate_orig(), BareKineticEnergy::evaluate_sp(), RotatedSPOs::evaluateDerivatives(), RotatedSPOs::evaluateDerivativesWF(), NonLocalECPotential::evaluateImpl(), QMCHamiltonian::evaluateIonDerivsDeterministicFast(), NonLocalECPotential::evaluateOneBodyOpMatrix(), BareKineticEnergy::evaluateOneBodyOpMatrix(), NonLocalECPComponent::evaluateOneBodyOpMatrixContribution(), NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(), NonLocalECPotential::evaluateOneBodyOpMatrixForceDeriv(), BareKineticEnergy::evaluateOneBodyOpMatrixForceDeriv(), TwoBodyJastrow< FT >::evaluateRatiosAlltoOne(), J1Spin< FT >::evaluateRatiosAlltoOne(), JeeIOrbitalSoA< FT >::evaluateRatiosAlltoOne(), J1OrbitalSoA< FT >::evaluateRatiosAlltoOne(), Backflow_ee< FT >::evaluateWithDerivatives(), BareKineticEnergy::evaluateWithIonDerivs(), TWFFastDerivWrapper::getEGradELaplM(), TWFFastDerivWrapper::getIonGradIonGradELaplM(), TWFFastDerivWrapper::getIonGradM(), TWFFastDerivWrapper::getM(), InitMolecularSystem::initMolecule(), J1OrbitalSoA< FT >::J1OrbitalSoA(), J2KECorrection< RealType, FT >::J2KECorrection(), LatticeDeviationEstimator::LatticeDeviationEstimator(), NonLocalECPotential::makeNonLocalMovesPbyP(), MCPopulation::MCPopulation(), PairCorrEstimator::PairCorrEstimator(), SlaterDetBuilder::putDeterminant(), ParticleSet::randomizeFromSource(), TwoBodyJastrow< FT >::recompute(), RPABFeeBreakup< T >::reset(), MCWalkerConfiguration::saveEnsemble(), QMCUpdateBase::setDefaults(), and TwoBodyJastrow< FT >::TwoBodyJastrow().

514 { return (*group_offsets_)[igroup]; }
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ get()

◆ get_group_offsets()

auto& get_group_offsets ( ) const
inline

Definition at line 568 of file ParticleSet.h.

References ParticleSet::group_offsets_.

568 { return *group_offsets_; }
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ get_map_storage_to_input()

const std::vector<int>& get_map_storage_to_input ( ) const
inline

Definition at line 564 of file ParticleSet.h.

References ParticleSet::map_storage_to_input_.

564 { return map_storage_to_input_; }
std::vector< int > map_storage_to_input_
Map storage index to the input index.
Definition: ParticleSet.h:611

◆ getActivePos()

◆ getActivePtcl()

◆ getActiveSpinVal()

Scalar_t getActiveSpinVal ( ) const
inline

Definition at line 262 of file ParticleSet.h.

References ParticleSet::active_spin_val_.

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), and SOVMCUpdatePbyP::advanceWalker().

262 { return active_spin_val_; }
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603

◆ getCoordinates()

◆ getDistTable()

auto& getDistTable ( int  table_ID) const
inline

get a distance table by table_ID

Definition at line 190 of file ParticleSet.h.

References ParticleSet::DistTables.

Referenced by CoulombPBCAA::CoulombPBCAA(), PairCorrEstimator::PairCorrEstimator(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), CoulombPBCAA::resetTargetParticleSet(), qmcplusplus::TEST_CASE(), and VirtualParticleSet::VirtualParticleSet().

190 { return *DistTables[table_ID]; }
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ getDistTableAA()

const DistanceTableAA & getDistTableAA ( int  table_ID) const

get a distance table by table_ID and dyanmic_cast to DistanceTableAA

Definition at line 339 of file ParticleSet.cpp.

References ParticleSet::DistTables.

Referenced by TwoBodyJastrow< FT >::acceptMove(), JeeIOrbitalSoA< FT >::acceptMove(), CoulombPotential< T >::checkoutParticleQuantities(), ExampleHeComponent::evalGrad(), MPC::evalSR(), CoulombPBCAA::evalSRwithForces(), PairCorrEstimator::evaluate(), Backflow_ee< FT >::evaluate(), CoulombPotential< T >::evaluate(), ForceCeperley::evaluate_IonIon(), CoulombPBCAA::evaluate_sp(), ExampleHeComponent::evaluateDerivatives(), JeeIOrbitalSoA< FT >::evaluateDerivatives(), TwoBodyJastrow< FT >::evaluateDerivativesWF(), JeeIOrbitalSoA< FT >::evaluateDerivativesWF(), TwoBodyJastrow< FT >::evaluateDerivRatios(), JeeIOrbitalSoA< FT >::evaluateDerivRatios(), TwoBodyJastrow< FT >::evaluateHessian(), ExampleHeComponent::evaluateLog(), BackflowTransformation::evaluatePbyP(), Backflow_ee< FT >::evaluatePbyP(), BackflowTransformation::evaluatePbyPAll(), BackflowTransformation::evaluatePbyPWithGrad(), TwoBodyJastrow< FT >::evaluateRatiosAlltoOne(), JeeIOrbitalSoA< FT >::evaluateRatiosAlltoOne(), ForceChiesaPBCAA::evaluateSR_AA(), StressPBC::evaluateSR_AA(), Backflow_ee< FT >::evaluateWithDerivatives(), InitMolecularSystem::initMolecule(), ExampleHeComponent::ratio(), TwoBodyJastrow< FT >::ratio(), JeeIOrbitalSoA< FT >::ratio(), ExampleHeComponent::ratioGrad(), TwoBodyJastrow< FT >::ratioGrad(), JeeIOrbitalSoA< FT >::ratioGrad(), TwoBodyJastrow< FT >::recompute(), JeeIOrbitalSoA< FT >::recompute(), qmcplusplus::TEST_CASE(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), and BackflowTransformation::testPbyP().

340 {
341  return dynamic_cast<DistanceTableAA&>(*DistTables[table_ID]);
342 }
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ getDistTableAB()

const DistanceTableAB & getDistTableAB ( int  table_ID) const

get a distance table by table_ID and dyanmic_cast to DistanceTableAB

Definition at line 344 of file ParticleSet.cpp.

References ParticleSet::DistTables.

Referenced by JeeIOrbitalSoA< FT >::acceptMove(), J1OrbitalSoA< FT >::acceptMove(), J1Spin< FT >::acceptMove(), JeeIOrbitalSoA< FT >::build_compact_list(), NonLocalECPotential::computeOneElectronTxy(), SpaceWarpTransformation::computeSWTIntermediates(), ExampleHeComponent::evalGrad(), LatticeGaussianProduct::evalGrad(), J1Spin< FT >::evalGradSource(), J1OrbitalSoA< FT >::evalGradSource(), NonLocalECPotential::evalIonDerivsImpl(), CoulombPBCAB::evalSR(), CoulombPBCAB::evalSRwithForces(), BareForce::evaluate(), EnergyDensityEstimator::evaluate(), PairCorrEstimator::evaluate(), ForceCeperley::evaluate(), LatticeDeviationEstimator::evaluate(), LocalECPotential::evaluate(), L2Potential::evaluate(), Backflow_eI< FT >::evaluate(), CoulombPotential< T >::evaluate(), LocalECPotential::evaluate_orig(), LocalECPotential::evaluate_sp(), CoulombPBCAB::evaluate_sp(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_v(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_vgh(), SoaCuspCorrection::evaluate_vgl(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_vgl(), L2Potential::evaluateD(), ExampleHeComponent::evaluateDerivatives(), J1Spin< FT >::evaluateDerivativesWF(), J1OrbitalSoA< FT >::evaluateDerivativesWF(), TwoBodyJastrow< FT >::evaluateDerivRatios(), J1OrbitalSoA< FT >::evaluateDerivRatios(), JeeIOrbitalSoA< FT >::evaluateDerivRatios(), L2Potential::evaluateDK(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceV(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceVGL(), J1Spin< FT >::evaluateHessian(), J1OrbitalSoA< FT >::evaluateHessian(), SOECPotential::evaluateImpl(), NonLocalECPotential::evaluateImpl(), ExampleHeComponent::evaluateLog(), LatticeGaussianProduct::evaluateLog(), LatticeGaussianProduct::evaluateLogAndStore(), NonLocalECPotential::evaluateOneBodyOpMatrix(), NonLocalECPotential::evaluateOneBodyOpMatrixForceDeriv(), Backflow_eI< FT >::evaluatePbyP(), TwoBodyJastrow< FT >::evaluateRatios(), J1Spin< FT >::evaluateRatios(), J1OrbitalSoA< FT >::evaluateRatios(), JeeIOrbitalSoA< FT >::evaluateRatios(), J1Spin< FT >::evaluateRatiosAlltoOne(), JeeIOrbitalSoA< FT >::evaluateRatiosAlltoOne(), J1OrbitalSoA< FT >::evaluateRatiosAlltoOne(), ForceChiesaPBCAA::evaluateSR(), StressPBC::evaluateSR_AB(), SoaCuspCorrection::evaluateV(), SoaLocalizedBasisSet< COT, ORBT >::evaluateV(), SOECPotential::evaluateValueAndDerivatives(), NonLocalECPotential::evaluateValueAndDerivatives(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluateValuesC2X(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluateValuesR2R(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGH(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGHGH(), SoaCuspCorrection::evaluateVGL(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGL(), Backflow_eI< FT >::evaluateWithDerivatives(), LocalECPotential::evaluateWithIonDerivs(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::is_VP_batching_safe(), NonLocalECPotential::makeNonLocalMovesPbyP(), ExampleHeComponent::ratio(), LatticeGaussianProduct::ratio(), J1Spin< FT >::ratio(), J1OrbitalSoA< FT >::ratio(), JeeIOrbitalSoA< FT >::ratio(), ExampleHeComponent::ratioGrad(), LatticeGaussianProduct::ratioGrad(), JeeIOrbitalSoA< FT >::ratioGrad(), J1Spin< FT >::ratioGrad(), J1OrbitalSoA< FT >::ratioGrad(), J1Spin< FT >::recompute(), J1OrbitalSoA< FT >::recompute(), JeeIOrbitalSoA< FT >::recompute(), qmcplusplus::TEST_CASE(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

345 {
346  return dynamic_cast<DistanceTableAB&>(*DistTables[table_ID]);
347 }
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ getGroupID()

◆ getLattice()

const auto& getLattice ( ) const
inline

Definition at line 251 of file ParticleSet.h.

References SimulationCell::getLattice(), and ParticleSet::simulation_cell_.

Referenced by BackflowBuilder::addOneBody(), BackflowBuilder::addRPA(), BackflowBuilder::addTwoBody(), ParticleSet::applyBC(), ParticleSet::applyMinimumImage(), LRRPABFeeHandlerTemp< Func, BreakupBasis >::Breakup(), LRRPAHandlerTemp< Func, BreakupBasis >::Breakup(), RPAJastrow::buildOrbital(), BsplineReader::check_twists(), EinsplineSetBuilder::CheckLattice(), MPC::compute_g_G(), RadialJastrowBuilder::computeJ2uk(), ParticleSet::convert(), ParticleSet::convert2Cart(), ParticleSet::convert2Unit(), CoulombPBCAA::CoulombPBCAA(), qmcplusplus::createDistanceTableAB(), qmcplusplus::createDistanceTableABOMPTarget(), RadialJastrowBuilder::createJ1(), RadialJastrowBuilder::createJ2(), PWOrbitalSetBuilder::createPWBasis(), ParticleSet::createSK(), FreeOrbitalBuilder::createSPOSetFromXML(), DensityEstimator::DensityEstimator(), MPC::evalLR(), EnergyDensityEstimator::evaluate(), DensityEstimator::evaluate(), GridExternalPotential::evaluate(), StressPBC::evaluate(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceV(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceVGL(), SoaLocalizedBasisSet< COT, ORBT >::evaluateV(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGH(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGHGH(), SoaLocalizedBasisSet< COT, ORBT >::evaluateVGL(), EwaldHandler2D::EwaldHandler2D(), EwaldHandler3D::EwaldHandler3D(), EwaldHandlerQuasi2D::EwaldHandlerQuasi2D(), XMLSaveParticle::get(), QMCFiniteSize::getSkInfo(), QMCFiniteSize::getSkSpline(), RadialJastrowBuilder::guardAgainstOBC(), RadialJastrowBuilder::guardAgainstPBC(), HamiltonianFactory::HamiltonianFactory(), MPC::init_f_G(), MPC::init_gvecs(), MPC::init_spline(), EwaldHandler3D::initBreakup(), QMCFiniteSize::initBreakup(), LRRPAHandlerTemp< Func, BreakupBasis >::initBreakup(), LRRPABFeeHandlerTemp< Func, BreakupBasis >::initBreakup(), CoulombPBCAA::initBreakup(), DummyLRHandler< Func >::initBreakup(), CoulombPBCAB::initBreakup(), QMCFiniteSize::initialize(), InitMolecularSystem::initMolecule(), RadialJastrowBuilder::initTwoBodyFunctor(), InitMolecularSystem::initWithVolume(), kSpaceJastrow::kSpaceJastrow(), RPAJastrow::makeLongRange(), PairCorrEstimator::PairCorrEstimator(), Pressure::Pressure(), NEReferencePoints::processParticleSets(), ReferencePoints::put(), EnergyDensityEstimator::put(), SpinDensity::put(), ECPotentialBuilder::put(), OrbitalImages::put(), eeI_JastrowBuilder::putkids(), MomentumEstimator::putSpecial(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), XMLParticleParser::readXML(), YukawaBreakup< T >::reset(), DerivRPABreakup< T >::reset(), RPABreakup< T >::reset(), DerivYukawaBreakup< T >::reset(), EPRPABreakup< T >::reset(), derivEPRPABreakup< T >::reset(), RPABFeeBreakup< T >::reset(), QMCUpdateBase::resetRun(), Pressure::resetTargetParticleSet(), EnergyDensityEstimator::set_ptcl(), kSpaceJastrow::setupGvecs(), QMCFiniteSize::sphericalAvgSk(), SpinDensity::SpinDensity(), StaticStructureFactor::StaticStructureFactor(), StressPBC::StressPBC(), SpinDensity::test(), qmcplusplus::TEST_CASE(), and OrbitalImages::write_orbital_xsf().

251 { return simulation_cell_.getLattice(); }
const Lattice & getLattice() const
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ getLRBox()

◆ getNumDistTables()

int getNumDistTables ( ) const
inline

Definition at line 566 of file ParticleSet.h.

References ParticleSet::DistTables.

Referenced by NonLocalECPComponent::NonLocalECPComponent(), PairCorrEstimator::PairCorrEstimator(), and VirtualParticleSet::VirtualParticleSet().

566 { return DistTables.size(); }
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ getPerParticleSKState()

bool getPerParticleSKState ( ) const

Get state (on/off) of per particle storage in Structure Factor.

Definition at line 69 of file ParticleSet.BC.cpp.

References ParticleSet::structure_factor_.

70 {
71  bool isPerParticleOn = false;
73  isPerParticleOn = structure_factor_->isStorePerParticle();
74  return isPerParticleOn;
75 }
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617

◆ getPrimitiveLattice()

auto& getPrimitiveLattice ( ) const
inline

Definition at line 252 of file ParticleSet.h.

References SimulationCell::getPrimLattice(), and ParticleSet::simulation_cell_.

Referenced by EinsplineSetBuilder::TileIons().

252 { return const_cast<ParticleLayout&>(simulation_cell_.getPrimLattice()); }
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
Definition: Configuration.h:79
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587
const Lattice & getPrimLattice() const

◆ getPropertyBase() [1/4]

FullPrecRealType* restrict getPropertyBase ( )
inline

return the address of the values of Hamiltonian terms

Definition at line 470 of file ParticleSet.h.

References ConstantSizeMatrix< T, ALLOC >::data(), and ParticleSet::Properties.

Referenced by RMCUpdateAllWithDrift::advanceWalkersRMC(), and RMCUpdateAllWithDrift::advanceWalkersVMC().

470 { return Properties.data(); }
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119

◆ getPropertyBase() [2/4]

const FullPrecRealType* restrict getPropertyBase ( ) const
inline

return the address of the values of Hamiltonian terms

Definition at line 473 of file ParticleSet.h.

References ConstantSizeMatrix< T, ALLOC >::data(), and ParticleSet::Properties.

473 { return Properties.data(); }
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119

◆ getPropertyBase() [3/4]

FullPrecRealType* restrict getPropertyBase ( int  i)
inline

return the address of the i-th properties

Definition at line 476 of file ParticleSet.h.

References ParticleSet::Properties.

476 { return Properties[i]; }
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119

◆ getPropertyBase() [4/4]

const FullPrecRealType* restrict getPropertyBase ( int  i) const
inline

return the address of the i-th properties

Definition at line 479 of file ParticleSet.h.

References ParticleSet::Properties.

479 { return Properties[i]; }
PropertyContainer_t Properties
properties of the current walker
Definition: ParticleSet.h:119

◆ getSimulationCell()

const auto& getSimulationCell ( ) const
inline

Definition at line 250 of file ParticleSet.h.

References ParticleSet::simulation_cell_.

Referenced by BackflowBuilder::addRPA(), LRRPABFeeHandlerTemp< Func, BreakupBasis >::Breakup(), LRRPAHandlerTemp< Func, BreakupBasis >::Breakup(), LRHandlerTemp< Func, BreakupBasis >::Breakup(), LRHandlerSRCoulomb< Func, BreakupBasis >::Breakup(), RPAJastrow::buildOrbital(), RadialJastrowBuilder::computeJ2uk(), CoulombPBCAB::evalLR(), CoulombPBCAB::evaluate_sp(), CoulombPBCAA::evaluate_sp(), SkAllEstimator::evaluateIonIon(), StressPBC::evaluateLR_AA(), StressPBC::evaluateLR_AB(), EwaldHandler2D::EwaldHandler2D(), EwaldHandlerQuasi2D::EwaldHandlerQuasi2D(), SkPot::FillFk(), EwaldHandler3D::initBreakup(), LRRPABFeeHandlerTemp< Func, BreakupBasis >::initBreakup(), LRRPAHandlerTemp< Func, BreakupBasis >::initBreakup(), LRHandlerTemp< Func, BreakupBasis >::initBreakup(), LRHandlerSRCoulomb< Func, BreakupBasis >::initBreakup(), DummyLRHandler< Func >::initBreakup(), QMCFiniteSize::initialize(), Backflow_ee_kSpace::initialize(), J2KECorrection< RealType, FT >::J2KECorrection(), LRRPABFeeHandlerTemp< Func, BreakupBasis >::LRRPABFeeHandlerTemp(), LRRPAHandlerTemp< Func, BreakupBasis >::LRRPAHandlerTemp(), BackflowBuilder::makeLongRange_twoBody(), StaticStructureFactor::put(), SkEstimator::registerCollectables(), SkAllEstimator::registerCollectables(), StaticStructureFactor::registerCollectables(), SkAllEstimator::SkAllEstimator(), SkEstimator::SkEstimator(), SkPot::SkPot(), and qmcplusplus::TEST_CASE().

250 { return simulation_cell_; }
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ getSK()

◆ getSpeciesSet() [1/2]

SpeciesSet& getSpeciesSet ( )
inline

retrun the SpeciesSet of this particle set

Definition at line 231 of file ParticleSet.h.

References ParticleSet::my_species_.

Referenced by BackflowBuilder::addOneBody(), BackflowBuilder::addTwoBody(), BareKineticEnergy::BareKineticEnergy(), eeI_JastrowBuilder::buildComponent(), RadialJastrowBuilder::buildComponent(), XMLParticleParser::checkGrouping(), qmcplusplus::create_C_pbc_particlesets(), LCAOrbitalBuilder::createBasisSet(), LCAOrbitalBuilder::createBasisSetH5(), CountingJastrowBuilder::createCJ(), QMCGaussianParserBase::createElectronSet(), QMCGaussianParserBase::createIonSet(), RadialJastrowBuilder::createJ1(), QMCGaussianParserBase::createJ1(), RadialJastrowBuilder::createJ2(), QMCGaussianParserBase::createJ3(), XMLSaveParticle::createNode(), qmcplusplus::doSOECPotentialTest(), StressPBC::evalConsts_AA(), StressPBC::evaluateLR_AA(), qmcplusplus::generateCuspInfo(), qmcplusplus::get_two_species_particleset(), DiracParser::getGaussianCenters(), GaussianFCHKParser::getGeometry(), LCAOHDFParser::getGeometry(), QPParser::getGeometry(), GamesAsciiParser::getGeometry(), DiracParser::getGeometry(), JeeIOrbitalSoA< FT >::init(), ForceChiesaPBCAA::initBreakup(), StressPBC::initBreakup(), CoulombPBCAA::initBreakup(), CoulombPBCAB::initBreakup(), DensityMatrices1B::initialize(), J1OrbitalSoA< FT >::initialize(), InitMolecularSystem::initMolecule(), L2Potential::L2Potential(), LocalECPotential::LocalECPotential(), BackflowBuilder::makeLongRange_twoBody(), BackflowBuilder::makeShortRange_twoBody(), NonLocalECPotential::NonLocalECPotential(), RMGParser::parse(), ECPotentialBuilder::put(), SlaterDetBuilder::putDeterminant(), eeI_JastrowBuilder::putkids(), QMCGaussianParserBase::QMCGaussianParserBase(), ParticleSet::randomizeFromSource(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), XMLParticleParser::readXML(), XMLParticleParser::reset(), XMLSaveParticle::reset(), EnergyDensityEstimator::set_ptcl(), QMCUpdateBase::setDefaults(), qmcplusplus::setup_He_wavefunction(), SkAllEstimator::SkAllEstimator(), SkEstimator::SkEstimator(), SkPot::SkPot(), SoaLocalizedBasisSet< COT, ORBT >::SoaLocalizedBasisSet(), SOECPotential::SOECPotential(), SpeciesKineticEnergy::SpeciesKineticEnergy(), SpinDensity::SpinDensity(), StaticStructureFactor::StaticStructureFactor(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), qmcplusplus::testElecCase(), qmcplusplus::testTrialWaveFunction_diamondC_2x1x1(), ECPotentialBuilder::useSimpleTableFormat(), and ECPotentialBuilder::useXmlFormat().

231 { return my_species_; }
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614

◆ getSpeciesSet() [2/2]

const SpeciesSet& getSpeciesSet ( ) const
inline

retrun the const SpeciesSet of this particle set

Definition at line 233 of file ParticleSet.h.

References ParticleSet::my_species_.

233 { return my_species_; }
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614

◆ getTotalNum()

size_t getTotalNum ( ) const
inline

Definition at line 493 of file ParticleSet.h.

References ParticleSet::TotalNum.

Referenced by ACForce::ACForce(), HamiltonianFactory::addCoulombPotential(), ACForce::addObservables(), BackflowBuilder::addOneBody(), BackflowBuilder::addRPA(), BackflowFunctionBase::BackflowFunctionBase(), BackflowTransformation::BackflowTransformation(), LRRPAHandlerTemp< Func, BreakupBasis >::Breakup(), LatticeGaussianProductBuilder::buildComponent(), RPAJastrow::buildOrbital(), DistanceTable::centers(), WaveFunctionTester::checkGradientAtConfiguration(), TraceManager::checkout_complex(), TraceManager::checkout_int(), TraceManager::checkout_real(), StructFact::computeRhok(), CountingGaussianRegion::CountingGaussianRegion(), CountingJastrow< RegionType >::CountingJastrow(), XMLSaveParticle::createNode(), PWOrbitalSetBuilder::createPWBasis(), LCAOrbitalBuilder::createSPOSetFromXML(), MCPopulation::createWalkers(), DiracDeterminantWithBackflow::DiracDeterminantWithBackflow(), qmcplusplus::doSOECPotentialTest(), DiracDeterminantWithBackflow::dummyEvalLi(), CoulombPBCAB::evalConsts(), StressPBC::evalConsts_AA(), StressPBC::evalConsts_AB(), kSpaceJastrow::evalGrad(), JeeIOrbitalSoA< FT >::evalGradSource(), NonLocalECPotential::evalIonDerivsImpl(), CoulombPBCAA::evalLRwithForces(), CoulombPBCAB::evalLRwithForces(), CoulombPBCAB::evalPerParticleConsts(), MomentumEstimator::evaluate(), SpeciesKineticEnergy::evaluate(), DensityEstimator::evaluate(), EnergyDensityEstimator::evaluate(), GridExternalPotential::evaluate(), LatticeDeviationEstimator::evaluate(), HarmonicExternalPotential::evaluate(), ACForce::evaluate(), LocalECPotential::evaluate(), L2Potential::evaluate(), Backflow_eI< FT >::evaluate(), DensityMatrices1B::evaluate_loop(), SpinorSet::evaluate_notranspose(), SpinorSet::evaluate_notranspose_spin(), LocalECPotential::evaluate_orig(), GridExternalPotential::evaluate_sp(), LocalECPotential::evaluate_sp(), HarmonicExternalPotential::evaluate_sp(), BareKineticEnergy::evaluate_sp(), CoulombPBCAB::evaluate_sp(), DiracDeterminantWithBackflow::evaluateDerivatives(), RotatedSPOs::evaluateDerivatives(), MultiSlaterDetTableMethod::evaluateDerivatives(), kSpaceJastrow::evaluateDerivatives(), J1Spin< FT >::evaluateDerivativesWF(), J1OrbitalSoA< FT >::evaluateDerivativesWF(), QMCHamiltonian::evaluateElecGrad(), SpinorSet::evaluateGradSource(), SlaterDet::evaluateHessian(), TrialWaveFunction::evaluateHessian(), SOECPotential::evaluateImpl(), NonLocalECPotential::evaluateImpl(), QMCHamiltonian::evaluateIonDerivs(), QMCHamiltonian::evaluateIonDerivsDeterministic(), QMCHamiltonian::evaluateIonDerivsDeterministicFast(), StressPBC::evaluateKineticSymTensor(), DiracDeterminantWithBackflow::evaluateLog(), kSpaceJastrow::evaluateLog(), ForceChiesaPBCAA::evaluateLR(), ForceChiesaPBCAA::evaluateLR_AA(), NonLocalECPotential::evaluateOneBodyOpMatrix(), BareKineticEnergy::evaluateOneBodyOpMatrix(), NonLocalECPotential::evaluateOneBodyOpMatrixForceDeriv(), BareKineticEnergy::evaluateOneBodyOpMatrixForceDeriv(), NonLocalECPComponent::evaluateOneWithForces(), kSpaceJastrow::evaluateRatiosAlltoOne(), WaveFunctionComponent::evaluateRatiosAlltoOne(), SOECPotential::evaluateValueAndDerivatives(), NonLocalECPotential::evaluateValueAndDerivatives(), Backflow_eI< FT >::evaluateWithDerivatives(), LocalECPotential::evaluateWithIonDerivs(), BareKineticEnergy::evaluateWithIonDerivs(), QMCMain::executeCMCSection(), FiniteDifference::finiteDifferencePoints(), XMLSaveParticle::get(), QMCCostFunction::getConfigurations(), QMCCostFunctionBatched::getConfigurations(), JeeIOrbitalSoA< FT >::init(), InitMolecularSystem::initAtom(), MPC::initBreakup(), ForceChiesaPBCAA::initBreakup(), StressPBC::initBreakup(), CoulombPBCAA::initBreakup(), CoulombPBCAB::initBreakup(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), QMCFiniteSize::initialize(), DensityMatrices1B::initialize(), InitMolecularSystem::initMolecule(), SFNBranch::initParam(), QMCUpdateBase::initWalkersForPbyP(), InitMolecularSystem::initWithVolume(), kSpaceJastrow::kSpaceJastrow(), L2Potential::L2Potential(), LatticeGaussianProduct::LatticeGaussianProduct(), LocalECPotential::LocalECPotential(), QMCUpdateBase::logBackwardGF(), NonLocalECPotential::makeNonLocalMovesPbyP(), MCPopulation::MCPopulation(), MomentumEstimator::MomentumEstimator(), MultiSlaterDetTableMethod::MultiSlaterDetTableMethod(), NonLocalECPotential::NonLocalECPotential(), PairCorrEstimator::PairCorrEstimator(), ParticleSet::ParticleSet(), WaveFunctionTester::printEloc(), QMCDriver::process(), ReferencePoints::put(), EnergyDensityEstimator::put(), ParticleSetPool::put(), MomentumEstimator::putSpecial(), QMCDriver::putWalkers(), QMCDriverNew::putWalkers(), ParticleSet::randomizeFromSource(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), XMLParticleParser::readXML(), WaveFunctionComponent::recompute(), DiracDeterminantWithBackflow::registerData(), YukawaBreakup< T >::reset(), DerivRPABreakup< T >::reset(), RPABreakup< T >::reset(), DerivYukawaBreakup< T >::reset(), EPRPABreakup< T >::reset(), derivEPRPABreakup< T >::reset(), RPABFeeBreakup< T >::reset(), QMCUpdateBase::resetRun(), DMCBatched::run(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runRatioV(), WaveFunctionTester::runZeroVarianceTest(), MCPopulation::saveWalkerConfigurations(), EnergyDensityEstimator::set_ptcl(), QMCUpdateBase::setDefaults(), ACForce::setObservables(), ACForce::setParticlePropertyList(), SkAllEstimator::SkAllEstimator(), SkEstimator::SkEstimator(), SkPot::SkPot(), SoaCuspCorrection::SoaCuspCorrection(), SoaLocalizedBasisSet< COT, ORBT >::SoaLocalizedBasisSet(), SOECPotential::SOECPotential(), kSpaceJastrow::StructureFactor(), SpinDensity::test(), qmcplusplus::TEST_CASE(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), SlaterDetWithBackflow::testDerivGL(), DiracDeterminantWithBackflow::testGG(), DiracDeterminantWithBackflow::testGGG(), DiracDeterminantWithBackflow::testL(), EinsplineSetBuilder::TileIons(), WaveFunctionTester::WaveFunctionTester(), and OrbitalImages::write_orbital_xsf().

493 { return TotalNum; }
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642

◆ getTwist()

const SingleParticlePos& getTwist ( ) const
inline

Definition at line 482 of file ParticleSet.h.

References ParticleSet::myTwist.

Referenced by MomentumEstimator::MomentumEstimator().

482 { return myTwist; }
SingleParticlePos myTwist
Definition: ParticleSet.h:637

◆ groups()

int groups ( ) const
inline

return the number of groups

Definition at line 511 of file ParticleSet.h.

References ParticleSet::group_offsets_.

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), Backflow_ee< FT >::Backflow_ee(), Backflow_ee_kSpace::Backflow_ee_kSpace(), Backflow_eI_spin< FT >::Backflow_eI_spin(), AGPDeterminantBuilder::buildComponent(), SlaterDetBuilder::buildComponent(), RadialJastrowBuilder::computeJ2uk(), StructFact::computeRhok(), AGPDeterminantBuilder::createAGP(), SlaterDetBuilder::createMSDFast(), XMLSaveParticle::createNode(), EinsplineSetBuilder::EinsplineSetBuilder(), NonLocalECPotential::evalIonDerivsImpl(), TwoBodyJastrow< FT >::evaluateDerivativesWF(), TwoBodyJastrow< FT >::evaluateDerivRatios(), NonLocalECPotential::evaluateImpl(), NonLocalECPotential::evaluateOneBodyOpMatrix(), BareKineticEnergy::evaluateOneBodyOpMatrix(), NonLocalECPotential::evaluateOneBodyOpMatrixForceDeriv(), BareKineticEnergy::evaluateOneBodyOpMatrixForceDeriv(), JeeIOrbitalSoA< FT >::init(), InitMolecularSystem::initMolecule(), NonLocalECPotential::makeNonLocalMovesPbyP(), MCPopulation::MCPopulation(), MultiSlaterDetTableMethod::MultiSlaterDetTableMethod(), NonLocalECPotential::NonLocalECPotential(), PairCorrEstimator::PairCorrEstimator(), ParticleSetPool::put(), RPABFeeBreakup< T >::reset(), QMCUpdateBase::setDefaults(), SlaterDet::SlaterDet(), SlaterDetWithBackflow::SlaterDetWithBackflow(), SOECPotential::SOECPotential(), and qmcplusplus::TEST_CASE().

511 { return group_offsets_->size() - 1; }
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ groupsize()

int groupsize ( int  igroup) const
inline

return the size of a group

Definition at line 527 of file ParticleSet.h.

References ParticleSet::group_offsets_.

Referenced by SlaterDetBuilder::createMSDFast(), StressPBC::evalConsts_AA(), StressPBC::evaluateLR_AA(), StressPBC::initBreakup(), CoulombPBCAA::initBreakup(), CoulombPBCAB::initBreakup(), DensityMatrices1B::initialize(), NonLocalECPotential::NonLocalECPotential(), ParticleSet::resetGroups(), SOECPotential::SOECPotential(), and SpinDensity::SpinDensity().

527 { return (*group_offsets_)[igroup + 1] - (*group_offsets_)[igroup]; }
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ hasSK()

bool hasSK ( ) const
inline

Definition at line 212 of file ParticleSet.h.

References ParticleSet::structure_factor_.

Referenced by EnergyDensityEstimator::put().

212 { return bool(structure_factor_); }
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617

◆ initPropertyList()

void initPropertyList ( )

Definition at line 879 of file ParticleSet.cpp.

References RecordNamedProperty< T >::add(), RecordNamedProperty< T >::clear(), and ParticleSet::PropertyList.

Referenced by ParticleSet::ParticleSet().

880 {
882  //Need to add the default Properties according to the enumeration
883  PropertyList.add("LogPsi");
884  PropertyList.add("SignPsi");
885  PropertyList.add("UmbrellaWeight");
886  PropertyList.add("R2Accepted");
887  PropertyList.add("R2Proposed");
888  PropertyList.add("DriftScale");
889  PropertyList.add("AltEnergy");
890  PropertyList.add("LocalEnergy");
891  PropertyList.add("LocalPotential");
892 
893  // There is no point in checking this, its quickly not consistent as other objects update property list.
894  // if (PropertyList.size() != WP::NUMPROPERTIES)
895  // {
896  // app_error() << "The number of default properties for walkers is not consistent." << std::endl;
897  // app_error() << "NUMPROPERTIES " << WP::NUMPROPERTIES << " size of PropertyList " << PropertyList.size() << std::endl;
898  // throw std::runtime_error("ParticleSet::initPropertyList");
899  // }
900 }
PropertySetType PropertyList
name-value map of Walker Properties
Definition: ParticleSet.h:112
int add(const std::string &aname)

◆ is_classical()

bool is_classical ( ) const
inline

Definition at line 171 of file ParticleSet.h.

References ParticleSet::classical, and ParticleSet::quantum_domain.

Referenced by OperatorBase::oneBodyQuantumDomain(), and OperatorBase::twoBodyQuantumDomain().

171 { return quantum_domain == classical; }
quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73

◆ is_quantum()

bool is_quantum ( ) const
inline

Definition at line 173 of file ParticleSet.h.

References ParticleSet::quantum, and ParticleSet::quantum_domain.

Referenced by OperatorBase::oneBodyQuantumDomain(), and OperatorBase::twoBodyQuantumDomain().

173 { return quantum_domain == quantum; }
quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73

◆ isSameMass()

bool isSameMass ( ) const
inline

Definition at line 255 of file ParticleSet.h.

References ParticleSet::same_mass_.

Referenced by qmcplusplus::parse_electron_ion_pbc_z(), and qmcplusplus::TEST_CASE().

255 { return same_mass_; }
bool same_mass_
true if the particles have the same mass
Definition: ParticleSet.h:590

◆ isSpinor()

◆ last()

int last ( int  igroup) const
inline

return the last index of a group i

Definition at line 517 of file ParticleSet.h.

References ParticleSet::group_offsets_.

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), ParticleSet::applyBC(), Backflow_eI_spin< FT >::Backflow_eI_spin(), JeeIOrbitalSoA< FT >::build_compact_list(), RadialJastrowBuilder::computeJ2uk(), TwoBodyJastrow< FT >::computeU(), J1OrbitalSoA< FT >::computeU(), J1Spin< FT >::computeU(), TwoBodyJastrow< FT >::computeU3(), J1OrbitalSoA< FT >::computeU3(), J1Spin< FT >::computeU3(), QMCGaussianParserBase::createElectronSet(), RadialJastrowBuilder::createJ2(), XMLSaveParticle::createNode(), PWOrbitalSetBuilder::createPW(), PWOrbitalSetBuilder::createPWBasis(), NonLocalECPotential::evalIonDerivsImpl(), BareKineticEnergy::evaluate(), Backflow_ee< FT >::evaluate(), BareKineticEnergy::evaluate_orig(), BareKineticEnergy::evaluate_sp(), RotatedSPOs::evaluateDerivatives(), RotatedSPOs::evaluateDerivativesWF(), NonLocalECPotential::evaluateImpl(), QMCHamiltonian::evaluateIonDerivsDeterministicFast(), NonLocalECPotential::evaluateOneBodyOpMatrix(), BareKineticEnergy::evaluateOneBodyOpMatrix(), NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(), NonLocalECPotential::evaluateOneBodyOpMatrixForceDeriv(), BareKineticEnergy::evaluateOneBodyOpMatrixForceDeriv(), TwoBodyJastrow< FT >::evaluateRatiosAlltoOne(), J1Spin< FT >::evaluateRatiosAlltoOne(), JeeIOrbitalSoA< FT >::evaluateRatiosAlltoOne(), J1OrbitalSoA< FT >::evaluateRatiosAlltoOne(), Backflow_ee< FT >::evaluateWithDerivatives(), BareKineticEnergy::evaluateWithIonDerivs(), TWFFastDerivWrapper::getEGradELaplM(), TWFFastDerivWrapper::getIonGradIonGradELaplM(), TWFFastDerivWrapper::getIonGradM(), TWFFastDerivWrapper::getM(), InitMolecularSystem::initMolecule(), J1OrbitalSoA< FT >::J1OrbitalSoA(), J2KECorrection< RealType, FT >::J2KECorrection(), LatticeDeviationEstimator::LatticeDeviationEstimator(), NonLocalECPotential::makeNonLocalMovesPbyP(), MCPopulation::MCPopulation(), MultiSlaterDetTableMethod::MultiSlaterDetTableMethod(), PairCorrEstimator::PairCorrEstimator(), SlaterDetBuilder::putDeterminant(), TwoBodyJastrow< FT >::recompute(), RPABFeeBreakup< T >::reset(), MCWalkerConfiguration::saveEnsemble(), QMCUpdateBase::setDefaults(), SlaterDet::SlaterDet(), and TwoBodyJastrow< FT >::TwoBodyJastrow().

517 { return (*group_offsets_)[igroup + 1]; }
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645

◆ loadWalker()

void loadWalker ( Walker_t awalker,
bool  pbyp 
)

load a Walker_t to the current ParticleSet

Parameters
awalkerthe reference to the walker to be loaded
pbyptrue if it is used by PbyP update

PbyP requires the distance tables and Sk with awalker.R

Definition at line 813 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), ParticleSet::G, ParticleSet::L, Walker< t_traits, p_traits >::L, ParticleSet::myTimers, qmcplusplus::NEED_FULL_TABLE_ANYTIME, qmcplusplus::PS_loadWalker, ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::spins, and Walker< t_traits, p_traits >::spins.

Referenced by SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), SODMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdateAll::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), WaveFunctionTester::checkGradientAtConfiguration(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), and WaveFunctionTester::runRatioTest2().

814 {
815  ScopedTimer update_scope(myTimers[PS_loadWalker]);
816  R = awalker.R;
817  spins = awalker.spins;
818  coordinates_->setAllParticlePos(R);
819 #if !defined(SOA_MEMORY_OPTIMIZED)
820  G = awalker.G;
821  L = awalker.L;
822 #endif
823  if (pbyp)
824  {
825  // in certain cases, full tables must be ready
826  for (int i = 0; i < DistTables.size(); i++)
827  if (DistTables[i]->getModes() & DTModes::NEED_FULL_TABLE_ANYTIME)
828  DistTables[i]->evaluate(*this);
829  }
830 
831  active_ptcl_ = -1;
832 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
whether full table needs to be ready at anytime or not during PbyP Optimization can be implemented du...
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ makeMove()

void makeMove ( Index_t  iat,
const SingleParticlePos displ,
bool  maybe_accept = true 
)

move the iat-th particle to active_pos_

Parameters
iatthe index of the particle to be moved
displthe displacement of the iat-th particle position
maybe_acceptif false, the caller guarantees that the proposed move will not be accepted.

Update active_ptcl_ index and active_pos_ position (R[iat]+displ) for a proposed move. Evaluate the related distance table data DistanceTable::Temp. If maybe_accept = false, certain operations for accepting moves will be skipped for optimal performance.

Definition at line 382 of file ParticleSet.cpp.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, ParticleSet::active_spin_val_, ParticleSet::computeNewPosDistTables(), ParticleSet::R, and ParticleSet::spins.

Referenced by WaveFunctionTester::checkGradientAtConfiguration(), OrbitalImages::evaluate(), DensityMatrices1B::evaluate_check(), NonLocalECPComponent::evaluateOne(), NonLocalECPComponent::evaluateOneBodyOpMatrixContribution(), NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(), NonLocalECPComponent::evaluateOneWithForces(), NonLocalECPComponent::evaluateValueAndDerivatives(), DensityMatrices1B::integrate(), ParticleSet::makeMoveWithSpin(), NonLocalECPComponent::mw_evaluateOne(), OneMolecularOrbital::phi(), OneMolecularOrbital::phi_vgl(), DiracDeterminantWithBackflow::ratio(), DiracDeterminantWithBackflow::ratioGrad(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), SPOSetScanner::scan_path(), qmcplusplus::TEST_CASE(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_He_mw(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), BackflowTransformation::testPbyP(), DensityMatrices1B::update_basis(), and DensityMatrices1B::update_basis_d012().

383 {
384  active_ptcl_ = iat;
385  active_pos_ = R[iat] + displ;
386  active_spin_val_ = spins[iat];
387  computeNewPosDistTables(iat, active_pos_, maybe_accept);
388 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
ParticlePos R
Position.
Definition: ParticleSet.h:79
void computeNewPosDistTables(Index_t iat, const SingleParticlePos &newpos, bool maybe_accept=true)
compute temporal DistTables and SK for a new particle position
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601

◆ makeMoveAllParticles() [1/2]

bool makeMoveAllParticles ( const Walker_t awalker,
const ParticlePos deltaR,
RealType  dt 
)

move all the particles of a walker

Parameters
awalkerthe walker to operate
deltaRproposed displacement
dtfactor of deltaR
Returns
true if all the moves are legal.

If big displacements or illegal positions are detected, return false. If all good, R = awalker.R + dt* deltaR

Definition at line 495 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), CrystalLattice< T, D >::explicitly_defined, SimulationCell::getLattice(), CrystalLattice< T, D >::isValid(), CrystalLattice< T, D >::outOfBound(), ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::simulation_cell_, ParticleSet::structure_factor_, and CrystalLattice< T, D >::toUnit().

Referenced by SOVMCUpdateAll::advanceWalker(), VMCUpdateAll::advanceWalker(), and CSVMCUpdateAll::advanceWalker().

496 {
497  active_ptcl_ = -1;
499  if (Lattice.explicitly_defined)
500  {
501  for (int iat = 0; iat < deltaR.size(); ++iat)
502  {
503  SingleParticlePos displ(dt * deltaR[iat]);
504  if (Lattice.outOfBound(Lattice.toUnit(displ)))
505  return false;
506  SingleParticlePos newpos(awalker.R[iat] + displ);
507  if (!Lattice.isValid(Lattice.toUnit(newpos)))
508  return false;
509  R[iat] = newpos;
510  }
511  }
512  else
513  {
514  for (int iat = 0; iat < deltaR.size(); ++iat)
515  R[iat] = awalker.R[iat] + dt * deltaR[iat];
516  }
517  coordinates_->setAllParticlePos(R);
518  for (int i = 0; i < DistTables.size(); i++)
519  DistTables[i]->evaluate(*this);
520  if (structure_factor_)
521  structure_factor_->updateAllPart(*this);
522  //every move is valid
523  return true;
524 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
const Lattice & getLattice() const
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ makeMoveAllParticles() [2/2]

bool makeMoveAllParticles ( const Walker_t awalker,
const ParticlePos deltaR,
const std::vector< RealType > &  dt 
)

Definition at line 526 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), CrystalLattice< T, D >::explicitly_defined, SimulationCell::getLattice(), CrystalLattice< T, D >::isValid(), CrystalLattice< T, D >::outOfBound(), ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::simulation_cell_, ParticleSet::structure_factor_, and CrystalLattice< T, D >::toUnit().

529 {
530  active_ptcl_ = -1;
532  if (Lattice.explicitly_defined)
533  {
534  for (int iat = 0; iat < deltaR.size(); ++iat)
535  {
536  SingleParticlePos displ(dt[iat] * deltaR[iat]);
537  if (Lattice.outOfBound(Lattice.toUnit(displ)))
538  return false;
539  SingleParticlePos newpos(awalker.R[iat] + displ);
540  if (!Lattice.isValid(Lattice.toUnit(newpos)))
541  return false;
542  R[iat] = newpos;
543  }
544  }
545  else
546  {
547  for (int iat = 0; iat < deltaR.size(); ++iat)
548  R[iat] = awalker.R[iat] + dt[iat] * deltaR[iat];
549  }
550  coordinates_->setAllParticlePos(R);
551  for (int i = 0; i < DistTables.size(); i++)
552  DistTables[i]->evaluate(*this);
553  if (structure_factor_)
554  structure_factor_->updateAllPart(*this);
555  //every move is valid
556  return true;
557 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
const Lattice & getLattice() const
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ makeMoveAllParticlesWithDrift() [1/2]

bool makeMoveAllParticlesWithDrift ( const Walker_t awalker,
const ParticlePos drift,
const ParticlePos deltaR,
RealType  dt 
)

move all the particles including the drift

move a walker by dt*deltaR + drift

Otherwise, everything is the same as makeMove for a walker

Parameters
awalkerinitial walker configuration
driftdrift vector
deltaRrandom displacement
dttimestep
Returns
true, if all the particle moves are legal under the boundary conditions

Definition at line 566 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), CrystalLattice< T, D >::explicitly_defined, SimulationCell::getLattice(), CrystalLattice< T, D >::isValid(), CrystalLattice< T, D >::outOfBound(), ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::simulation_cell_, ParticleSet::structure_factor_, and CrystalLattice< T, D >::toUnit().

Referenced by DMCUpdateAllWithRejection::advanceWalker(), VMCUpdateAll::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdateAllWithDrift::advanceWalkersRMC(), and RMCUpdateAllWithDrift::advanceWalkersVMC().

570 {
571  active_ptcl_ = -1;
573  if (Lattice.explicitly_defined)
574  {
575  for (int iat = 0; iat < deltaR.size(); ++iat)
576  {
577  SingleParticlePos displ(dt * deltaR[iat] + drift[iat]);
578  if (Lattice.outOfBound(Lattice.toUnit(displ)))
579  return false;
580  SingleParticlePos newpos(awalker.R[iat] + displ);
581  if (!Lattice.isValid(Lattice.toUnit(newpos)))
582  return false;
583  R[iat] = newpos;
584  }
585  }
586  else
587  {
588  for (int iat = 0; iat < deltaR.size(); ++iat)
589  R[iat] = awalker.R[iat] + dt * deltaR[iat] + drift[iat];
590  }
591  coordinates_->setAllParticlePos(R);
592  for (int i = 0; i < DistTables.size(); i++)
593  DistTables[i]->evaluate(*this);
594  if (structure_factor_)
595  structure_factor_->updateAllPart(*this);
596  //every move is valid
597  return true;
598 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
const Lattice & getLattice() const
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ makeMoveAllParticlesWithDrift() [2/2]

bool makeMoveAllParticlesWithDrift ( const Walker_t awalker,
const ParticlePos drift,
const ParticlePos deltaR,
const std::vector< RealType > &  dt 
)

Definition at line 600 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), CrystalLattice< T, D >::explicitly_defined, SimulationCell::getLattice(), CrystalLattice< T, D >::isValid(), CrystalLattice< T, D >::outOfBound(), ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::simulation_cell_, ParticleSet::structure_factor_, and CrystalLattice< T, D >::toUnit().

604 {
605  active_ptcl_ = -1;
607  if (Lattice.explicitly_defined)
608  {
609  for (int iat = 0; iat < deltaR.size(); ++iat)
610  {
611  SingleParticlePos displ(dt[iat] * deltaR[iat] + drift[iat]);
612  if (Lattice.outOfBound(Lattice.toUnit(displ)))
613  return false;
614  SingleParticlePos newpos(awalker.R[iat] + displ);
615  if (!Lattice.isValid(Lattice.toUnit(newpos)))
616  return false;
617  R[iat] = newpos;
618  }
619  }
620  else
621  {
622  for (int iat = 0; iat < deltaR.size(); ++iat)
623  R[iat] = awalker.R[iat] + dt[iat] * deltaR[iat] + drift[iat];
624  }
625  coordinates_->setAllParticlePos(R);
626 
627  for (int i = 0; i < DistTables.size(); i++)
628  DistTables[i]->evaluate(*this);
629  if (structure_factor_)
630  structure_factor_->updateAllPart(*this);
631  //every move is valid
632  return true;
633 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
const Lattice & getLattice() const
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ makeMoveAndCheck()

bool makeMoveAndCheck ( Index_t  iat,
const SingleParticlePos displ 
)

move the iat-th particle to active_pos_

Parameters
iatthe index of the particle to be moved
displrandom displacement of the iat-th particle
Returns
true, if the move is valid

Update active_ptcl_ index and active_pos_ position (R[iat]+displ) for a proposed move. Evaluate the related distance table data DistanceTable::Temp.

When a Lattice is defined, passing two checks makes a move valid. outOfBound(displ): invalid move, if displ is larger than half, currently, of the box in any direction isValid(Lattice.toUnit(active_pos_)): invalid move, if active_pos_ goes out of the Lattice in any direction marked with open BC. Note: active_pos_ and distances tables are always evaluated no matter the move is valid or not.

Definition at line 429 of file ParticleSet.cpp.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, ParticleSet::active_spin_val_, ParticleSet::computeNewPosDistTables(), CrystalLattice< T, D >::explicitly_defined, SimulationCell::getLattice(), CrystalLattice< T, D >::isValid(), CrystalLattice< T, D >::outOfBound(), ParticleSet::R, ParticleSet::simulation_cell_, ParticleSet::spins, and CrystalLattice< T, D >::toUnit().

Referenced by DMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), ParticleSet::makeMoveAndCheckWithSpin(), NonLocalECPotential::makeNonLocalMovesPbyP(), and qmcplusplus::TEST_CASE().

430 {
431  active_ptcl_ = iat;
432  active_pos_ = R[iat] + displ;
433  active_spin_val_ = spins[iat];
434  bool is_valid = true;
436  if (Lattice.explicitly_defined)
437  {
438  if (Lattice.outOfBound(Lattice.toUnit(displ)))
439  is_valid = false;
440  else
441  {
442  SingleParticlePos newRedPos = Lattice.toUnit(active_pos_);
443  if (!Lattice.isValid(newRedPos))
444  is_valid = false;
445  }
446  }
448  return is_valid;
449 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
const Lattice & getLattice() const
ParticlePos R
Position.
Definition: ParticleSet.h:79
void computeNewPosDistTables(Index_t iat, const SingleParticlePos &newpos, bool maybe_accept=true)
compute temporal DistTables and SK for a new particle position
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601
const SimulationCell & simulation_cell_
reference to global simulation cell
Definition: ParticleSet.h:587

◆ makeMoveAndCheckWithSpin()

bool makeMoveAndCheckWithSpin ( Index_t  iat,
const SingleParticlePos displ,
const Scalar_t sdispl 
)

makeMoveAndCheck, but now includes an update to the spin variable

Definition at line 451 of file ParticleSet.cpp.

References ParticleSet::active_spin_val_, and ParticleSet::makeMoveAndCheck().

Referenced by SODMCUpdatePbyPWithRejectionFast::advanceWalker(), and SOVMCUpdatePbyP::advanceWalker().

452 {
453  bool is_valid = makeMoveAndCheck(iat, displ);
454  active_spin_val_ += sdispl;
455  return is_valid;
456 }
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
bool makeMoveAndCheck(Index_t iat, const SingleParticlePos &displ)
move the iat-th particle to active_pos_

◆ makeMoveWithSpin()

void makeMoveWithSpin ( Index_t  iat,
const SingleParticlePos displ,
const Scalar_t sdispl 
)

makeMove, but now includes an update to the spin variable

Definition at line 390 of file ParticleSet.cpp.

References ParticleSet::active_spin_val_, and ParticleSet::makeMove().

Referenced by SOECPComponent::evaluateOne(), SOECPComponent::evaluateValueAndDerivatives(), and SOECPComponent::mw_evaluateOne().

391 {
392  makeMove(iat, displ);
393  active_spin_val_ += sdispl;
394 }
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603
void makeMove(Index_t iat, const SingleParticlePos &displ, bool maybe_accept=true)
move the iat-th particle to active_pos_

◆ makeVirtualMoves()

void makeVirtualMoves ( const SingleParticlePos newpos)

Handles virtual moves for all the particles to a single newpos.

The state active_ptcl_ remains -1 and rejectMove is not needed. acceptMove can not be used. See QMCHamiltonians::MomentumEstimator as an example

Definition at line 805 of file ParticleSet.cpp.

References ParticleSet::active_pos_, ParticleSet::active_ptcl_, and ParticleSet::DistTables.

Referenced by MomentumEstimator::evaluate(), DensityMatrices1B::generate_sample_ratios(), qmcplusplus::TEST_CASE(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_J1_spline(), and qmcplusplus::test_J3_polynomial3D().

806 {
807  active_ptcl_ = -1;
808  active_pos_ = newpos;
809  for (size_t i = 0; i < DistTables.size(); ++i)
810  DistTables[i]->move(*this, newpos, active_ptcl_, false);
811 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ mw_accept_rejectMove() [1/2]

void mw_accept_rejectMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
Index_t  iat,
const std::vector< bool > &  isAccepted,
bool  forward_mode = true 
)
static

batched version of acceptMove and rejectMove fused, templated on CoordsType

Definition at line 703 of file ParticleSet.cpp.

References ParticleSet::mw_accept_rejectSpinMove(), and qmcplusplus::POS_SPIN.

Referenced by qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

707 {
708  if constexpr (CT == CoordsType::POS_SPIN)
709  mw_accept_rejectSpinMove(p_list, iat, isAccepted);
710  mw_accept_rejectMove(p_list, iat, isAccepted, forward_mode);
711 }
static void mw_accept_rejectSpinMove(const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< bool > &isAccepted)
batched version of acceptMove and reject Move fused, but only for spins
static void mw_accept_rejectMove(const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< bool > &isAccepted, bool forward_mode=true)
batched version of acceptMove and rejectMove fused, templated on CoordsType

◆ mw_accept_rejectMove() [2/2]

void mw_accept_rejectMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
Index_t  iat,
const std::vector< bool > &  isAccepted,
bool  forward_mode = true 
)
static

batched version of acceptMove and rejectMove fused

Definition at line 714 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, ParticleSet::extractCoordsRefList(), ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), ParticleSet::myTimers, qmcplusplus::PS_accept, qmcplusplus::pset, and ParticleSet::R.

718 {
719  if (forward_mode)
720  {
721  ParticleSet& p_leader = p_list.getLeader();
722  ScopedTimer update_scope(p_leader.myTimers[PS_accept]);
723 
724  const auto coords_list(extractCoordsRefList(p_list));
725  std::vector<SingleParticlePos> new_positions;
726  new_positions.reserve(p_list.size());
727  for (const ParticleSet& pset : p_list)
728  new_positions.push_back(pset.active_pos_);
729  p_leader.coordinates_->mw_acceptParticlePos(coords_list, iat, new_positions, isAccepted);
730 
731  auto& dts = p_leader.DistTables;
732  for (int i = 0; i < dts.size(); ++i)
733  {
734  const auto dt_list(extractDTRefList(p_list, i));
735  dts[i]->mw_updatePartial(dt_list, iat, isAccepted);
736  }
737 
738  for (int iw = 0; iw < p_list.size(); iw++)
739  {
740  assert(iat == p_list[iw].active_ptcl_);
741  if (isAccepted[iw])
742  p_list[iw].R[iat] = p_list[iw].active_pos_;
743  p_list[iw].active_ptcl_ = -1;
744  assert(p_list[iw].R[iat] == p_list[iw].coordinates_->getAllParticlePos()[iat]);
745  }
746  }
747  else
748  {
749  // loop over single walker acceptMove/rejectMove doesn't work safely.
750  // need to code carefully for both coordinate and distance table updates
751  // disable non-forward mode cases
752  if (!forward_mode)
753  throw std::runtime_error("BUG calling mw_accept_rejectMove in non-forward mode");
754  }
755 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
static RefVectorWithLeader< DynamicCoordinates > extractCoordsRefList(const RefVectorWithLeader< ParticleSet > &p_list)

◆ mw_accept_rejectSpinMove()

void mw_accept_rejectSpinMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
Index_t  iat,
const std::vector< bool > &  isAccepted 
)
static

batched version of acceptMove and reject Move fused, but only for spins

note: should be called BEFORE mw_accept_rejectMove since the active_ptcl_ gets reset to -1 This would cause the assertion that we have the right particle index to fail if done in the wrong order

Definition at line 757 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_.

Referenced by ParticleSet::mw_accept_rejectMove().

760 {
761  for (int iw = 0; iw < p_list.size(); iw++)
762  {
763  assert(iat == p_list[iw].active_ptcl_);
764  if (isAccepted[iw])
765  p_list[iw].spins[iat] = p_list[iw].active_spin_val_;
766  }
767 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599

◆ mw_computeNewPosDistTables()

void mw_computeNewPosDistTables ( const RefVectorWithLeader< ParticleSet > &  p_list,
Index_t  iat,
const std::vector< SingleParticlePos > &  new_positions,
bool  maybe_accept = true 
)
staticprotected

compute temporal DistTables and SK for a new particle position for each walker in a batch

Parameters
p_listthe list of wrapped ParticleSet references in a walker batch
iatthe particle that is moved on a sphere
new_positionsnew particle positions
maybe_acceptif false, the caller guarantees that the proposed move will not be accepted.

Definition at line 466 of file ParticleSet.cpp.

References ParticleSet::coordinates_, ParticleSet::DistTables, ParticleSet::extractCoordsRefList(), ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), ParticleSet::myTimers, qmcplusplus::PS_dt_move, qmcplusplus::PS_mw_copy, and qmcplusplus::PS_newpos.

Referenced by ParticleSet::mw_makeMove().

470 {
471  ParticleSet& p_leader = p_list.getLeader();
472  ScopedTimer compute_newpos_scope(p_leader.myTimers[PS_newpos]);
473 
474  {
475  ScopedTimer copy_scope(p_leader.myTimers[PS_mw_copy]);
476  const auto coords_list(extractCoordsRefList(p_list));
477  p_leader.coordinates_->mw_copyActivePos(coords_list, iat, new_positions);
478  }
479 
480  {
481  ScopedTimer dt_scope(p_leader.myTimers[PS_dt_move]);
482  const int dist_tables_size = p_leader.DistTables.size();
483  for (int i = 0; i < dist_tables_size; ++i)
484  {
485  const auto dt_list(extractDTRefList(p_list, i));
486  p_leader.DistTables[i]->mw_move(dt_list, p_list, new_positions, iat, maybe_accept);
487  }
488 
489  // DistTables mw_move calls are asynchronous. Wait for them before return.
490  PRAGMA_OFFLOAD("omp taskwait")
491  }
492 }
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58
static RefVectorWithLeader< DynamicCoordinates > extractCoordsRefList(const RefVectorWithLeader< ParticleSet > &p_list)

◆ mw_donePbyP()

void mw_donePbyP ( const RefVectorWithLeader< ParticleSet > &  p_list,
bool  skipSK = false 
)
static

batched version of donePbyP

Definition at line 780 of file ParticleSet.cpp.

References ParticleSet::DistTables, ParticleSet::extractDTRefList(), ParticleSet::extractSKRefList(), RefVectorWithLeader< T >::getLeader(), ParticleSet::mw_structure_factor_data_handle_, StructFact::mw_updateAllPart(), ParticleSet::myTimers, qmcplusplus::PS_donePbyP, qmcplusplus::pset, and ParticleSet::structure_factor_.

Referenced by PSdispatcher::flex_donePbyP(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), and qmcplusplus::test_distance_pbc_z_batched_APIs().

781 {
782  ParticleSet& p_leader = p_list.getLeader();
783  ScopedTimer donePbyP_scope(p_leader.myTimers[PS_donePbyP]);
784 
785  for (ParticleSet& pset : p_list)
786  {
787  pset.coordinates_->donePbyP();
788  pset.active_ptcl_ = -1;
789  }
790 
791  if (!skipSK && p_leader.structure_factor_)
792  {
793  auto sk_list = extractSKRefList(p_list);
794  StructFact::mw_updateAllPart(sk_list, p_list, p_leader.mw_structure_factor_data_handle_);
795  }
796 
797  auto& dts = p_leader.DistTables;
798  for (int i = 0; i < dts.size(); ++i)
799  {
800  const auto dt_list(extractDTRefList(p_list, i));
801  dts[i]->mw_finalizePbyP(dt_list, p_list);
802  }
803 }
static RefVectorWithLeader< StructFact > extractSKRefList(const RefVectorWithLeader< ParticleSet > &p_list)
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
static void mw_updateAllPart(const RefVectorWithLeader< StructFact > &sk_list, const RefVectorWithLeader< ParticleSet > &p_list, SKMultiWalkerMem &mw_mem)
Update RhoK for all particles for multiple walkers particles.
Definition: StructFact.cpp:63
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ mw_loadWalker()

void mw_loadWalker ( const RefVectorWithLeader< ParticleSet > &  p_list,
const RefVector< Walker_t > &  walkers,
const std::vector< bool > &  recompute,
bool  pbyp 
)
static

batched version of loadWalker

Definition at line 834 of file ParticleSet.cpp.

References ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), qmcplusplus::PS_loadWalker, qmcplusplus::pset, and qmcplusplus::hdf::walkers.

Referenced by PSdispatcher::flex_loadWalker().

838 {
839  auto& p_leader = p_list.getLeader();
840  ScopedTimer load_scope(p_leader.myTimers[PS_loadWalker]);
841 
842  auto loadWalkerConfig = [](ParticleSet& pset, Walker_t& awalker) {
843  pset.R = awalker.R;
844  pset.spins = awalker.spins;
845  pset.coordinates_->setAllParticlePos(pset.R);
846  };
847  for (int iw = 0; iw < p_list.size(); ++iw)
848  if (recompute[iw])
849  loadWalkerConfig(p_list[iw], walkers[iw]);
850 
851  if (pbyp)
852  {
853  auto& dts = p_leader.DistTables;
854  for (int i = 0; i < dts.size(); ++i)
855  {
856  const auto dt_list(extractDTRefList(p_list, i));
857  dts[i]->mw_recompute(dt_list, p_list, recompute);
858  }
859  }
860 }
Walker< QMCTraits, PtclOnLatticeTraits > Walker_t
walker type
Definition: ParticleSet.h:59
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
const char walkers[]
Definition: HDFVersion.h:36
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ mw_makeMove() [1/2]

void mw_makeMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
int  iat,
const MCCoords< CT > &  displs 
)
static

batched version of makeMove

Definition at line 397 of file ParticleSet.cpp.

References ParticleSet::mw_makeSpinMove(), and qmcplusplus::POS_SPIN.

Referenced by PSdispatcher::flex_makeMove(), qmcplusplus::TEST_CASE(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

398 {
399  mw_makeMove(p_list, iat, displs.positions);
400  if constexpr (CT == CoordsType::POS_SPIN)
401  mw_makeSpinMove(p_list, iat, displs.spins);
402 }
static void mw_makeMove(const RefVectorWithLeader< ParticleSet > &p_list, int iat, const MCCoords< CT > &displs)
batched version of makeMove
static void mw_makeSpinMove(const RefVectorWithLeader< ParticleSet > &p_list, int iat, const std::vector< Scalar_t > &sdispls)
batched version makeMove for spin variable only

◆ mw_makeMove() [2/2]

void mw_makeMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
int  iat,
const std::vector< SingleParticlePos > &  displs 
)
static

Definition at line 404 of file ParticleSet.cpp.

References ParticleSet::active_pos_, and ParticleSet::mw_computeNewPosDistTables().

407 {
408  std::vector<SingleParticlePos> new_positions;
409  new_positions.reserve(displs.size());
410 
411  for (int iw = 0; iw < p_list.size(); iw++)
412  {
413  p_list[iw].active_ptcl_ = iat;
414  p_list[iw].active_pos_ = p_list[iw].R[iat] + displs[iw];
415  new_positions.push_back(p_list[iw].active_pos_);
416  }
417 
418  mw_computeNewPosDistTables(p_list, iat, new_positions);
419 }
static void mw_computeNewPosDistTables(const RefVectorWithLeader< ParticleSet > &p_list, Index_t iat, const std::vector< SingleParticlePos > &new_positions, bool maybe_accept=true)
compute temporal DistTables and SK for a new particle position for each walker in a batch ...
SingleParticlePos active_pos_
the proposed position of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:601

◆ mw_makeSpinMove()

void mw_makeSpinMove ( const RefVectorWithLeader< ParticleSet > &  p_list,
int  iat,
const std::vector< Scalar_t > &  sdispls 
)
static

batched version makeMove for spin variable only

Definition at line 421 of file ParticleSet.cpp.

References ParticleSet::active_spin_val_, and ParticleSet::spins.

Referenced by ParticleSet::mw_makeMove().

424 {
425  for (int iw = 0; iw < p_list.size(); iw++)
426  p_list[iw].active_spin_val_ = p_list[iw].spins[iat] + sdispls[iw];
427 }
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
Scalar_t active_spin_val_
the proposed spin of active_ptcl_ during particle-by-particle moves
Definition: ParticleSet.h:603

◆ mw_saveWalker()

void mw_saveWalker ( const RefVectorWithLeader< ParticleSet > &  psets,
const RefVector< Walker_t > &  walkers 
)
static

batched version of saveWalker

just the R, G, and L

Definition at line 872 of file ParticleSet.cpp.

References ParticleSet::saveWalker(), and qmcplusplus::hdf::walkers.

Referenced by PSdispatcher::flex_saveWalker().

873 {
874  for (int iw = 0; iw < psets.size(); ++iw)
875  psets[iw].saveWalker(walkers[iw]);
876 }
const char walkers[]
Definition: HDFVersion.h:36
void saveWalker(Walker_t &awalker)
save this to awalker

◆ mw_update()

void mw_update ( const RefVectorWithLeader< ParticleSet > &  p_list,
bool  skipSK = false 
)
static

batched version of update

Definition at line 362 of file ParticleSet.cpp.

References ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), qmcplusplus::PS_update, qmcplusplus::pset, and ParticleSet::structure_factor_.

Referenced by QMCCostFunctionBatched::checkConfigurations(), QMCCostFunctionBatched::correlatedSampling(), qmcplusplus::doSOECPotentialTest(), PSdispatcher::flex_update(), VirtualParticleSet::mw_makeMoves(), VirtualParticleSet::mw_makeMovesWithSpin(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_DiracDeterminantBatched_delayed_update(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

363 {
364  auto& p_leader = p_list.getLeader();
365  ScopedTimer update_scope(p_leader.myTimers[PS_update]);
366 
367  for (ParticleSet& pset : p_list)
368  pset.coordinates_->setAllParticlePos(pset.R);
369 
370  auto& dts = p_leader.DistTables;
371  for (int i = 0; i < dts.size(); ++i)
372  {
373  const auto dt_list(extractDTRefList(p_list, i));
374  dts[i]->mw_evaluate(dt_list, p_list);
375  }
376 
377  if (!skipSK && p_leader.structure_factor_)
378  for (int iw = 0; iw < p_list.size(); iw++)
379  p_list[iw].structure_factor_->updateAllPart(p_list[iw]);
380 }
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
ParticleSet(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
Definition: ParticleSet.cpp:58

◆ parentName()

◆ print()

void print ( std::ostream &  os,
const size_t  maxParticlesToPrint = 0 
) const

print particle coordinates to a std::ostream

Parameters
osoutput stream
maxParticlesToPrintmaximal number of particles to print. Pass 0 to print all.

Definition at line 275 of file ParticleSet.cpp.

References ParticleSet::distTableDescriptions, OhmmsElementBase::getName(), ParticleSet::group_offsets_, ParticleSet::GroupID, omptarget::min(), ParticleSet::my_species_, ParticleSet::R, SpeciesSet::speciesName, and ParticleSet::TotalNum.

Referenced by qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), and qmcplusplus::test_LCAO_DiamondC_2x1x1_real().

276 {
277  os << " ParticleSet '" << getName() << "' contains " << TotalNum << " particles : ";
278  if (auto& group_offsets(*group_offsets_); group_offsets.size() > 0)
279  for (int i = 0; i < group_offsets.size() - 1; i++)
280  os << " " << my_species_.speciesName[i] << "(" << group_offsets[i + 1] - group_offsets[i] << ")";
281  os << std::endl << std::endl;
282 
283  const size_t numToPrint = maxParticlesToPrint == 0 ? TotalNum : std::min(TotalNum, maxParticlesToPrint);
284 
285  for (int i = 0; i < numToPrint; i++)
286  {
287  os << " " << my_species_.speciesName[GroupID[i]] << R[i] << std::endl;
288  }
289  if (numToPrint < TotalNum)
290  {
291  os << " (... and " << (TotalNum - numToPrint) << " more particle positions ...)" << std::endl;
292  }
293  os << std::endl;
294 
295  for (const std::string& description : distTableDescriptions)
296  os << description;
297  os << std::endl;
298 }
const std::string & getName() const
return the name
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
T min(T a, T b)
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::vector< std::string > distTableDescriptions
Descriptions from distance table creation. Same order as DistTables.
Definition: ParticleSet.h:633
std::vector< std::string > speciesName
Species name list.
Definition: SpeciesSet.h:44
std::shared_ptr< Vector< int, OMPallocator< int > > > group_offsets_
array to handle a group of distinct particles per species
Definition: ParticleSet.h:645
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614

◆ put() [1/2]

bool put ( std::istream &  is)
overridevirtual

dummy. For satisfying OhmmsElementBase.

Implements OhmmsElementBase.

Definition at line 301 of file ParticleSet.cpp.

301 { return true; }

◆ put() [2/2]

bool put ( xmlNodePtr  cur)
overridevirtual

initialize ParticleSet from xmlNode

read the particleset

Implements OhmmsElementBase.

Definition at line 305 of file ParticleSet.cpp.

305 { return true; }

◆ quantumDomainValid() [1/2]

bool quantumDomainValid ( quantum_domains  qdomain) const
inline

check whether quantum domain is valid for particles

Definition at line 176 of file ParticleSet.h.

References ParticleSet::no_quantum_domain.

◆ quantumDomainValid() [2/2]

bool quantumDomainValid ( ) const
inline

check whether quantum domain is valid for particles

Definition at line 179 of file ParticleSet.h.

References ParticleSet::quantum_domain, and ParticleSet::quantumDomainValid().

Referenced by ParticleSet::quantumDomainValid(), and ParticleSet::setQuantumDomain().

quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73
bool quantumDomainValid() const
check whether quantum domain is valid for particles
Definition: ParticleSet.h:179

◆ randomizeFromSource()

void randomizeFromSource ( ParticleSet src)

Initialize particles around another ParticleSet Used to initialize an electron ParticleSet by an ion ParticleSet.

Definition at line 197 of file ParticleSet.cpp.

References qmcplusplus::app_log(), ParticleSet::first(), ParticleSet::getSpeciesSet(), ParticleSet::getTotalNum(), ParticleSet::GroupID, qmcplusplus::makeGaussRandom(), ParticleSet::R, and qmcplusplus::sqrt().

198 {
199  SpeciesSet& srcSpSet(src.getSpeciesSet());
200  SpeciesSet& spSet(getSpeciesSet());
201  int srcChargeIndx = srcSpSet.addAttribute("charge");
202  int srcMemberIndx = srcSpSet.addAttribute("membersize");
203  int ChargeIndex = spSet.addAttribute("charge");
204  int MemberIndx = spSet.addAttribute("membersize");
205  int Nsrc = src.getTotalNum();
206  int Nptcl = getTotalNum();
207  int NumSpecies = spSet.TotalNum;
208  int NumSrcSpecies = srcSpSet.TotalNum;
209  //Store information about charges and number of each species
210  std::vector<int> Zat, Zspec, NofSpecies, NofSrcSpecies, CurElec;
211  Zat.resize(Nsrc);
212  Zspec.resize(NumSrcSpecies);
213  NofSpecies.resize(NumSpecies);
214  CurElec.resize(NumSpecies);
215  NofSrcSpecies.resize(NumSrcSpecies);
216  for (int spec = 0; spec < NumSrcSpecies; spec++)
217  {
218  Zspec[spec] = (int)round(srcSpSet(srcChargeIndx, spec));
219  NofSrcSpecies[spec] = (int)round(srcSpSet(srcMemberIndx, spec));
220  }
221  for (int spec = 0; spec < NumSpecies; spec++)
222  {
223  NofSpecies[spec] = (int)round(spSet(MemberIndx, spec));
224  CurElec[spec] = first(spec);
225  }
226  int totQ = 0;
227  for (int iat = 0; iat < Nsrc; iat++)
228  totQ += Zat[iat] = Zspec[src.GroupID[iat]];
229  app_log() << " Total ion charge = " << totQ << std::endl;
230  totQ -= Nptcl;
231  app_log() << " Total system charge = " << totQ << std::endl;
232  // Now, loop over ions, attaching electrons to them to neutralize
233  // charge
234  int spToken = 0;
235  // This is decremented when we run out of electrons in each species
236  int spLeft = NumSpecies;
237  std::vector<PosType> gaussRand(Nptcl);
238  makeGaussRandom(gaussRand);
239  for (int iat = 0; iat < Nsrc; iat++)
240  {
241  // Loop over electrons to add, selecting round-robin from the
242  // electron species
243  int z = Zat[iat];
244  while (z > 0 && spLeft)
245  {
246  int sp = spToken++ % NumSpecies;
247  if (NofSpecies[sp])
248  {
249  NofSpecies[sp]--;
250  z--;
251  int elec = CurElec[sp]++;
252  app_log() << " Assigning " << (sp ? "down" : "up ") << " electron " << elec << " to ion " << iat
253  << " with charge " << z << std::endl;
254  double radius = 0.5 * std::sqrt((double)Zat[iat]);
255  R[elec] = src.R[iat] + radius * gaussRand[elec];
256  }
257  else
258  spLeft--;
259  }
260  }
261  // Assign remaining electrons
262  int ion = 0;
263  for (int sp = 0; sp < NumSpecies; sp++)
264  {
265  for (int ie = 0; ie < NofSpecies[sp]; ie++)
266  {
267  int iat = ion++ % Nsrc;
268  double radius = std::sqrt((double)Zat[iat]);
269  int elec = CurElec[sp]++;
270  R[elec] = src.R[iat] + radius * gaussRand[elec];
271  }
272  }
273 }
size_t getTotalNum() const
Definition: ParticleSet.h:493
std::ostream & app_log()
Definition: OutputManager.h:65
int first(int igroup) const
return the first index of a group i
Definition: ParticleSet.h:514
void makeGaussRandom(std::vector< TinyVector< T, D >> &a)
ParticlePos R
Position.
Definition: ParticleSet.h:79
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ rejectMove()

void rejectMove ( Index_t  iat)

reject a proposed move in regular mode

Parameters
iatthe electron whose proposed move gets rejected.

Definition at line 684 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_.

Referenced by ParticleSet::accept_rejectMove(), WaveFunctionTester::checkGradientAtConfiguration(), OrbitalImages::evaluate(), DensityMatrices1B::evaluate_check(), SOECPComponent::evaluateOne(), NonLocalECPComponent::evaluateOne(), NonLocalECPComponent::evaluateOneBodyOpMatrixContribution(), NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(), NonLocalECPComponent::evaluateOneWithForces(), DensityMatrices1B::integrate(), SOECPComponent::mw_evaluateOne(), NonLocalECPComponent::mw_evaluateOne(), DiracDeterminantWithBackflow::ratio(), DiracDeterminantWithBackflow::ratioGrad(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runRatioV(), qmcplusplus::TEST_CASE(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_LiH_msd(), DensityMatrices1B::update_basis(), and DensityMatrices1B::update_basis_d012().

685 {
686 #ifndef NDEBUG
687  if (iat != active_ptcl_)
688  throw std::runtime_error("Bug detected by rejectMove! Request electron is not active!");
689 #endif
690  active_ptcl_ = -1;
691 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599

◆ rejectMoveForwardMode()

void rejectMoveForwardMode ( Index_t  iat)
protected

reject a proposed move in forward mode

Parameters
iatthe electron whose proposed move gets rejected.

Definition at line 693 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, and ParticleSet::DistTables.

Referenced by ParticleSet::accept_rejectMove().

694 {
695  assert(iat == active_ptcl_);
696  //Update distance-table
697  for (int i = 0; i < DistTables.size(); i++)
698  DistTables[i]->updatePartial(iat, false);
699  active_ptcl_ = -1;
700 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

◆ releaseResource()

void releaseResource ( ResourceCollection collection,
const RefVectorWithLeader< ParticleSet > &  p_list 
)
static

release external resource Note: use RAII ResourceCollectionTeamLock whenever possible

Definition at line 964 of file ParticleSet.cpp.

References ParticleSet::extractCoordsRefList(), ParticleSet::extractDTRefList(), RefVectorWithLeader< T >::getLeader(), and ResourceCollection::takebackResource().

Referenced by VirtualParticleSet::releaseResource().

965 {
966  auto& ps_leader = p_list.getLeader();
967  ps_leader.coordinates_->releaseResource(collection, extractCoordsRefList(p_list));
968  for (int i = 0; i < ps_leader.DistTables.size(); i++)
969  ps_leader.DistTables[i]->releaseResource(collection, extractDTRefList(p_list, i));
970 
971  if (ps_leader.structure_factor_)
972  collection.takebackResource(p_list.getLeader().mw_structure_factor_data_handle_);
973 }
static RefVectorWithLeader< DistanceTable > extractDTRefList(const RefVectorWithLeader< ParticleSet > &p_list, int id)
static RefVectorWithLeader< DynamicCoordinates > extractCoordsRefList(const RefVectorWithLeader< ParticleSet > &p_list)

◆ reset()

void reset ( )
overridevirtual

dummy. For satisfying OhmmsElementBase.

Implements OhmmsElementBase.

Definition at line 302 of file ParticleSet.cpp.

References qmcplusplus::app_log().

302 { app_log() << "<<<< going to set properties >>>> " << std::endl; }
std::ostream & app_log()
Definition: OutputManager.h:65

◆ resetCollectables()

void resetCollectables ( )
inline

reset all the collectable quantities during a MC iteration

Definition at line 198 of file ParticleSet.h.

References PooledData< T >::begin(), ParticleSet::Collectables, and PooledData< T >::end().

198 { std::fill(Collectables.begin(), Collectables.end(), 0.0); }
std::vector< T >::iterator end()
return the ending iterator
Definition: PooledData.h:61
std::vector< T >::iterator begin()
return the starting iterator
Definition: PooledData.h:59
Buffer_t Collectables
observables in addition to those registered in Properties/PropertyList
Definition: ParticleSet.h:126

◆ resetGroups()

void resetGroups ( )

Definition at line 150 of file ParticleSet.cpp.

References SpeciesSet::addAttribute(), qmcplusplus::app_log(), OhmmsElementBase::getName(), SpeciesSet::getTotalNum(), ParticleSet::GroupID, ParticleSet::groupsize(), ParticleSet::Mass, ParticleSet::my_species_, OhmmsElementBase::myName, SpeciesSet::numAttributes(), ParticleSet::same_mass_, Vector< T, Alloc >::size(), and ParticleSet::Z.

Referenced by qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::doSOECPotentialTest(), qmcplusplus::get_two_species_particleset(), XMLParticleParser::readXML(), qmcplusplus::setup_He_wavefunction(), qmcplusplus::TEST_CASE(), qmcplusplus::test_J1_spline(), qmcplusplus::test_LiH_msd(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().

151 {
152  const int nspecies = my_species_.getTotalNum();
153  // Usually an empty ParticleSet indicates an error in the input file,
154  // but in some cases it is useful. Allow an empty ParticleSet if it
155  // has the special name "empty".
156  if (nspecies == 0 && getName() != "empty")
157  {
158  throw std::runtime_error("ParticleSet::resetGroups() Failed. No species exisits");
159  }
160  int natt = my_species_.numAttributes();
161  int qind = my_species_.addAttribute("charge");
162  if (natt == qind)
163  {
164  app_log() << " Missing charge attribute of the SpeciesSet " << myName << " particleset" << std::endl;
165  app_log() << " Assume neutral particles Z=0.0 " << std::endl;
166  for (int ig = 0; ig < nspecies; ig++)
167  my_species_(qind, ig) = 0.0;
168  }
169  for (int iat = 0; iat < Z.size(); iat++)
170  Z[iat] = my_species_(qind, GroupID[iat]);
171  natt = my_species_.numAttributes();
172  int massind = my_species_.addAttribute("mass");
173  if (massind == natt)
174  {
175  for (int ig = 0; ig < nspecies; ig++)
176  my_species_(massind, ig) = 1.0;
177  }
178  same_mass_ = true;
179  double m0 = my_species_(massind, 0);
180  for (int ig = 1; ig < nspecies; ig++)
181  same_mass_ &= (my_species_(massind, ig) == m0);
182  if (same_mass_)
183  app_log() << " All the species have the same mass " << m0 << std::endl;
184  else
185  app_log() << " Distinctive masses for each species " << std::endl;
186  for (int iat = 0; iat < Mass.size(); iat++)
187  Mass[iat] = my_species_(massind, GroupID[iat]);
188 
189  int membersize = my_species_.addAttribute("membersize");
190  for (int ig = 0; ig < nspecies; ++ig)
191  my_species_(membersize, ig) = groupsize(ig);
192 
193  for (int iat = 0; iat < GroupID.size(); iat++)
194  assert(GroupID[iat] < nspecies);
195 }
int numAttributes() const
return the number of attributes in our list
Definition: SpeciesSet.h:59
const std::string & getName() const
return the name
std::string myName
the name of the node, corresponds to the xml tag
std::ostream & app_log()
Definition: OutputManager.h:65
bool same_mass_
true if the particles have the same mass
Definition: ParticleSet.h:590
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
Definition: SpeciesSet.cpp:45
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
int getTotalNum() const
return the number of species
Definition: SpeciesSet.h:55
size_type size() const
return the current size
Definition: OhmmsVector.h:162
int groupsize(int igroup) const
return the size of a group
Definition: ParticleSet.h:527
ParticleScalar Z
charge of each particle
Definition: ParticleSet.h:89
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87

◆ resize()

void resize ( size_t  numPtcl)
inlineprotected

resize internal storage

Definition at line 683 of file ParticleSet.h.

References ParticleSet::coordinates_, ParticleSet::G, ParticleSet::GroupID, ParticleSet::L, ParticleSet::Mass, ParticleSet::R, Vector< T, Alloc >::resize(), ParticleSet::spins, ParticleSet::TotalNum, and ParticleSet::Z.

Referenced by ParticleSet::create(), ParticleSet::ParticleSet(), and MCWalkerConfiguration::resize().

684  {
685  TotalNum = numPtcl;
686 
687  R.resize(numPtcl);
688  spins.resize(numPtcl);
689  GroupID.resize(numPtcl);
690  G.resize(numPtcl);
691  L.resize(numPtcl);
692  Mass.resize(numPtcl);
693  Z.resize(numPtcl);
694 
695  coordinates_->resize(numPtcl);
696  }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
size_t TotalNum
total number of particles
Definition: ParticleSet.h:642
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79
ParticleScalar Z
charge of each particle
Definition: ParticleSet.h:89
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
ParticleScalar Mass
mass of each particle
Definition: ParticleSet.h:87

◆ saveWalker()

void saveWalker ( Walker_t awalker)

save this to awalker

just the R, G, and L More duplicate data that makes code difficult to reason about should be removed.

Definition at line 862 of file ParticleSet.cpp.

References ParticleSet::G, ParticleSet::L, Walker< t_traits, p_traits >::L, ParticleSet::R, Walker< t_traits, p_traits >::R, ParticleSet::spins, and Walker< t_traits, p_traits >::spins.

Referenced by SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), SODMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdateAll::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdatePbyP::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), QMCUpdateBase::initWalkersForPbyP(), ParticleSet::mw_saveWalker(), and WaveFunctionTester::runRatioTest().

863 {
864  awalker.R = R;
865  awalker.spins = spins;
866 #if !defined(SOA_MEMORY_OPTIMIZED)
867  awalker.G = G;
868  awalker.L = L;
869 #endif
870 }
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
ParticlePos R
Position.
Definition: ParticleSet.h:79

◆ set_quantum()

void set_quantum ( )
inline

Definition at line 169 of file ParticleSet.h.

References ParticleSet::quantum, and ParticleSet::quantum_domain.

Referenced by HamiltonianFactory::HamiltonianFactory().

169 { quantum_domain = quantum; }
quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73

◆ setMapStorageToInput()

void setMapStorageToInput ( const std::vector< int > &  mapping)
inline

Definition at line 563 of file ParticleSet.h.

References ParticleSet::map_storage_to_input_.

Referenced by XMLParticleParser::readXML().

563 { map_storage_to_input_ = mapping; }
std::vector< int > map_storage_to_input_
Map storage index to the input index.
Definition: ParticleSet.h:611

◆ setName()

◆ setQuantumDomain()

void setQuantumDomain ( quantum_domains  qdomain)

specify quantum_domain of particles

Definition at line 142 of file ParticleSet.cpp.

References ParticleSet::quantum_domain, and ParticleSet::quantumDomainValid().

Referenced by ParticleSet::ParticleSet().

143 {
144  if (quantumDomainValid(qdomain))
145  quantum_domain = qdomain;
146  else
147  throw std::runtime_error("ParticleSet::setQuantumDomain\n input quantum domain is not valid for particles");
148 }
quantum_domains quantum_domain
quantum_domain of the particles, default = classical
Definition: ParticleSet.h:73
bool quantumDomainValid() const
check whether quantum domain is valid for particles
Definition: ParticleSet.h:179

◆ setSpinor()

◆ setTwist()

void setTwist ( const SingleParticlePos t)
inline

Definition at line 481 of file ParticleSet.h.

References ParticleSet::myTwist.

Referenced by EinsplineSetBuilder::AnalyzeTwists2(), and FreeOrbitalBuilder::createSPOSetFromXML().

481 { myTwist = t; }
SingleParticlePos myTwist
Definition: ParticleSet.h:637

◆ species_from_index()

const std::string& species_from_index ( int  i)
inline

get species name of particle i

Definition at line 491 of file ParticleSet.h.

References ParticleSet::GroupID, ParticleSet::my_species_, and SpeciesSet::speciesName.

Referenced by OrbitalImages::write_orbital_xsf().

491 { return my_species_.speciesName[GroupID[i]]; }
ParticleIndex GroupID
Species ID.
Definition: ParticleSet.h:77
std::vector< std::string > speciesName
Species name list.
Definition: SpeciesSet.h:44
SpeciesSet my_species_
SpeciesSet of particles.
Definition: ParticleSet.h:614

◆ turnOnPerParticleSK()

void turnOnPerParticleSK ( )

Turn on per particle storage in Structure Factor.

Definition at line 60 of file ParticleSet.BC.cpp.

References ParticleSet::structure_factor_.

Referenced by CoulombPBCAB::checkoutParticleQuantities(), CoulombPBCAA::checkoutParticleQuantities(), CoulombPBCAA::CoulombPBCAA(), CoulombPBCAB::CoulombPBCAB(), ForceChiesaPBCAA::ForceChiesaPBCAA(), CoulombPBCAA::informOfPerParticleListener(), CoulombPBCAB::informOfPerParticleListener(), EnergyDensityEstimator::put(), and qmcplusplus::TEST_CASE().

61 {
63  structure_factor_->turnOnStorePerParticle(*this);
64  else
65  throw std::runtime_error("ParticleSet::turnOnPerParticleSK trying to turn on per particle storage in "
66  "structure_factor_ but structure_factor_ has not been created.");
67 }
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617

◆ update()

void update ( bool  skipSK = false)

update the internal data

Parameters
skipSK update if skipSK is true

Definition at line 349 of file ParticleSet.cpp.

References ParticleSet::active_ptcl_, ParticleSet::coordinates_, ParticleSet::DistTables, qmcplusplus::evaluate(), ParticleSet::myTimers, qmcplusplus::PS_update, ParticleSet::R, and ParticleSet::structure_factor_.

Referenced by BackflowTransformation::acceptMove(), ParticleSet::acceptMove(), SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), VMCUpdateAll::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), QMCCostFunction::checkConfigurations(), WaveFunctionTester::checkGradientAtConfiguration(), WaveFunctionTester::computeNumericalGrad(), BackflowTransformation::copyFromBuffer(), QMCCostFunction::correlatedSampling(), CoulombPBCAA::CoulombPBCAA(), qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::create_CN_particlesets(), qmcplusplus::doSOECPotentialTest(), JeeIOrbitalSoA< FT >::evalGradSource(), BackflowTransformation::evaluate(), BackflowTransformation::evaluateDerivatives(), QMCHamiltonian::evaluateElecGrad(), QMCHamiltonian::evaluateIonDerivsDeterministicFast(), QMCMain::executeCMCSection(), ForceCeperley::ForceCeperley(), ForceChiesaPBCAA::ForceChiesaPBCAA(), qmcplusplus::get_two_species_particleset(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), InitMolecularSystem::initMolecule(), RMCUpdateAllWithDrift::initWalkers(), QMCUpdateBase::initWalkers(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), VirtualParticleSet::makeMoves(), VirtualParticleSet::makeMovesWithSpin(), WaveFunctionTester::printEloc(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioV(), WaveFunctionTester::runZeroVarianceTest(), SPOSetScanner::scan_path(), qmcplusplus::TEST_CASE(), qmcplusplus::test_distance_fcc_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs(), qmcplusplus::test_distance_pbc_z_batched_APIs_ee_NEED_TEMP_DATA_ON_HOST(), qmcplusplus::test_EtOH_mw(), qmcplusplus::test_He_mw(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::testElecCase(), DiracDeterminantWithBackflow::testGG(), DiracDeterminantWithBackflow::testGGG(), DiracDeterminantWithBackflow::testL(), BackflowTransformation::testPbyP(), qmcplusplus::testTrialWaveFunction_diamondC_2x1x1(), and BackflowTransformation::transformOnly().

350 {
351  ScopedTimer update_scope(myTimers[PS_update]);
352 
353  coordinates_->setAllParticlePos(R);
354  for (int i = 0; i < DistTables.size(); i++)
355  DistTables[i]->evaluate(*this);
356  if (!skipSK && structure_factor_)
357  structure_factor_->updateAllPart(*this);
358 
359  active_ptcl_ = -1;
360 }
Index_t active_ptcl_
the index of the active particle during particle-by-particle moves
Definition: ParticleSet.h:599
ScopeGuard< NewTimer > ScopedTimer
Definition: NewTimer.h:257
std::unique_ptr< StructFact > structure_factor_
Structure factor.
Definition: ParticleSet.h:617
ParticlePos R
Position.
Definition: ParticleSet.h:79
std::unique_ptr< DynamicCoordinates > coordinates_
internal representation of R. It can be an SoA copy of R
Definition: ParticleSet.h:648
void evaluate(Matrix< T, Alloc > &lhs, const Op &op, const Expression< RHS > &rhs)
Definition: OhmmsMatrix.h:514
std::vector< std::unique_ptr< DistanceTable > > DistTables
distance tables that need to be updated by moving this ParticleSet
Definition: ParticleSet.h:630

Member Data Documentation

◆ active_pos_

◆ active_ptcl_

Index_t active_ptcl_
protected

the index of the active particle during particle-by-particle moves

when a single particle move is proposed, the particle id is assigned to active_ptcl_ No matter the move is accepted or rejected, active_ptcl_ is marked back to -1. This state flag is used for picking coordinates and distances for SPO evaluation.

Definition at line 599 of file ParticleSet.h.

Referenced by ParticleSet::acceptMove(), ParticleSet::acceptMoveForwardMode(), ParticleSet::activeR(), ParticleSet::activeSpin(), ParticleSet::donePbyP(), ParticleSet::getActivePtcl(), ParticleSet::loadWalker(), ParticleSet::makeMove(), ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), ParticleSet::makeVirtualMoves(), ParticleSet::mw_accept_rejectMove(), ParticleSet::mw_accept_rejectSpinMove(), ParticleSet::rejectMove(), ParticleSet::rejectMoveForwardMode(), and ParticleSet::update().

◆ active_spin_val_

◆ activeBead

Index_t activeBead

the index of the active bead for particle-by-particle moves

Definition at line 92 of file ParticleSet.h.

◆ Collectables

◆ coordinates_

◆ current_step

◆ Density_G

◆ Density_r

Array<RealType, OHMMS_DIM> Density_r

Definition at line 99 of file ParticleSet.h.

Referenced by EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().

◆ DensityReducedGvecs

std::vector<TinyVector<int, OHMMS_DIM> > DensityReducedGvecs

Particle density in G-space for MPC interaction.

Definition at line 97 of file ParticleSet.h.

Referenced by EinsplineSetBuilder::BroadcastOrbitalInfo(), MPC::init_gvecs(), and EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().

◆ direction

Index_t direction

the direction reptile traveling

Definition at line 94 of file ParticleSet.h.

◆ distTableDescriptions

std::vector<std::string> distTableDescriptions
protected

Descriptions from distance table creation. Same order as DistTables.

Definition at line 633 of file ParticleSet.h.

Referenced by ParticleSet::addTable(), and ParticleSet::print().

◆ DistTables

◆ G

gradients of the particles

Definition at line 83 of file ParticleSet.h.

Referenced by DMCUpdateAllWithRejection::advanceWalker(), VMCUpdateAll::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), CSVMCUpdateAll::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), ParticleSet::applyBC(), WaveFunctionTester::checkGradientAtConfiguration(), ParticleSet::clear(), ParticleSet::convert(), ParticleSet::convert2Unit(), QMCCostFunction::correlatedSampling(), ParticleSet::createAttributeList(), SpeciesKineticEnergy::evaluate(), BareKineticEnergy::evaluate(), ACForce::evaluate(), L2Potential::evaluate(), BareKineticEnergy::evaluate_orig(), BareKineticEnergy::evaluate_sp(), TrialWaveFunction::evaluateDeltaLog(), TrialWaveFunction::evaluateDeltaLogSetup(), DiracDeterminantWithBackflow::evaluateDerivatives(), RotatedSPOs::evaluateDerivatives(), MultiSlaterDetTableMethod::evaluateDerivatives(), kSpaceJastrow::evaluateDerivatives(), J1Spin< FT >::evaluateDerivatives(), TwoBodyJastrow< FT >::evaluateDerivatives(), J1OrbitalSoA< FT >::evaluateDerivatives(), CountingGaussianRegion::evaluateDerivatives(), CountingJastrow< RegionType >::evaluateDerivatives(), JeeIOrbitalSoA< FT >::evaluateDerivatives(), TrialWaveFunction::evaluateGL(), StressPBC::evaluateKineticSymTensor(), TrialWaveFunction::evaluateLog(), BareKineticEnergy::evaluateWithIonDerivs(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), RMCUpdateAllWithDrift::initWalkers(), QMCUpdateBase::initWalkers(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), ParticleSet::loadWalker(), ParticleSet::ParticleSet(), LatticeGaussianProduct::registerData(), DiracDeterminantWithBackflow::registerData(), kSpaceJastrow::registerData(), CountingJastrow< RegionType >::registerData(), ParticleSet::resize(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runZeroVarianceTest(), ParticleSet::saveWalker(), qmcplusplus::TEST_CASE(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LiH_msd(), AGPDeterminant::updateBuffer(), LatticeGaussianProduct::updateBuffer(), ExampleHeComponent::updateBuffer(), LinearOrbital::updateBuffer(), DiracDeterminantWithBackflow::updateBuffer(), DiracDeterminant< DU_TYPE >::updateBuffer(), DiracDeterminantBatched< PL, VT, FPVT >::updateBuffer(), MultiSlaterDetTableMethod::updateBuffer(), kSpaceJastrow::updateBuffer(), TwoBodyJastrow< FT >::updateBuffer(), TrialWaveFunction::updateBuffer(), CountingJastrow< RegionType >::updateBuffer(), J1OrbitalSoA< FT >::updateBuffer(), J1Spin< FT >::updateBuffer(), JeeIOrbitalSoA< FT >::updateBuffer(), and CSUpdateBase::updateCSWalkers().

◆ group_offsets_

std::shared_ptr<Vector<int, OMPallocator<int> > > group_offsets_
protected

array to handle a group of distinct particles per species

Definition at line 645 of file ParticleSet.h.

Referenced by ParticleSet::create(), ParticleSet::first(), ParticleSet::get_group_offsets(), ParticleSet::groups(), ParticleSet::groupsize(), ParticleSet::last(), and ParticleSet::print().

◆ GroupID

ParticleIndex GroupID

Species ID.

Definition at line 77 of file ParticleSet.h.

Referenced by JeeIOrbitalSoA< FT >::acceptMove(), L2Potential::add(), LocalECPotential::add(), CoulombPBCAB::add(), SOECPotential::addComponent(), NonLocalECPotential::addComponent(), JeeIOrbitalSoA< FT >::addFunc(), BackflowBuilder::addOneBody(), Backflow_ee< FT >::Backflow_ee(), Backflow_ee_kSpace::Backflow_ee_kSpace(), JeeIOrbitalSoA< FT >::check_complete(), ParticleSet::clear(), TwoBodyJastrow< FT >::computeU(), JeeIOrbitalSoA< FT >::computeU(), TwoBodyJastrow< FT >::computeU3(), JeeIOrbitalSoA< FT >::computeU3(), ParticleSet::create(), ParticleSet::createAttributeList(), QMCGaussianParserBase::createBasisSet(), QMCGaussianParserBase::createBasisSetWithHDF5(), QMCGaussianParserBase::createIonSet(), XMLSaveParticle::createNode(), ParticleSet::createSK(), SpeciesKineticEnergy::evaluate(), PairCorrEstimator::evaluate(), LatticeDeviationEstimator::evaluate(), JeeIOrbitalSoA< FT >::evaluateDerivatives(), TwoBodyJastrow< FT >::evaluateDerivativesWF(), JeeIOrbitalSoA< FT >::evaluateDerivativesWF(), TwoBodyJastrow< FT >::evaluateDerivRatios(), SoaLocalizedBasisSet< COT, ORBT >::evaluateGradSourceVGL(), TwoBodyJastrow< FT >::evaluateHessian(), JeeIOrbitalSoA< FT >::evaluateRatios(), JeeIOrbitalSoA< FT >::evaluateRatiosAlltoOne(), qmcplusplus::generateCuspInfo(), XMLSaveParticle::get(), GaussianFCHKParser::getGeometry(), LCAOHDFParser::getGeometry(), QPParser::getGeometry(), GamesAsciiParser::getGeometry(), DiracParser::getGeometry(), ParticleSet::getGroupID(), ForceChiesaPBCAA::initBreakup(), StressPBC::initBreakup(), CoulombPBCAA::initBreakup(), CoulombPBCAB::initBreakup(), InitMolecularSystem::initMolecule(), kSpaceJastrow::kSpaceJastrow(), RMGParser::parse(), ParticleSet::ParticleSet(), ParticleSet::print(), ParticleSet::randomizeFromSource(), JeeIOrbitalSoA< FT >::ratio(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), ParticleSet::resetGroups(), ParticleSet::resize(), EnergyDensityEstimator::set_ptcl(), ParticleSet::species_from_index(), kSpaceJastrow::StructureFactor(), qmcplusplus::TEST_CASE(), and EinsplineSetBuilder::TileIons().

◆ is_spinor_

bool is_spinor_
protected

true is a dynamic spin calculation

Definition at line 592 of file ParticleSet.h.

Referenced by ParticleSet::isSpinor(), ParticleSet::ParticleSet(), and ParticleSet::setSpinor().

◆ L

laplacians of the particles

Definition at line 85 of file ParticleSet.h.

Referenced by CSVMCUpdatePbyP::advanceWalker(), CSVMCUpdateAll::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), WaveFunctionTester::checkGradientAtConfiguration(), ParticleSet::clear(), QMCCostFunction::correlatedSampling(), ParticleSet::createAttributeList(), SpeciesKineticEnergy::evaluate(), BareKineticEnergy::evaluate(), L2Potential::evaluate(), BareKineticEnergy::evaluate_orig(), BareKineticEnergy::evaluate_sp(), TrialWaveFunction::evaluateDeltaLog(), TrialWaveFunction::evaluateDeltaLogSetup(), RotatedSPOs::evaluateDerivatives(), TrialWaveFunction::evaluateGL(), TrialWaveFunction::evaluateLog(), BareKineticEnergy::evaluateWithIonDerivs(), CSUpdateBase::initCSWalkersForPbyP(), RMCUpdateAllWithDrift::initWalkers(), QMCUpdateBase::initWalkers(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), ParticleSet::loadWalker(), ParticleSet::ParticleSet(), LatticeGaussianProduct::registerData(), DiracDeterminantWithBackflow::registerData(), kSpaceJastrow::registerData(), CountingJastrow< RegionType >::registerData(), ParticleSet::resize(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runZeroVarianceTest(), ParticleSet::saveWalker(), qmcplusplus::TEST_CASE(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LiH_msd(), qmcplusplus::testElecCase(), AGPDeterminant::updateBuffer(), LatticeGaussianProduct::updateBuffer(), ExampleHeComponent::updateBuffer(), LinearOrbital::updateBuffer(), DiracDeterminantWithBackflow::updateBuffer(), DiracDeterminant< DU_TYPE >::updateBuffer(), DiracDeterminantBatched< PL, VT, FPVT >::updateBuffer(), MultiSlaterDetTableMethod::updateBuffer(), kSpaceJastrow::updateBuffer(), TwoBodyJastrow< FT >::updateBuffer(), TrialWaveFunction::updateBuffer(), CountingJastrow< RegionType >::updateBuffer(), J1OrbitalSoA< FT >::updateBuffer(), J1Spin< FT >::updateBuffer(), and JeeIOrbitalSoA< FT >::updateBuffer().

◆ map_storage_to_input_

std::vector<int> map_storage_to_input_
protected

Map storage index to the input index.

If not empty, particles were reordered by groups when being loaded from XML input. When other input data are affected by reordering, its builder should query this mapping. map_storage_to_input_[5] = 2 means the index 5(6th) particle in this ParticleSet was read from the index 2(3th) particle in the XML input

Definition at line 611 of file ParticleSet.h.

Referenced by ParticleSet::get_map_storage_to_input(), and ParticleSet::setMapStorageToInput().

◆ Mass

◆ mw_structure_factor_data_handle_

ResourceHandle<SKMultiWalkerMem> mw_structure_factor_data_handle_
protected

multi walker structure factor data

Definition at line 620 of file ParticleSet.h.

Referenced by ParticleSet::mw_donePbyP().

◆ my_species_

◆ myDistTableMap

std::map<std::string, int> myDistTableMap
protected

map to handle distance tables

myDistTableMap[source-particle-tag]= locator in the distance table myDistTableMap[ObjectTag] === 0

Definition at line 627 of file ParticleSet.h.

Referenced by ParticleSet::addTable().

◆ myTimers

◆ myTwist

SingleParticlePos myTwist
protected

◆ ParentName

std::string ParentName
protected

Definition at line 639 of file ParticleSet.h.

Referenced by ParticleSet::parentName(), and ParticleSet::setName().

◆ PHindex

std::vector<int> PHindex

◆ Properties

◆ PropertyHistory

std::vector<std::vector<FullPrecRealType> > PropertyHistory

◆ PropertyList

◆ quantum_domain

◆ R

Position.

Definition at line 79 of file ParticleSet.h.

Referenced by BackflowTransformation::acceptMove(), ParticleSet::acceptMove(), ParticleSet::acceptMoveForwardMode(), ParticleSet::activeR(), QMCDriver::addWalkers(), SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), SODMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdateAll::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdateAll::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), ParticleSet::applyBC(), EinsplineSetBuilder::BroadcastOrbitalInfo(), WaveFunctionTester::checkGradientAtConfiguration(), WaveFunctionTester::checkGradients(), ParticleSet::clear(), SimpleFixedNodeBranch::collect(), WaveFunctionTester::computeNumericalGrad(), StructFact::computeRhok(), ParticleSet::convert(), ParticleSet::convert2Cart(), BackflowTransformation::copyFromBuffer(), kSpaceJastrow::copyFromBuffer(), CoulombPBCAA::CoulombPBCAA(), qmcplusplus::create_C_pbc_particlesets(), ParticleSet::createAttributeList(), CountingJastrowBuilder::createCJ(), QMCGaussianParserBase::createIonSet(), XMLSaveParticle::createNode(), ParticleSet::createSK(), MCWalkerConfiguration::createWalkers(), MCPopulation::createWalkers(), qmcplusplus::doSOECPotentialTest(), kSpaceJastrow::evalGrad(), JeeIOrbitalSoA< FT >::evalGradSource(), MPC::evalLR(), MomentumEstimator::evaluate(), DensityEstimator::evaluate(), EnergyDensityEstimator::evaluate(), GridExternalPotential::evaluate(), SpinDensity::evaluate(), HarmonicExternalPotential::evaluate(), SoaDistanceTableAB< T, D, SC >::evaluate(), SoaDistanceTableAA< T, D, SC >::evaluate(), SoaDistanceTableAAOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), BackflowTransformation::evaluate(), OrbitalImages::evaluate(), Backflow_eI< FT >::evaluate(), CountingGaussianRegion::evaluate(), Backflow_ee< FT >::evaluate(), DensityMatrices1B::evaluate_check(), DensityMatrices1B::evaluate_loop(), SHOSet::evaluate_notranspose(), CountingGaussian::evaluate_print(), GridExternalPotential::evaluate_sp(), HarmonicExternalPotential::evaluate_sp(), kSpaceJastrow::evaluateDerivatives(), BackflowTransformation::evaluateDerivatives(), CountingGaussianRegion::evaluateDerivatives(), HybridRepCplx< SPLINEBASE >::evaluateDetRatios(), QMCHamiltonian::evaluateElecGrad(), LinearOrbital::evaluateLog(), kSpaceJastrow::evaluateLog(), BackflowTransformation::evaluatePbyP(), BackflowTransformation::evaluatePbyPAll(), BackflowTransformation::evaluatePbyPWithGrad(), kSpaceJastrow::evaluateRatiosAlltoOne(), SOECPComponent::evaluateValueAndDerivatives(), NonLocalECPComponent::evaluateValueAndDerivatives(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluateValuesR2R(), Backflow_eI< FT >::evaluateWithDerivatives(), Backflow_ee< FT >::evaluateWithDerivatives(), QMCMain::executeCMCSection(), FiniteDifference::finiteDifferencePoints(), DensityMatrices1B::generate_particle_basis(), XMLSaveParticle::get(), qmcplusplus::get_two_species_particleset(), GaussianFCHKParser::getGeometry(), LCAOHDFParser::getGeometry(), QPParser::getGeometry(), GamesAsciiParser::getGeometry(), DiracParser::getGeometry(), MCWalkerConfiguration::getParticleNum(), InitMolecularSystem::initAtom(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), InitMolecularSystem::initMolecule(), SimpleFixedNodeBranch::initReptile(), RMCUpdateAllWithDrift::initWalkers(), QMCUpdateBase::initWalkers(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), InitMolecularSystem::initWithVolume(), DensityMatrices1B::integrate(), kSpaceJastrow::kSpaceJastrow(), ParticleSet::loadWalker(), ParticleSet::makeMove(), ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), VirtualParticleSet::makeMoves(), VirtualParticleSet::makeMovesWithSpin(), SoaDistanceTableAB< T, D, SC >::move(), SoaDistanceTableAA< T, D, SC >::move(), SoaDistanceTableAAOMPTarget< T, D, SC >::move(), SoaDistanceTableABOMPTarget< T, D, SC >::move(), ParticleSet::mw_accept_rejectMove(), VirtualParticleSet::mw_makeMoves(), VirtualParticleSet::mw_makeMovesWithSpin(), RMGParser::parse(), ParticleSet::ParticleSet(), OneMolecularOrbital::phi(), OneMolecularOrbital::phi_vgl(), ParticleSet::print(), WaveFunctionTester::printEloc(), ReferencePoints::put(), EnergyDensityEstimator::put(), ParticleSet::randomizeFromSource(), DiracDeterminantWithBackflow::ratio(), kSpaceJastrow::ratio(), DiracDeterminantWithBackflow::ratioGrad(), kSpaceJastrow::ratioGrad(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), XMLParticleParser::readXML(), BackflowTransformation::registerData(), MCWalkerConfiguration::resize(), ParticleSet::resize(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioV(), WaveFunctionTester::runZeroVarianceTest(), ParticleSet::saveWalker(), SPOSetScanner::scan_path(), EnergyDensityEstimator::set_ptcl(), qmcplusplus::setup_He_wavefunction(), SpaceGridEnv< VALID >::SpaceGridEnv(), kSpaceJastrow::StructureFactor(), SpinDensity::test(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_DiracDeterminant_first(), qmcplusplus::test_DiracDeterminantBatched_first(), qmcplusplus::test_EtOH_mw(), SpinDensity::test_evaluate(), qmcplusplus::test_He_mw(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), BackflowTransformation::testDeriv(), qmcplusplus::testElecCase(), DiracDeterminantWithBackflow::testGG(), DiracDeterminantWithBackflow::testGGG(), DiracDeterminantWithBackflow::testL(), BackflowTransformation::testPbyP(), qmcplusplus::testTrialWaveFunction_diamondC_2x1x1(), EinsplineSetBuilder::TileIons(), BackflowTransformation::transformOnly(), ParticleSet::update(), DensityMatrices1B::update_basis(), DensityMatrices1B::update_basis_d012(), BackflowTransformation::updateBuffer(), VirtualParticleSet::VirtualParticleSet(), and OrbitalImages::write_orbital_xsf().

◆ same_mass_

bool same_mass_
protected

true if the particles have the same mass

Definition at line 590 of file ParticleSet.h.

Referenced by ParticleSet::isSameMass(), and ParticleSet::resetGroups().

◆ simulation_cell_

◆ spins

◆ structure_factor_

◆ TotalNum

◆ VHXC_G

std::vector<ComplexType> VHXC_G[2]

Definition at line 103 of file ParticleSet.h.

Referenced by EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().

◆ VHXC_r

Array<RealType, OHMMS_DIM> VHXC_r[2]

Definition at line 104 of file ParticleSet.h.

Referenced by EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().

◆ VHXCReducedGvecs

std::vector<TinyVector<int, OHMMS_DIM> > VHXCReducedGvecs

DFT potential.

Definition at line 102 of file ParticleSet.h.

Referenced by EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().

◆ Z


The documentation for this class was generated from the following files: