23 #define REGISTER_MOVE(NAME,TYPE) \
24 const string TYPE::name = NAME;\
25 bool reg ## TYPE = moveFactory()->Register<TYPE>(TYPE::name);
61 ensemble _operateOnConfig,
bool _varLength) :
62 operateOnConfig(_operateOnConfig),
63 variableLength(_varLength),
65 actionPtr(_actionPtr),
69 numAccepted = numAttempted = numToMove = 0;
73 int b = int (ceil(log(1.0*
constants()->Mbar()) / log(2.0)-
EPS));
74 numAcceptedLevel.resize(b+1);
75 numAttemptedLevel.resize(b+1);
78 numAttemptedLevel = 0;
81 sqrt2LambdaTau = sqrt(2.0)*sqrtLambdaTau;
89 cumrho0.resize(numWind);
94 for (
int n = 0; n < numWind; n++ ) {
95 for (
int i = 0; i <
NDIM; i++) {
97 for (
int j = i+1; j <
NDIM; j++)
98 scale *= (2*maxWind + 1);
99 wind[i] = (n/scale) % (2*maxWind + 1);
102 wind[i] -= (wind[i] > maxWind)*(2*maxWind + 1);
106 for (
int i = 0; i <
NDIM; i++) {
107 if (!path.boxPtr->periodic[i])
112 winding.push_back(wind);
118 std::stable_sort(winding.begin(), winding.end(), [](
const iVec& w1,
const iVec& w2) {
119 return blitz::max(abs(w1)) < blitz::max(abs(w2));
125 for (
int n = 0; n < numWind-1; n++) {
127 if ( abs(
max(abs(winding[n+1])) -
max(abs(winding[n])) ) >
EPS)
128 windingSector.push_back(n);
131 if (windingSector.back() != numWind-1)
132 windingSector.push_back(numWind-1);
147 inline void MoveBase::printMoveState(
string state) {
151 Array <beadLocator,1> wormBeads;
168 wormBeads(n) = beadIndex;
188 inline void MoveBase::checkMove(
int callNum,
double diffA) {
201 double diffV = newV -
oldV;
202 if (abs(diffV-diffA) >
EPS) {
204 % diffV % diffA % (diffV - diffA);
208 cout <<
getName() <<
" PROBLEM WITH KEEP " << diffV <<
" " << diffA << endl;
217 double diffV = newV -
oldV;
218 double diffK = newK -
oldK;
219 if ( (abs(diffV) >
EPS) || abs(diffK) >
EPS) {
225 cout <<
getName() <<
" PROBLEM WITH UNDO " << diffV <<
" " << diffK << endl;
236 double diffV = newV -
oldV;
238 % ((newK-
oldK)/diffA) % ((diffV)/diffA);
269 const int stageLength,
const int k) {
274 double f1 = 1.0 * (stageLength - k - 1);
275 double f2 = 1.0 / (1.0*(stageLength - k));
287 for (
int i = 0; i <
NDIM; i++)
306 const int stageLength,
const int k,
iVec &wind) {
311 double f1 = 1.0 * (stageLength - k - 1);
312 double f2 = 1.0 / (1.0*(stageLength - k));
323 for (
int i = 0; i <
NDIM; i++)
327 for (
int i = 0; i <
NDIM; i++) {
358 const int stageLength,
double &totalrho0) {
365 vel =
path(endBead) -
path(startBead);
377 for (
int n = 1; n <
numWind; n++) {
414 beadIndex = startBead;
420 for (
int i = 0; i <
NDIM; i++) {
432 }
while (!all(beadIndex==endBead));
453 for (
int i = 0; i <
NDIM; i++)
484 for (
int i = 0; i <
NDIM; i++)
504 MTRand &_random,
ensemble _operateOnConfig) :
505 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
516 DisplaceMove::~DisplaceMove() {
533 if (
random.rand() < 0.5) {
549 if ( beadIndex[0] == 0){
554 beadIndex = brokenBead;
564 beadIndex = brokenBead;
639 void DisplaceMove::undoMove() {
657 MTRand &_random,
ensemble _operateOnConfig) :
658 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
667 EndStagingMove::~EndStagingMove() {
680 bool movedIntoSubregionB;
683 if (
random.rand() < 0.5) {
687 leftBead = beadIndex;
694 rightBead = beadIndex;
702 if ( beadIndex[0] == 0){
708 rightBead = brokenBead;
719 leftBead = brokenBead;
730 beadIndex = leftBead;
736 pivotIndex = beadIndex;
740 beadIndex = rightBead;
746 pivotIndex = beadIndex;
761 movedIntoSubregionB =
false;
763 neighborIndex = pivotIndex;
767 beadIndex =
path.
prev(neighborIndex);
772 neighborIndex = beadIndex;
775 neighborIndex = pivotIndex;
779 beadIndex =
path.
next(neighborIndex);
784 neighborIndex = beadIndex;
790 if (!movedIntoSubregionB){
812 void EndStagingMove::undoMove() {
815 beadIndex = leftBead;
817 while (!all(beadIndex==rightBead)){
838 MTRand &_random,
ensemble _operateOnConfig) :
839 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
848 MidStagingMove::~MidStagingMove() {
863 double centerWeightInit;
864 double centerWeightFinal;
869 leftBead = beadIndex;
875 midBeadL = beadIndex;
885 centerWeightInit = 1.0/totalrho0;
888 centerWeightInit = 1.0;
892 beadIndex = midBeadR;
897 rightBead = beadIndex;
921 }
while (!all(beadIndex==midBeadL));
923 beadIndex = midBeadR;
930 while (!all(beadIndex==rightBead)){
944 centerWeightFinal = 1.0/totalrho0;
946 centerWeightFinal = 1.0;
958 if (startBreak && (!endBreak)){
960 }
else if((!startBreak) && endBreak){
974 void MidStagingMove::undoMove() {
977 beadIndex = leftBead;
979 while (!all(beadIndex==midBeadL)){
984 beadIndex = midBeadR;
987 while (!all(beadIndex==rightBead)){
1008 MTRand &_random,
ensemble _operateOnConfig) :
1009 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
1016 SwapBreakMove::~SwapBreakMove() {
1027 beadLocator brokenBeadL,brokenBeadR,closedBeadL,closedBeadR;
1052 closedBeadR =
path.
next(closedBeadL);
1070 if (
random.rand() < rho0New/rho0Old ) {
1103 MTRand &_random,
ensemble _operateOnConfig) :
1104 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
1150 bool startSubregionA,startSubregionB,endSubregionA,endSubregionB;
1154 startBead = firstBead;
1162 if (all(
path.
prev(startBead)==firstBead)) {
1163 startBead = firstBead;
1168 endBead = firstBead;
1181 beadIndex = startBead;
1185 }
while (!all(beadIndex==
path.
next(endBead)));
1187 if (wlLength >
constants()->numTimeSlices())
1196 for (
int i = 0; i <
NDIM; i++)
1204 beadIndex = startBead;
1208 for (
int i = 0; i <
NDIM; i++) {
1213 }
while (!all(beadIndex==
path.
next(endBead)));
1220 beadIndex = startBead;
1221 startSubregionA =
false;
1222 startSubregionB =
false;
1223 endSubregionA =
false;
1224 endSubregionB =
false;
1227 if ((
constants()->spatialSubregionOn())&&(!(startSubregionA||startSubregionB))){
1234 if ((
constants()->spatialSubregionOn())&&(!(endSubregionA||endSubregionB))){
1239 }
while (!all(beadIndex==
path.
next(endBead)));
1241 if ( (startSubregionA && endSubregionB)|| (startSubregionB && endSubregionA) ){
1265 void CenterOfMassMove::undoMove() {
1269 beadIndex = startBead;
1275 }
while (!all(beadIndex==
path.
next(endBead)));
1290 MTRand &_random,
ensemble _operateOnConfig) :
1291 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
1352 beadIndex = startBead;
1353 for (
int k = 0; k < (stageLength); k++) {
1358 endBead = beadIndex;
1375 beadIndex = startBead;
1378 bool movedIntoSubRegionA =
false;
1384 if (!movedIntoSubRegionA){
1388 }
while (!all(beadIndex==
path.
prev(endBead)));
1390 if ( !movedIntoSubRegionA ) {
1415 void StagingMove::undoMove() {
1419 beadIndex = startBead;
1424 }
while (!all(beadIndex==
path.
prev(endBead)));
1441 MTRand &_random,
ensemble _operateOnConfig) :
1442 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
1459 numActiveBeads =
ipow(2,numLevels)-1;
1460 include.resize(numActiveBeads);
1462 newPos.resize(numActiveBeads);
1495 if (
constants()->actionType() ==
"pair_product")
1501 numActiveBeads =
ipow(2,numLevels)-1;
1520 beadIndex = startBead;
1521 for (
int k = 0; k < (numActiveBeads+1); k++) {
1526 endBead = beadIndex;
1538 oldDeltaAction = 0.0;
1539 for (level = numLevels; level > 0; level--) {
1543 shift =
ipow(2,level-1);
1549 beadIndex =
path.
next(startBead,shift);
1567 else if (level==1) {
1575 beadIndex =
path.
next(beadIndex,shift);
1576 }
while (!all(beadIndex==endBead));
1612 void BisectionMove::keepMove() {
1630 void BisectionMove::undoMove() {
1636 beadIndex = startBead;
1643 }
while (!all(beadIndex==
path.
prev(endBead)));
1659 ensemble _operateOnConfig,
bool _varLength) :
1660 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
1695 numLevels = int (ceil(log(1.0*gapLength) / log(2.0)-
EPS));
1704 tailBead =
path.
next(headBead,gapLength);
1746 double actionShift = (-log(norm) + muShift)/gapLength;
1751 double factor = 0.5;
1754 beadIndex = headBead;
1767 }
while (!all(beadIndex==tailBead));
1812 void OpenMove::keepMove() {
1822 while (!all(beadIndex==tailBead)) {
1832 printMoveState(
"Opened up a worm.");
1839 void OpenMove::undoMove() {
1845 printMoveState(
"Failed to open up a worm.");
1859 MTRand &_random,
ensemble _operateOnConfig,
bool _varLength) :
1860 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
1918 double norm = totalrho0 /
1934 double actionShift = (log(norm) + muShift)/
path.
worm.
gap;
2012 void CloseMove::keepMove() {
2024 printMoveState(
"Closed up a worm.");
2031 void CloseMove::undoMove() {
2045 printMoveState(
"Failed to close up a worm.");
2059 ensemble _operateOnConfig,
bool _varLength) :
2060 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2085 numLevels = int(ceil(log(1.0*wormLength) / log(2.0)-
EPS));
2120 double actionShift = (log(norm) + muShift)/wormLength;
2124 beadIndex = tailBead;
2134 for (
int k = 1; k < wormLength; k++) {
2156 checkMove(1,
deltaAction + actionShift*wormLength);
2168 beadIndex = tailBead;
2169 for (
int k = 0; k < wormLength; k++)
2171 headBead = beadIndex;
2195 void InsertMove::keepMove() {
2208 printMoveState(
"Inserted a worm.");
2215 void InsertMove::undoMove() {
2220 beadIndex = tailBead;
2223 }
while (!all(beadIndex==
XXX));
2230 printMoveState(
"Failed to insert a worm.");
2244 ensemble _operateOnConfig,
bool _varLength) :
2245 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2307 double factor = 0.5;
2339 oldAction = actionPtr->potentialAction(path.worm.tail,path.worm.head);
2342 if ( random.rand() < norm*exp(oldAction - muShift) ) {
2344 checkMove(1,-oldAction);
2360 void RemoveMove::keepMove() {
2367 printMoveState(
"About to remove a worm.");
2375 }
while (!all(beadIndex==
XXX));
2382 printMoveState(
"Removed a worm.");
2390 void RemoveMove::undoMove() {
2395 printMoveState(
"Failed to remove a worm.");
2409 MTRand &_random,
ensemble _operateOnConfig,
bool _varLength) :
2410 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2441 numLevels = int (ceil(log(1.0*advanceLength) / log(2.0)-
EPS));
2451 double norm =
constants()->attemptProb(
"recede head") /
2452 constants()->attemptProb(
"advance head");
2464 double actionShift = (log(norm) + muShift)/advanceLength;
2476 for (
int k = 0; k < (advanceLength-1); k++) {
2496 checkMove(1,
deltaAction + advanceLength*actionShift);
2509 for (
int k = 0; k < advanceLength; k++)
2511 headBead = beadIndex;
2535 void AdvanceHeadMove::keepMove() {
2548 printMoveState(
"Advanced a worm.");
2556 void AdvanceHeadMove::undoMove() {
2564 while (!all(beadIndex==
XXX))
2574 printMoveState(
"Failed to advance a worm.");
2588 MTRand &_random,
ensemble _operateOnConfig,
bool _varLength) :
2589 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2619 numLevels = int (ceil(log(1.0*advanceLength) / log(2.0)-
EPS));
2631 double norm =
constants()->attemptProb(
"recede tail") /
2632 constants()->attemptProb(
"advance tail");
2650 double actionShift = (-log(norm) + muShift)/advanceLength;
2653 double factor = 0.5;
2669 }
while (!all(beadIndex==tailBead));
2678 checkMove(1,
deltaAction - advanceLength*actionShift);
2710 void AdvanceTailMove::keepMove() {
2722 }
while (!all(beadIndex==
XXX));
2730 printMoveState(
"Advanced a worm tail.");
2738 void AdvanceTailMove::undoMove() {
2746 printMoveState(
"Failed to advance a worm tail.");
2760 MTRand &_random,
ensemble _operateOnConfig,
bool _varLength) :
2761 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2790 numLevels = int (ceil(log(1.0*recedeLength) / log(2.0)-
EPS));
2802 double norm =
constants()->attemptProb(
"advance head") /
2803 constants()->attemptProb(
"recede head");
2821 double actionShift = (-log(norm) + muShift)/recedeLength;
2824 double factor = 0.5;
2837 }
while (!all(beadIndex==headBead));
2845 checkMove(1,
deltaAction - recedeLength*actionShift);
2877 void RecedeHeadMove::keepMove() {
2889 }
while (!all(beadIndex==
XXX));
2897 printMoveState(
"Receded a worm head.");
2905 void RecedeHeadMove::undoMove() {
2913 printMoveState(
"Failed to recede a worm head.");
2927 MTRand &_random,
ensemble _operateOnConfig,
bool _varLength) :
2928 MoveBase(_path,_actionPtr,_random,_operateOnConfig,_varLength) {
2958 numLevels = int (ceil(log(1.0*recedeLength) / log(2.0)-
EPS));
2968 double norm =
constants()->attemptProb(
"advance tail") /
2969 constants()->attemptProb(
"recede tail");
2981 double actionShift = (log(norm) + muShift)/recedeLength;
2995 for (
int k = 0; k < (recedeLength-1); k++) {
3015 checkMove(1,
deltaAction + recedeLength*actionShift);
3027 for (
int k = 0; k < recedeLength; k++)
3029 tailBead = beadIndex;
3053 void RecedeTailMove::keepMove() {
3066 printMoveState(
"Receded a worm tail.");
3074 void RecedeTailMove::undoMove() {
3082 while (!all(beadIndex==
XXX))
3092 printMoveState(
"Failed to recede a worm tail.");
3107 MoveBase(_path,_actionPtr,_random,_operateOnConfig) {
3117 template <
typename T>
3118 vector<size_t> sort_indexes(
const vector<T> &v) {
3121 vector<size_t> idx(v.size());
3122 std::iota(idx.begin(), idx.end(), 0);
3125 stable_sort(idx.begin(), idx.end(),
3126 [&v](
size_t i1,
size_t i2) {return v[i1] < v[i2];});
3172 for (
int w = 1; w <
numWind; w++) {
3186 for (
unsigned int n = 0; n <
sizeCDF; n++)
3238 double x =
random.rand();
3293 MTRand &_random,
ensemble _operateOnConfig) :
3294 SwapMoveBase(_path,_actionPtr,_random,_operateOnConfig) {
3339 if (pivotSlice >=
constants()->numTimeSlices())
3392 if (
random.rand() < PNorm) {
3403 if (!all(beadIndex==
swap) && !all(beadIndex==
pivot)) {
3471 void SwapHeadMove::keepMove() {
3482 printMoveState(
"Performed a head swap.");
3490 void SwapHeadMove::undoMove() {
3508 }
while (!all(beadIndex==
pivot));
3517 printMoveState(
"Failed to perform a head swap.");
3531 MTRand &_random,
ensemble _operateOnConfig) :
3532 SwapMoveBase(_path,_actionPtr,_random,_operateOnConfig) {
3629 if (
random.rand() < PNorm) {
3641 if (!all(beadIndex==
swap) && !all(beadIndex==
pivot)) {
3707 void SwapTailMove::keepMove() {
3721 printMoveState(
"Performed a tail swap.");
3729 void SwapTailMove::undoMove() {
3746 }
while (!all(beadIndex==
swap));
3755 printMoveState(
"Failed to perform a tail swap.");
Action class definitions.
Holds a base class that all action classes will be derived from.
const bool local
Is the action local in imaginary time?
virtual double potentialAction()
The effective potential inter-ACTION for various pass conditions.
double ensembleWeight(const int)
The ensemble particle number weighting factor.
double kineticAction()
The full kinetic Action
void setShift(int _shift)
The public method that sets the tau scaling factor.
double rho0(const dVec &, const dVec &, int)
The free-particle density matrix.
A derived class which performs an advance head move, causing the head of a worm in a off-diagonal con...
~AdvanceHeadMove()
Destructor.
AdvanceHeadMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
bool attemptMove()
Perform an advance head move.
A derived class which performs an advance tail move, causing the tail of a worm in a off-diagonal con...
~AdvanceTailMove()
Destructor.
bool attemptMove()
Perform an advance tail move.
AdvanceTailMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
A derived class which performs a bisection move, which exactly samples the kinetic action.
BisectionMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
bool attemptMove()
Bisection Move : attempt Move.
~BisectionMove()
Destructor.
A derived class which performs a simple displacement of the center of mass of the entire wordline for...
CenterOfMassMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
bool attemptMove()
Performs a Center of Mass move.
~CenterOfMassMove()
Destructor.
A derived class which performs a close move, creating a diagonal world line configuration.
bool attemptMove()
Perform a close move.
CloseMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
File * file(string type)
Get method returning file object.
int numTimeSlices()
Get number of time slices.
int maxWind()
Get the maximum winding number sampled.
double mu() const
Get chemical potential.
double tau() const
Get imaginary time step.
int b()
Get bisection level.
double comDelta() const
Get center of mass shift.
double C() const
Get full worm constant.
virtual dVec randPosition(MTRand &) const =0
Random position inside a box.
double volume
The volume of the container in A^3.
TinyVector< unsigned int, NDIM > periodic
Determines which dimensions have periodic bc.
virtual dVec randUpdate(MTRand &, const dVec &) const =0
Random updated position inside a box.
void putInBC(dVec &r) const
Place a vector in boundary conditions.
virtual void putInside(dVec &) const =0
Place a vector inside the simulation cell.
dVec side
The linear dimensions of the box.
A derived class which performs a simple single slice displacement move.
bool attemptMove()
Perform a single slice update on the head or tail.
DisplaceMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
EndStagingMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
bool attemptMove()
Perform a single slice update on the head or tail.
A derived class which performs an insert move, creating an off-diagonal world line configuration with...
bool attemptMove()
Perform an insert move.
InsertMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=DIAGONAL, bool _varLength=true)
Constructor.
int fullNumBeads
The full number of active beads in beadList;.
void updateFullInteractionList(const beadLocator &, const int)
Fill up the fullBeadList array with a list of beads in the same grid box as the supplied beadIndex an...
bool gridNeighbors(const beadLocator &, const beadLocator &)
Given two beadIndices, determine if the beads lie in neighboring grid boxes.
Array< beadLocator, 1 > fullBeadList
The full dynamic list of interacting beads.
bool gridShare(const beadLocator &bead1, const beadLocator &bead2)
Determine if two beads are in the same grid box.
MidStagingMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
bool attemptMove()
CMH: Add a description for this update.
The base class that all moves will be derived from.
double sqrtLambdaTau
sqrt(Lambda * tau)
virtual ~MoveBase()
Destructor.
dVec neighborPos
Staging neighbor position.
uint32 numAttempted
The number of attempted moves.
Array< dVec, 1 > originalPos
The original particle positions.
vector< iVec > winding
The winding vectors
Array< dVec, 1 > newPos
New particle positions.
iVec getWindingNumber(const beadLocator &, const beadLocator &)
Find the winding number for a path between two beads.
double oldV
The old and new potential action.
Path & path
A reference to the paths.
dVec newFreeParticlePosition(const beadLocator &)
Generates a new position, which exactly samples the free particle density matrix.
int numWind
The total number of winding vectors.
dVec newStagingPosition(const beadLocator &, const beadLocator &, const int, const int)
Returns a new staging position which will exactly sample the kinetic action.
iVec sampleWindingSector(const beadLocator &, const beadLocator &, const int, double &)
Obtain a winding sector for a stage-like move.
dVec newBisectionPosition(const beadLocator &, const int)
Returns a new bisection position which will exactly sample the kinetic action.
MTRand & random
A reference to the RNG.
beadLocator nBeadIndex
Neighbor bead index.
double deltaAction
The action difference.
ActionBase * actionPtr
A base pointer to the action.
int numToMove
The number of particles moved.
virtual string getName()
return the move name
uint32 numAccepted
The number of accepted moves.
dVec newRanPos
Staing random position.
static uint32 totAccepted
The total number of moves accepted.
virtual void keepMove()
Keep the move.
double newAction
The new potential action.
Array< uint32, 1 > numAttemptedLevel
The number of moves attempted at each level.
bool success
Did we sucessfully perform a move?
double sqrt2LambdaTau
sqrt(2 * Lambda * tau)
double oldAction
The original potential action.
static uint32 totAttempted
The total number of moves attempted.
Array< uint32, 1 > numAcceptedLevel
The number of moves accepted at each level.
vector< double > cumrho0
Used for tower-sampling winding sectors.
double oldK
The old and new kinetic action.
A derived class which performs an open move, creating a worm with a well defined head and tail.
OpenMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=DIAGONAL, bool _varLength=true)
Constructor.
bool attemptMove()
Perform an open move.
The space-time trajectories.
bool inSubregionA(const beadLocator &) const
Checks to see if bead is in subregion A/B at break slice + 1.
beadLocator delBeadGetNext(const beadLocator &)
Delete a bead and move forwards.
beadLocator delBeadGetPrev(const beadLocator &)
Delete a bead and move backwards.
vector< int > closedWorldlines
A list of particles with closed worldlines on left of break.
vector< int > brokenWorldlinesR
A list of particles with broken worldlines on right of break.
void printWormConfig(Array< beadLocator, 1 > &)
Used when debugging worm configurations.
void makeLink(const beadLocator &, const beadLocator &)
Make a link between beads.
dVec getSeparation(const beadLocator &, const beadLocator &) const
Return the separation vector between two particles in the same timeslice.
vector< int > brokenWorldlinesL
A list of particles with broken worldlines on left of break.
void removeCenterLink(const beadLocator &)
Break the link to right of bead t center slice AND update lists.
const int numTimeSlices
A local constant copy of the number of time slices.
beadLocator addPrevBead(const beadLocator &, const dVec &)
Add a bead at the previous time slice.
Array< int, 1 > numBeadsAtSlice
The number of active beads at a given time slice.
int breakSlice
The location of the break in the path (0=>no break)
beadLocator addBead(const int, const dVec &)
Add a bead to the worldline configuration at a given slice.
void addCenterLink(const beadLocator &, const beadLocator &)
Make a link between beads at center slice AND update lists.
bool inSubregionB(const beadLocator &) const
Check if bead is in subregion B.
void printLinks(Tstream &)
Output bead-link info, used for debugging.
void updateBead(const beadLocator &, const dVec &)
Update the position of a bead in the worldine configuration.
beadLocator & next(int slice, int ptcl)
Move one link forward in imaginary time.
const Container * boxPtr
A constant reference to the container class.
Worm worm
Details on the worm.
beadLocator & prev(int slice, int ptcl)
Move one link backward in imaginary time.
beadLocator addNextBead(const beadLocator &, const dVec &)
Add a bead at the next time slice.
LookupTable & lookup
A reference to the nearest neighbor lookup table.
void breakLink(const beadLocator &)
Break the link to right of bead.
int getTrueNumParticles() const
The number of active particles.
A derived class which performs a recede move on the head, causing a worm head to propagate backwards ...
bool attemptMove()
Perform a recede head move.
~RecedeHeadMove()
Destructor.
RecedeHeadMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
A derived class which performs a recede move on the tail, causing a worm tail to propagate backwards ...
RecedeTailMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
bool attemptMove()
Perform a recede tail move.
~RecedeTailMove()
Destructor.
A derived class which performs a remove move, creating a diagonal world line configuration by destroy...
bool attemptMove()
Perform a remove move.
RemoveMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL, bool _varLength=true)
Constructor.
A derived class which performs a staging move, which exactly samples the kinetic action.
bool attemptMove()
Perform the staging move.
StagingMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
~StagingMove()
Destructor.
SwapBreakMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=ANY)
Constructor.
bool attemptMove()
CMH: Please add a method description for this move.
A derived class which performs a swap head move, which mixes up worldlines by reconnecting the worm h...
~SwapHeadMove()
Destructor.
SwapHeadMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL)
Constructor.
bool attemptMove()
Perform a swap head move.
A derived class which forms the base of a swap head and swap tail move class.
beadLocator pivot
The pivot bead.
SwapMoveBase(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL)
Constructor.
vector< double > cumulant
The cumulant array used in selecting a pivot.
beadLocator selectPivotBead()
Select the pivot bead for a swap move.
double SigmaSwap
Probability normalization factor.
~SwapMoveBase()
Destructor.
double getNorm(const beadLocator &, const int sign=1)
Get the normalization constant for a swap move.
unsigned int sizeCDF
The size of the cumulative distribution function.
beadLocator swap
The swap bead.
int swapLength
The length of worldLine to be moved.
int numLevels
The number of bisection levels.
A derived class which performs a swap tail move, which mixes up worldlines by reconnecting the worm t...
~SwapTailMove()
Destructor.
bool attemptMove()
Perform a swap tail move.
SwapTailMove(Path &, ActionBase *, MTRand &, ensemble _operateOnConfig=OFFDIAGONAL)
Constructor.
bool isConfigDiagonal
Stores the diagonality of the configuration.
int gap
numTimeSlices - length
beadLocator tail
The coordinates of the worm tail.
beadLocator head
The coordinates of the worm head.
beadLocator special2
Special bead, used in move updates.
void update(Path &, const beadLocator &, const beadLocator &)
We update all worm properties for a new head and tail.
int beadOn(int, int) const
Safely get a bead (int indexed)
bool tooCostly()
Return true if the worm is too costly.
void reset()
Reset the worm to a null state.
int getNumBeadsOn() const
Return the number of active beads.
beadLocator special1
Special bead, used in move updates.
int length
The length of the worm.
Ttype & max(Ttype &x, Ttype &y)
Maximum of two inputs.
#define NDIM
Number of spatial dimnsions.
int ipow(int base, int power)
Return the integer value of a number raised to a power.
unsigned long uint32
Unsigned integer type, at least 32 bits.
TinyVector< int, 2 > beadLocator
time-slice,bead-number world line index
ensemble
Each move can operate on only the digaonal ensemble, only the off-diagonal ensemble,...
#define EPS
A small number.
Ttype & min(Ttype &x, Ttype &y)
Minimum of two inputs.
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
#define PIMC_ASSERT(X)
Rename assert method.
TinyVector< int, NDIM > iVec
A NDIM-vector of type integer.
#define XXX
Used to refer to a nonsense beadIndex.
Class definitions for all file input/output.
Communicator * communicate()
Global public access to the communcator singleton.
ConstantParameters * constants()
Global public access to the constants.
Factory class definitions.
LookupTable class definition.
MoveFactory moveFactory
Setup the move factory.