Skip to content

Commit 222968f

Browse files
author
Clang Robot
committed
Committing clang-format changes
1 parent 0b82008 commit 222968f

25 files changed

+357
-364
lines changed

include/macis/asci/alpha_constraint.hpp

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,34 @@ namespace macis {
55

66
template <typename WfnTraits>
77
class alpha_constraint {
8-
9-
public:
10-
using wfn_traits = WfnTraits;
11-
using wfn_type = typename WfnTraits::wfn_type;
12-
using spin_wfn_type = spin_wfn_t<wfn_type>;
8+
public:
9+
using wfn_traits = WfnTraits;
10+
using wfn_type = typename WfnTraits::wfn_type;
11+
using spin_wfn_type = spin_wfn_t<wfn_type>;
1312
using spin_wfn_traits = wavefunction_traits<spin_wfn_type>;
1413
using constraint_type = spin_wfn_type;
1514

16-
private:
15+
private:
1716
constraint_type C_;
1817
constraint_type B_;
19-
uint32_t C_min_;
20-
uint32_t count_;
21-
22-
public:
18+
uint32_t C_min_;
19+
uint32_t count_;
2320

24-
alpha_constraint(constraint_type C, constraint_type B, uint32_t C_min) :
25-
C_(C), B_(B), C_min_(C_min), count_(spin_wfn_traits::count(C)) {}
21+
public:
22+
alpha_constraint(constraint_type C, constraint_type B, uint32_t C_min)
23+
: C_(C), B_(B), C_min_(C_min), count_(spin_wfn_traits::count(C)) {}
2624

2725
alpha_constraint(const alpha_constraint&) = default;
2826
alpha_constraint& operator=(const alpha_constraint&) = default;
2927

3028
alpha_constraint(alpha_constraint&& other) noexcept = default;
3129
alpha_constraint& operator=(alpha_constraint&&) noexcept = default;
32-
3330

34-
inline auto C() const { return C_; }
35-
inline auto B() const { return B_; }
31+
inline auto C() const { return C_; }
32+
inline auto B() const { return B_; }
3633
inline auto C_min() const { return C_min_; }
3734
inline auto count() const { return count_; }
3835

39-
4036
inline spin_wfn_type c_mask_union(spin_wfn_type state) const {
4137
return state & C_;
4238
}
@@ -58,13 +54,9 @@ class alpha_constraint {
5854

5955
template <typename WfnType>
6056
inline bool satisfies_constraint(WfnType state) const {
61-
return overlap(state) == count_ and
57+
return overlap(state) == count_ and
6258
spin_wfn_traits::count(symmetric_difference(state) >> C_min_) == 0;
6359
}
64-
65-
66-
6760
};
6861

69-
70-
}
62+
} // namespace macis

