Skip to content

Commit

Permalink
Fix CCD 2RDM
Browse files Browse the repository at this point in the history
  • Loading branch information
obackhouse committed Aug 7, 2024
1 parent 1c9e7c3 commit 6372e9a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ebcc/codegen/bootstrap_CCD.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@ def get_postamble(n, spin, name="rdm{n}"):
shape = ", ".join(f"t2.shape[{'0' if o == 'o' else '-1'}]" for o in occ)
postamble += f"{nm}.{occ} = np.zeros(({shape}))\n"
else:
for s1 in "ab":
for s2 in "ab":
for occ in ("ooov", "oovo", "ovoo", "vooo", "ovvv", "vovv", "vvov", "vvvo"):
shape = ", ".join(f"t2.{s}{s}{s}{s}.shape[{'0' if o == 'o' else '-1'}]" for o, s in zip(occ, s1+s1+s2+s2))
postamble += f"{nm}.{s1}{s1}{s2}{s2}.{occ} = np.zeros(({shape}))\n"
for s1, s2 in [("a", "a"), ("a", "b"), ("b", "b")]:
for occ in ("ooov", "oovo", "ovoo", "vooo", "ovvv", "vovv", "vvov", "vvvo"):
shape = ", ".join(f"t2.{s}{s}{s}{s}.shape[{'0' if o == 'o' else '-1'}]" for o, s in zip(occ, s1+s2+s1+s2))
postamble += f"{nm}.{s1}{s2}{s1}{s2}.{occ} = np.zeros(({shape}))\n"
return postamble + get_density_einsum_postamble(n, spin)
kwargs = {
"preamble": get_density_einsum_preamble(2, spin),
Expand Down

0 comments on commit 6372e9a

Please sign in to comment.