Skip to content

Commit

Permalink
Revert accidental removal of unrestricted xc kernel routine.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcscott committed Aug 8, 2023
1 parent a31853c commit 825e965
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions vayesta/rpa/rirpa/RIURPA.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,45 @@ def get_apb_eri_ri(self):

return ri_apb_eri, ri_neg_apb_eri

Check warning on line 119 in vayesta/rpa/rirpa/RIURPA.py

View check run for this annotation

Codecov / codecov/patch

vayesta/rpa/rirpa/RIURPA.py#L119

Added line #L119 was not covered by tests

def get_ab_xc_ri(self):
# Have low-rank representation for interactions over and above coulomb interaction.
# Note that this is usually asymmetric, as correction is non-PSD.
ri_a_aa = [
einsum(
"npq,pi,qa->nia", x, self.mo_coeff_occ[0], self.mo_coeff_vir[0]
).reshape((-1, self.ov[0]))
for x in self.rixc[0]
]
ri_a_bb = [
einsum(
"npq,pi,qa->nia", x, self.mo_coeff_occ[1], self.mo_coeff_vir[1]
).reshape((-1, self.ov[1]))
for x in self.rixc[1]
]

ri_b_aa = [
ri_a_aa[0],
einsum(
"npq,qi,pa->nia",
self.rixc[0][1],
self.mo_coeff_occ[0],
self.mo_coeff_vir[0],
).reshape((-1, self.ov[0])),
]
ri_b_bb = [
ri_a_bb[0],
einsum(
"npq,qi,pa->nia",
self.rixc[1][1],
self.mo_coeff_occ[1],
self.mo_coeff_vir[1],
).reshape((-1, self.ov[1])),
]

ri_a_xc = [np.concatenate([x, y], axis=1) for x, y in zip(ri_a_aa, ri_a_bb)]
ri_b_xc = [np.concatenate([x, y], axis=1) for x, y in zip(ri_b_aa, ri_b_bb)]
return ri_a_xc, ri_b_xc

def get_cderi(self, blksize=None):
if self.lov is None:
la, la_neg = get_cderi(self, (self.mo_coeff_occ[0], self.mo_coeff_vir[0]), compact=False, blksize=blksize)
Expand Down

0 comments on commit 825e965

Please sign in to comment.