Skip to content

Commit 0b82008

Browse files
Merge branch 'feature/pt2' of github.com:wavefunction91/MACIS into feature/pt2
2 parents e224338 + 5e9f7fe commit 0b82008

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

include/macis/asci/determinant_contributions.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct asci_contrib {
1818
WfnT state;
1919
double c_times_matel;
2020
double h_diag;
21-
21+
2222
auto rv() const { return c_times_matel / h_diag; }
2323
};
2424

@@ -61,7 +61,7 @@ void append_singles_asci_contributions(
6161
// Calculate fast diagonal matrix element
6262
auto h_diag =
6363
ham_gen.fast_diag_single(eps_same[i], eps_same[a], i, a, root_diag);
64-
//h_el /= (E0 - h_diag);
64+
// h_el /= (E0 - h_diag);
6565

6666
// Append to return values
6767
asci_contributions.push_back({ex_det, coeff * h_el, E0 - h_diag});
@@ -131,7 +131,7 @@ void append_ss_doubles_asci_contributions(
131131
auto h_diag =
132132
ham_gen.fast_diag_ss_double(eps_same[i], eps_same[j], eps_same[a],
133133
eps_same[b], i, j, a, b, root_diag);
134-
//h_el /= (E0 - h_diag);
134+
// h_el /= (E0 - h_diag);
135135

136136
// Append {det, c*h_el}
137137
asci_contributions.push_back({ex_det, coeff * h_el, E0 - h_diag});
@@ -176,7 +176,7 @@ void append_os_doubles_asci_contributions(
176176
auto h_diag = ham_gen.fast_diag_os_double(eps_alpha[i], eps_beta[j],
177177
eps_alpha[a], eps_beta[b],
178178
i, j, a, b, root_diag);
179-
//h_el /= (E0 - h_diag);
179+
// h_el /= (E0 - h_diag);
180180

181181
asci_contributions.push_back({ex_det, coeff * h_el, E0 - h_diag});
182182
} // BJ loop

include/macis/asci/determinant_search.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ std::vector<wfn_t<N>> asci_search(
534534
// Finalize scores
535535
for(auto& x : asci_pairs) {
536536
x.c_times_matel = -std::abs(x.c_times_matel);
537-
x.h_diag = std::abs(x.h_diag);
537+
x.h_diag = std::abs(x.h_diag);
538538
}
539539

540540
// Insert all dets with their coefficients as seeds

include/macis/asci/determinant_sort.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void keep_only_largest_copy_asci_pairs(
108108

109109
// Keep only max value
110110
else {
111-
cur_it->c_times_matel = std::max(cur_it->c_times_matel, it->c_times_matel);
111+
cur_it->c_times_matel =
112+
std::max(cur_it->c_times_matel, it->c_times_matel);
112113
}
113114
}
114115

include/macis/asci/mask_constraints.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ void generate_constraint_singles_contributions_ss(
225225
const size_t LDV2 = LDV * LDV;
226226
for(int ii = 0; ii < no; ++ii) {
227227
const auto i = fls(o);
228-
o.flip(i); // Disable "i"-bit so it's not used in FLS next iteration
228+
o.flip(i); // Disable "i"-bit so it's not used in FLS next iteration
229229
auto v_cpy = v;
230230
for(int aa = 0; aa < nv; ++aa) {
231231
const auto a = fls(v_cpy);
232-
v_cpy.flip(a); // Disable "a"-bit so it's not used in FLS next iteration
232+
v_cpy.flip(a); // Disable "a"-bit so it's not used in FLS next iteration
233233

234234
double h_el = T_pq[a + i * LDT];
235235
const double* G_ov = G_kpq + a * LDG + i * LDG2;
@@ -250,7 +250,7 @@ void generate_constraint_singles_contributions_ss(
250250

251251
// Compute Fast Diagonal Matrix Element
252252
auto h_diag = ham_gen.fast_diag_single(eps[i], eps[a], i, a, root_diag);
253-
//h_el /= (E0 - h_diag);
253+
// h_el /= (E0 - h_diag);
254254

255255
asci_contributions.push_back({ex_det, coeff * h_el, E0 - h_diag});
256256
}
@@ -305,7 +305,7 @@ void generate_constraint_doubles_contributions_ss(
305305
// Evaluate fast diagonal matrix element
306306
auto h_diag = ham_gen.fast_diag_ss_double(eps[i], eps[j], eps[a], eps[b],
307307
i, j, a, b, root_diag);
308-
//h_el /= (E0 - h_diag);
308+
// h_el /= (E0 - h_diag);
309309

310310
asci_contributions.push_back({full_ex, coeff * h_el, E0 - h_diag});
311311
}
@@ -366,7 +366,7 @@ void generate_constraint_doubles_contributions_os(
366366
auto h_diag =
367367
ham_gen.fast_diag_os_double(eps_same[i], eps_othr[j], eps_same[a],
368368
eps_othr[b], i, j, a, b, root_diag);
369-
//h_el /= (E0 - h_diag);
369+
// h_el /= (E0 - h_diag);
370370

371371
asci_contributions.push_back({ex_det, coeff * h_el, E0 - h_diag});
372372
} // BJ

tests/standalone_driver.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include <iomanip>
1616
#include <iostream>
1717
#include <macis/asci/grow.hpp>
18-
#include <macis/asci/refine.hpp>
1918
#include <macis/asci/pt2.hpp>
19+
#include <macis/asci/refine.hpp>
2020
#include <macis/hamiltonian_generator/double_loop.hpp>
2121
#include <macis/util/detail/rdm_files.hpp>
2222
#include <macis/util/fcidump.hpp>
@@ -384,9 +384,10 @@ int main(int argc, char** argv) {
384384
}
385385
#endif
386386
if(pt2) {
387-
EPT2 = macis::asci_pt2_constraint( dets.begin(), dets.end(), E0 -(E_inactive + E_core), C, n_active,
388-
ham_gen.T(), ham_gen.G_red(), ham_gen.V_red(),ham_gen.G(), ham_gen.V(),
389-
ham_gen MACIS_MPI_CODE(, MPI_COMM_WORLD));
387+
EPT2 = macis::asci_pt2_constraint(
388+
dets.begin(), dets.end(), E0 - (E_inactive + E_core), C, n_active,
389+
ham_gen.T(), ham_gen.G_red(), ham_gen.V_red(), ham_gen.G(),
390+
ham_gen.V(), ham_gen MACIS_MPI_CODE(, MPI_COMM_WORLD));
390391
}
391392
}
392393

@@ -397,8 +398,7 @@ int main(int argc, char** argv) {
397398
console->info("E(CI+PT2) = {:.12f} Eh", E0 + EPT2);
398399
}
399400

400-
401-
// MCSCF
401+
// MCSCF
402402
} else if(job == Job::MCSCF) {
403403
// Possibly read active RDMs
404404
if(rdm_fname.size()) {

0 commit comments

Comments
 (0)