Skip to content

Commit

Permalink
Missed statements
Browse files Browse the repository at this point in the history
  • Loading branch information
obackhouse committed Nov 23, 2024
1 parent 0bec197 commit 6e24dc5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ebcc/codegen/bootstrap_DFDCD.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
# Get the energy contractions in pdaggerq format
pq.clear()
pq.set_left_operators([["1"]])
pq.add_st_operator(1.0, ["f"], ["t1", "t2"])
pq.add_st_operator(1.0, ["v"], ["t1", "t2"])
pq.add_st_operator(1.0, ["f"], ["t2"])
pq.add_st_operator(1.0, ["v"], ["t2"])
pq.simplify()
terms = pq.fully_contracted_strings()
terms = remove_reference_energy(terms)
Expand Down
2 changes: 1 addition & 1 deletion ebcc/codegen/bootstrap_DFDCSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
]

# Get the T amplitudes in albert format
output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True)
output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True)

# Generate the T amplitude code
for name, codegen in code_generators.items():
Expand Down
4 changes: 2 additions & 2 deletions ebcc/codegen/bootstrap_MPn.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def postamble():
if tuple(key) in {("o", "o", "v", "v") , ("v", "v", "o", "o")}:
continue
i, j, k, l = ["ov".index(k) for k in key]
codegen.write(f"rdm2.{key} = np.zeros((t1.shape[{i}], t1.shape[{j}], t1.shape[{k}], t1.shape[{l}]))")
codegen.write(f"rdm2.{''.join(key)} = np.zeros((t1.shape[{i}], t1.shape[{j}], t1.shape[{k}], t1.shape[{l}]))")
codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))")
else:
for s in ("aaaa", "aabb", "bbbb"):
Expand All @@ -149,7 +149,7 @@ def postamble():
continue
i, j, k, l = ["ov".index(k) for k in key]
si, sj, sk, sl = s
codegen.write(f"rdm2.{si+sj+sk+sl}.{key} = np.zeros((t1.{si}.shape[{i}], t1.{sj}.shape[{j}], t1.{sk}.shape[{k}], t1.{sl}.shape[{l}]))")
codegen.write(f"rdm2.{si+sj+sk+sl}.{''.join(key)} = np.zeros((t1.{si}.shape[{i}], t1.{sj}.shape[{j}], t1.{sk}.shape[{k}], t1.{sl}.shape[{l}]))")
codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))")
codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))")
codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))")
Expand Down
2 changes: 2 additions & 0 deletions ebcc/codegen/bootstrap_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def get_amplitudes(terms_grouped, spin, strategy="exhaust", which="t", orders=No
for index_spins in get_amplitude_spins(indices[: n + 1], indices[n + 1 :], spin):
expr_n = import_from_pdaggerq(terms, index_spins=index_spins)
expr_n = spin_integrate(expr_n, spin)
if density_fit:
expr_n = tuple(_density_fit(e) for e in expr_n)
output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: indices.index(i.name))), name=f"{which}{order}new") for e in expr_n]
returns_n = (output_n[0],)
expr.extend(expr_n)
Expand Down

0 comments on commit 6e24dc5

Please sign in to comment.