Skip to content

Commit

Permalink
Merge pull request #5200 from aannabe/nxs_j3_soc2
Browse files Browse the repository at this point in the history
Nexus: Bugfix for SOC J3 terms
  • Loading branch information
ye-luo authored Oct 18, 2024
2 parents 81ba5c2 + 6e40f97 commit e80f956
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions nexus/lib/qmcpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,16 +931,22 @@ def incorporate_result(self,result_name,result,sim):
J3 = optwf.get('J3')
if J3 is not None:
corr = J3.get('correlation')
j3_ids = []
for j3_term in corr:
j3_id = j3_term.coefficients.id
j3_ids.append(j3_id)
#end for
for j3_id in j3_ids:
if 'ud' in j3_id:
delattr(corr, j3_id)
#end if
#end for
if hasattr(corr, 'coefficients'):
# For single-species systems, the data structure changes.
# In this case, the only J3 term should be 'uu'.
# Otherwise, the user might be trying to do something strange.
assert 'uu' in corr.coefficients.id, 'Only uu J3 terms are allowed in SOC calculations.'
else:
j3_ids = []
for j3_term in corr:
j3_id = j3_term.coefficients.id
j3_ids.append(j3_id)
#end for
for j3_id in j3_ids:
if 'ud' in j3_id:
delattr(corr, j3_id)
#end if
#end for
#end if
#end if
def process_jastrow(wf):
Expand Down

0 comments on commit e80f956

Please sign in to comment.