include/macis/asci/determinant_contributions.hpp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct asci_contrib {
2525
template <typename WfnT>
2626
using asci_contrib_container = std::vector<asci_contrib<WfnT>>;
2727

28-
2928
template <Spin Sigma, typename WfnType, typename SpinWfnType>
3029
void append_singles_asci_contributions(
3130
double coeff, WfnType state_full, SpinWfnType state_same,
@@ -52,7 +51,8 @@ void append_singles_asci_contributions(
5251
if(std::abs(h_el) < h_el_tol) continue;
5352

5453
// Calculate Excited Determinant
55-
auto ex_det = wfn_traits::template single_excitation_no_check<Sigma>(state_full, i, a);
54+
auto ex_det = wfn_traits::template single_excitation_no_check<Sigma>(
55+
state_full, i, a);
5656

5757
// Calculate Excitation Sign in a Canonical Way
5858
auto sign = single_excitation_sign(state_same, a, i);
@@ -72,10 +72,10 @@ void append_singles_asci_contributions(
7272
template <Spin Sigma, typename WfnType, typename SpinWfnType>
7373
void append_ss_doubles_asci_contributions(
7474
double coeff, WfnType state_full, SpinWfnType state_same,
75-
SpinWfnType state_other,
76-
const std::vector<uint32_t>& ss_occ, const std::vector<uint32_t>& vir,
77-
const std::vector<uint32_t>& os_occ, const double* eps_same,
78-
const double* G, size_t LDG, double h_el_tol, double root_diag, double E0,
75+
SpinWfnType state_other, const std::vector<uint32_t>& ss_occ,
76+
const std::vector<uint32_t>& vir, const std::vector<uint32_t>& os_occ,
77+
const double* eps_same, const double* G, size_t LDG, double h_el_tol,
78+
double root_diag, double E0,
7979
const HamiltonianGeneratorBase<double>& ham_gen,
8080
asci_contrib_container<WfnType>& asci_contributions) {
8181
using wfn_traits = wavefunction_traits<WfnType>;
@@ -114,14 +114,16 @@ void append_ss_doubles_asci_contributions(
114114
// TODO: Can this be made faster since the orbital indices are known
115115
// in advance?
116116
// Compute excited determinant (spin)
117-
const auto full_ex_spin = spin_wfn_traits::double_excitation_no_check(SpinWfnType(0), i,j,a,b);
117+
const auto full_ex_spin = spin_wfn_traits::double_excitation_no_check(
118+
SpinWfnType(0), i, j, a, b);
118119
const auto ex_det_spin = state_same ^ full_ex_spin;
119120

120121
// Calculate the sign in a canonical way
121122
double sign = doubles_sign(state_same, ex_det_spin, full_ex_spin);
122123

123124
// Calculate full excited determinant
124-
auto ex_det = wfn_traits::template from_spin<Sigma>(ex_det_spin, state_other);
125+
auto ex_det =
126+
wfn_traits::template from_spin<Sigma>(ex_det_spin, state_other);
125127
#endif
126128

127129
// Update sign of matrix element
@@ -148,7 +150,8 @@ void append_os_doubles_asci_contributions(
148150
const std::vector<uint32_t>& vir_alpha,
149151
const std::vector<uint32_t>& vir_beta, const double* eps_alpha,
150152
const double* eps_beta, const double* V, size_t LDV, double h_el_tol,
151-
double root_diag, double E0, const HamiltonianGeneratorBase<double>& ham_gen,
153+
double root_diag, double E0,
154+
const HamiltonianGeneratorBase<double>& ham_gen,
152155
asci_contrib_container<WfnType>& asci_contributions) {
153156
using wfn_traits = wavefunction_traits<WfnType>;
154157
const size_t LDV2 = LDV * LDV;
@@ -166,10 +169,13 @@ void append_os_doubles_asci_contributions(
166169

167170
double sign_beta = single_excitation_sign(state_beta, b, j);
168171
double sign = sign_alpha * sign_beta;
169-
//auto ex_det = state_full;
170-
//ex_det.flip(a).flip(i).flip(j + N).flip(b + N);
171-
auto ex_det = wfn_traits::template single_excitation_no_check<Spin::Alpha>(state_full, a, i);
172-
ex_det = wfn_traits::template single_excitation_no_check<Spin::Beta>(ex_det, b, j);
172+
// auto ex_det = state_full;
173+
// ex_det.flip(a).flip(i).flip(j + N).flip(b + N);
174+
auto ex_det =
175+
wfn_traits::template single_excitation_no_check<Spin::Alpha>(
176+
state_full, a, i);
177+
ex_det = wfn_traits::template single_excitation_no_check<Spin::Beta>(
178+
ex_det, b, j);
173179
auto h_el = sign * V_aibj;
174180

175181
// Evaluate fast diagonal element

include/macis/asci/determinant_search.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_standard(
7272
// Alias state data
7373
auto state = *(cdets_begin + i);
7474
auto state_alpha = wfn_traits::alpha_string(state);
75-
auto state_beta = wfn_traits::beta_string(state);
75+
auto state_beta = wfn_traits::beta_string(state);
7676
auto coeff = C[i];
7777

7878
// Get occupied and virtual indices
@@ -150,10 +150,11 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
150150
wavefunction_iterator_t<N> cdets_end, const double E_ASCI,
151151
const std::vector<double>& C, size_t norb, const double* T_pq,
152152
const double* G_red, const double* V_red, const double* G_pqrs,
153-
const double* V_pqrs, HamiltonianGenerator<wfn_t<N>>& ham_gen, MPI_Comm comm) {
153+
const double* V_pqrs, HamiltonianGenerator<wfn_t<N>>& ham_gen,
154+
MPI_Comm comm) {
154155
using clock_type = std::chrono::high_resolution_clock;
155156
using duration_type = std::chrono::duration<double, std::milli>;
156-
using wfn_traits = wavefunction_traits<wfn_t<N>>;
157+
using wfn_traits = wavefunction_traits<wfn_t<N>>;
157158
using spin_wfn_type = spin_wfn_t<wfn_t<N>>;
158159
using spin_wfn_traits = wavefunction_traits<spin_wfn_type>;
159160

@@ -294,9 +295,9 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
294295
const auto& occ_beta = bcd.occ_beta;
295296
const auto& orb_ens_alpha = bcd.orb_ens_alpha;
296297
generate_constraint_singles_contributions_ss(
297-
coeff, det|beta, con, occ_alpha, occ_beta,
298-
orb_ens_alpha.data(), T_pq, norb, G_red, norb, V_red, norb,
299-
h_el_tol, h_diag, E_ASCI, ham_gen, asci_pairs);
298+
coeff, det | beta, con, occ_alpha, occ_beta, orb_ens_alpha.data(),
299+
T_pq, norb, G_red, norb, V_red, norb, h_el_tol, h_diag, E_ASCI,
300+
ham_gen, asci_pairs);
300301
}
301302

302303
// AAAA excitations
@@ -307,9 +308,8 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
307308
const auto& occ_beta = bcd.occ_beta;
308309
const auto& orb_ens_alpha = bcd.orb_ens_alpha;
309310
generate_constraint_doubles_contributions_ss(
310-
coeff, det|beta, con, occ_alpha, occ_beta,
311-
orb_ens_alpha.data(), G_pqrs, norb, h_el_tol, h_diag, E_ASCI,
312-
ham_gen, asci_pairs);
311+
coeff, det | beta, con, occ_alpha, occ_beta, orb_ens_alpha.data(),
312+
G_pqrs, norb, h_el_tol, h_diag, E_ASCI, ham_gen, asci_pairs);
313313
}
314314

315315
// AABB excitations
@@ -322,7 +322,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
322322
const auto& orb_ens_alpha = bcd.orb_ens_alpha;
323323
const auto& orb_ens_beta = bcd.orb_ens_beta;
324324
generate_constraint_doubles_contributions_os(
325-
coeff, det|beta, con, occ_alpha, occ_beta, vir_beta,
325+
coeff, det | beta, con, occ_alpha, occ_beta, vir_beta,
326326
orb_ens_alpha.data(), orb_ens_beta.data(), V_pqrs, norb, h_el_tol,
327327
h_diag, E_ASCI, ham_gen, asci_pairs);
328328
}
@@ -340,7 +340,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
340340

341341
const auto state = det | beta;
342342
const auto state_alpha = wfn_traits::alpha_string(state);
343-
const auto state_beta = wfn_traits::beta_string(beta);
343+
const auto state_beta = wfn_traits::beta_string(beta);
344344
// BB Excitations
345345
append_singles_asci_contributions<Spin::Beta>(
346346
coeff, state, state_beta, occ_beta, vir_beta, occ_alpha,
@@ -349,9 +349,9 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
349349

350350
// BBBB Excitations
351351
append_ss_doubles_asci_contributions<Spin::Beta>(
352-
coeff, state, state_beta, state_alpha, occ_beta, vir_beta, occ_alpha,
353-
eps_beta.data(), G_pqrs, norb, h_el_tol, h_diag, E_ASCI, ham_gen,
354-
asci_pairs);
352+
coeff, state, state_beta, state_alpha, occ_beta, vir_beta,
353+
occ_alpha, eps_beta.data(), G_pqrs, norb, h_el_tol, h_diag,
354+
E_ASCI, ham_gen, asci_pairs);
355355

356356
} // Beta Loop
357357
} // Triplet Check

include/macis/asci/iteration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#pragma once
1010
#include <macis/asci/determinant_search.hpp>
11-
#include <macis/solvers/selected_ci_diag.hpp>
1211
#include <macis/mcscf/mcscf.hpp>
12+
#include <macis/solvers/selected_ci_diag.hpp>
1313

1414
namespace macis {
1515

0 commit comments

Comments
 (0)