Additional zero protection in MSD.#4775
Conversation
PDoakORNL
left a comment
There was a problem hiding this comment.
I need some explanation of why this distributed defensive coding is better than clear initialization of curRatio or its mw_res equivalent. Or if I'm just not understanding how a ratio can go to zero during a series monte carlo moves explain...
| const int det_id = getDetID(iat); | ||
| curRatio = Dets[det_id]->getRefDetRatio() * new_psi_ratio_to_new_ref_det_ / psi_ratio_to_ref_det_; | ||
| curRatio = Dets[det_id]->getRefDetRatio(); | ||
| if (curRatio != PsiValueType(0)) |
There was a problem hiding this comment.
I don't have a good feel for why it would ever be valid for the curRatio to be zero that seems like it would require some per particle ratio to sum to zero or a result of getting burned by the rather unclear initialization of the single walker curRatio state variable.
Is this just temporary defensive coding?
There was a problem hiding this comment.
When the proposed configuration is on the nodal surface. curRatio goes to zero. This move should be rejected eventually by Monte Carlo. When Dets[det_id]->getRefDetRatio() is zero, new_psi_ratio_to_new_ref_det_ the sum of all the dets with respect to the ref one is NaN because it is the sum of all the 1/0. So keeping curRatio zero should be healthy.
|
test this please |
|
I still need to fix the compilation once #4772 is merged first. |
03d919e to
34ed93d
Compare
When the proposed configuration is on the nodal surface. Reference determinant curRatio goes to zero. This move should be rejected eventually by Monte Carlo. However, to make the code proceed, some NaN protection is needed. When Dets[det_id]->getRefDetRatio() is zero, new_psi_ratio_to_new_ref_det_ the sum of all the dets with respect to the ref one is NaN because it is the sum of all the 1/0. So keeping curRatio zero should be healthy.
34ed93d to
e18a785
Compare
|
Test this please |
Proposed changes
preventing NaN by indirectly protecting zero.
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
epyc-server
Checklist