void Backflow_pf_wf::updateVal(Wavefunction_data * wfdata, Sample_point * sample) { assert(sampleAttached); assert(dataAttached); Backflow_pf_wf_data * pfaffdata; recast(wfdata, pfaffdata); if(updateEverythingVal){ calcVal(sample); updateEverythingVal=0; electronIsStaleVal=0; } else { for(int e=0; e< nelectrons(0)+nelectrons(1); e++) { if(electronIsStaleVal(e)) { calcVal(sample); //updateVal(e,sample); electronIsStaleVal=0; } } } assert(sampleAttached); assert(dataAttached); }
void Backflow_pf_wf::updateLap( Wavefunction_data * wfdata, Sample_point * sample) { assert(sampleAttached); assert(dataAttached); if(updateEverythingLap==1) { calcLap(sample); updateEverythingVal=0; updateEverythingLap=0; electronIsStaleLap=0; electronIsStaleVal=0; } else { for(int e=0; e< nelectrons(0)+nelectrons(1); e++) { if(electronIsStaleLap(e)) { calcLap(sample); electronIsStaleLap(e)=0; electronIsStaleVal(e)=0; } } } }
/*! Behavior under staticSample: if sample_static is set, then we ignore all electron moves in the main algorithm, and the only way to update based on a move is by the getParmDepVal function. The regular update functions will not work in this case. */ void Backflow_pf_wf::notify(change_type change, int num) { jast.notify(change,num); switch(change) { case electron_move: //if(staticSample==0) { electronIsStaleVal(num)=1; electronIsStaleLap(num)=1; //} break; case all_electrons_move: //if(staticSample==0) { updateEverythingVal=1; updateEverythingLap=1; //} break; case wf_parm_change: case all_wf_parms_change: //if(parent->optimize_backflow ) { updateEverythingVal=1; updateEverythingLap=1; //} break; case sample_attach: sampleAttached=1; updateEverythingVal=1; updateEverythingLap=1; break; case data_attach: dataAttached=1; updateEverythingVal=1; updateEverythingLap=1; break; default: updateEverythingVal=1; updateEverythingLap=1; } }
/*! Behavior under staticSample: if sample_static is set, then we ignore all electron moves in the main algorithm, and the only way to update based on a move is by the getParmDepVal function. The regular update functions will not work in this case. */ void BCS_wf::notify(change_type change, int num) { jast.notify(change,num); switch(change) { case electron_move: electronIsStaleVal(num)=1; electronIsStaleLap(num)=1; break; case all_electrons_move: updateEverythingVal=1; updateEverythingLap=1; break; case wf_parm_change: case all_wf_parms_change: updateEverythingVal=1; updateEverythingLap=1; break; case sample_attach: sampleAttached=1; updateEverythingVal=1; updateEverythingLap=1; break; case data_attach: dataAttached=1; updateEverythingVal=1; updateEverythingLap=1; break; case sample_static: break; case sample_dynamic: break; default: updateEverythingVal=1; updateEverythingLap=1; } }