Skip to content

Commit

Permalink
start_stride for add_sum_term
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jan 16, 2025
1 parent c41ab56 commit 725d3df
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/integral_general.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ template <typename FL> struct GeneralFCIDUMP {
FL factor = (FL)1.0,
const vector<int> &orb_sym = vector<int>(),
vector<uint16_t> rperm = vector<uint16_t>(),
int target_irrep = 0) {
int target_irrep = 0, size_t start_stride = 0) {
int ntg = threading->activate_global();
vector<size_t> lens(ntg + 1, 0);
const size_t plen = len / ntg + !!(len % ntg);
Expand All @@ -284,7 +284,8 @@ template <typename FL> struct GeneralFCIDUMP {
if (abs(factor * vals[i]) > cutoff) {
for (int j = 0; j < (int)shape.size(); j++)
indices.back()[istart * shape.size() + rperm[j]] =
(uint16_t)(i / strides[j] % shape[j]);
(uint16_t)((i + start_stride) / strides[j] %
shape[j]);
data.back()[istart] = factor * vals[i];
istart++;
}
Expand All @@ -294,8 +295,10 @@ template <typename FL> struct GeneralFCIDUMP {
int irrep = target_irrep;
for (int j = 0; j < (int)shape.size(); j++) {
indices.back()[istart * shape.size() + rperm[j]] =
(uint16_t)(i / strides[j] % shape[j]);
irrep ^= orb_sym[i / strides[j] % shape[j]];
(uint16_t)((i + start_stride) / strides[j] %
shape[j]);
irrep ^= orb_sym[(i + start_stride) / strides[j] %
shape[j]];
}
data.back()[istart] = factor * vals[i] * (FL)(!irrep);
istart++;
Expand Down

0 comments on commit 725d3df

Please sign in to comment.