Skip to content

Commit 997c4c5

Browse files
author
carlos mejuto zaera
committed
Allowed for spin-dependent 1-body Hamiltonians, for the CAS functionalities (not the CASSCF ones). Appropriately adapted the calculation of 1- and 2-RDMs
1 parent 8930b91 commit 997c4c5

File tree

14 files changed

+248
-114
lines changed

14 files changed

+248
-114
lines changed

include/macis/asci/determinant_search.hpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ template <size_t N>
5454
asci_contrib_container<wfn_t<N>> asci_contributions_standard(
5555
ASCISettings asci_settings, wavefunction_iterator_t<N> cdets_begin,
5656
wavefunction_iterator_t<N> cdets_end, const double E_ASCI,
57-
const std::vector<double>& C, size_t norb, const double* T_pq,
58-
const double* G_red, const double* V_red, const double* G_pqrs,
59-
const double* V_pqrs, HamiltonianGenerator<N>& ham_gen) {
57+
const std::vector<double>& C, size_t norb, const double* Tu_pq,
58+
const double* Td_pq, const double* G_red, const double* V_red,
59+
const double* G_pqrs, const double* V_pqrs,
60+
HamiltonianGenerator<N>& ham_gen) {
6061
auto logger = spdlog::get("asci_search");
6162

6263
const size_t ncdets = std::distance(cdets_begin, cdets_end);
@@ -77,8 +78,8 @@ asci_contrib_container<wfn_t<N>> asci_contributions_standard(
7778
bitset_to_occ_vir(norb, state_beta, occ_beta, vir_beta);
7879

7980
// Precompute orbital energies
80-
auto eps_alpha = ham_gen.single_orbital_ens(norb, occ_alpha, occ_beta);
81-
auto eps_beta = ham_gen.single_orbital_ens(norb, occ_beta, occ_alpha);
81+
auto eps_alpha = ham_gen.single_orbital_ens(norb, occ_alpha, occ_beta, ham_gen.Tu_pq_);
82+
auto eps_beta = ham_gen.single_orbital_ens(norb, occ_beta, occ_alpha, ham_gen.Td_pq_);
8283

8384
// Compute base diagonal matrix element
8485
double h_diag = ham_gen.matrix_element(state, state);
@@ -88,13 +89,13 @@ asci_contrib_container<wfn_t<N>> asci_contributions_standard(
8889
// Singles - AA
8990
append_singles_asci_contributions<(N / 2), 0>(
9091
coeff, state, state_alpha, occ_alpha, vir_alpha, occ_beta,
91-
eps_alpha.data(), T_pq, norb, G_red, norb, V_red, norb, h_el_tol,
92+
eps_alpha.data(), Tu_pq, norb, G_red, norb, V_red, norb, h_el_tol,
9293
h_diag, E_ASCI, ham_gen, asci_pairs);
9394

9495
// Singles - BB
9596
append_singles_asci_contributions<(N / 2), (N / 2)>(
9697
coeff, state, state_beta, occ_beta, vir_beta, occ_alpha,
97-
eps_beta.data(), T_pq, norb, G_red, norb, V_red, norb, h_el_tol, h_diag,
98+
eps_beta.data(), Td_pq, norb, G_red, norb, V_red, norb, h_el_tol, h_diag,
9899
E_ASCI, ham_gen, asci_pairs);
99100

100101
if(not asci_settings.just_singles) {
@@ -145,9 +146,10 @@ template <size_t N>
145146
asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
146147
ASCISettings asci_settings, wavefunction_iterator_t<N> cdets_begin,
147148
wavefunction_iterator_t<N> cdets_end, const double E_ASCI,
148-
const std::vector<double>& C, size_t norb, const double* T_pq,
149-
const double* G_red, const double* V_red, const double* G_pqrs,
150-
const double* V_pqrs, HamiltonianGenerator<N>& ham_gen, MPI_Comm comm) {
149+
const std::vector<double>& C, size_t norb, const double* Tu_pq,
150+
const double* Td_pq, const double* G_red, const double* V_red,
151+
const double* G_pqrs, const double* V_pqrs,
152+
HamiltonianGenerator<N>& ham_gen, MPI_Comm comm) {
151153
using clock_type = std::chrono::high_resolution_clock;
152154
using duration_type = std::chrono::duration<double, std::milli>;
153155

@@ -198,8 +200,8 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
198200
bitset_to_occ_vir(norb, beta_shift, occ_beta, vir_beta);
199201

200202
// Precompute orbital energies
201-
orb_ens_alpha = ham_gen.single_orbital_ens(norb, occ_alpha, occ_beta);
202-
orb_ens_beta = ham_gen.single_orbital_ens(norb, occ_beta, occ_alpha);
203+
orb_ens_alpha = ham_gen.single_orbital_ens(norb, occ_alpha, occ_beta, ham_gen.Tu_pq_);
204+
orb_ens_beta = ham_gen.single_orbital_ens(norb, occ_beta, occ_alpha, ham_gen.Td_pq_);
203205
}
204206
};
205207

@@ -291,7 +293,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
291293
const auto& orb_ens_alpha = bcd.orb_ens_alpha;
292294
generate_constraint_singles_contributions_ss(
293295
coeff, det, C, O, B, beta, occ_alpha, occ_beta,
294-
orb_ens_alpha.data(), T_pq, norb, G_red, norb, V_red, norb,
296+
orb_ens_alpha.data(), Tu_pq, norb, G_red, norb, V_red, norb,
295297
h_el_tol, h_diag, E_ASCI, ham_gen, asci_pairs);
296298
}
297299

@@ -339,7 +341,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
339341
// BB Excitations
340342
append_singles_asci_contributions<(N / 2), (N / 2)>(
341343
coeff, state, state_beta, occ_beta, vir_beta, occ_alpha,
342-
eps_beta.data(), T_pq, norb, G_red, norb, V_red, norb, h_el_tol,
344+
eps_beta.data(), Td_pq, norb, G_red, norb, V_red, norb, h_el_tol,
343345
h_diag, E_ASCI, ham_gen, asci_pairs);
344346

345347
// BBBB Excitations
@@ -396,9 +398,9 @@ std::vector<wfn_t<N>> asci_search(
396398
ASCISettings asci_settings, size_t ndets_max,
397399
wavefunction_iterator_t<N> cdets_begin,
398400
wavefunction_iterator_t<N> cdets_end, const double E_ASCI,
399-
const std::vector<double>& C, size_t norb, const double* T_pq,
400-
const double* G_red, const double* V_red, const double* G_pqrs,
401-
const double* V_pqrs,
401+
const std::vector<double>& C, size_t norb, const double* Tu_pq,
402+
const double* Td_pq, const double* G_red, const double* V_red,
403+
const double* G_pqrs, const double* V_pqrs,
402404
HamiltonianGenerator<N>& ham_gen MACIS_MPI_CODE(, MPI_Comm comm)) {
403405
using clock_type = std::chrono::high_resolution_clock;
404406
using duration_type = std::chrono::duration<double>;
@@ -446,13 +448,13 @@ std::vector<wfn_t<N>> asci_search(
446448
asci_contrib_container<wfn_t<N>> asci_pairs;
447449
if(world_size == 1)
448450
asci_pairs = asci_contributions_standard(
449-
asci_settings, cdets_begin, cdets_end, E_ASCI, C, norb, T_pq, G_red,
450-
V_red, G_pqrs, V_pqrs, ham_gen);
451+
asci_settings, cdets_begin, cdets_end, E_ASCI, C, norb, Tu_pq, Td_pq,
452+
G_red, V_red, G_pqrs, V_pqrs, ham_gen);
451453
#ifdef MACIS_ENABLE_MPI
452454
else
453455
asci_pairs = asci_contributions_constraint(
454-
asci_settings, cdets_begin, cdets_end, E_ASCI, C, norb, T_pq, G_red,
455-
V_red, G_pqrs, V_pqrs, ham_gen MACIS_MPI_CODE(, comm));
456+
asci_settings, cdets_begin, cdets_end, E_ASCI, C, norb, Tu_pq, Td_pq,
457+
G_red, V_red, G_pqrs, V_pqrs, ham_gen MACIS_MPI_CODE(, comm));
456458
#endif
457459
auto pairs_en = clock_type::now();
458460

include/macis/asci/grow.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ auto asci_grow(ASCISettings asci_settings, MCSCFSettings mcscf_settings,
102102

103103
logger->trace(" * Doing Natural Orbital Rotation");
104104
auto rot_st = hrt_t::now();
105-
macis::two_index_transform(norb, norb, ham_gen.T(), norb, ordm.data(),
106-
norb, ham_gen.T(), norb);
105+
macis::two_index_transform(norb, norb, ham_gen.Tu(), norb, ordm.data(),
106+
norb, ham_gen.Tu(), norb);
107+
macis::two_index_transform(norb, norb, ham_gen.Td(), norb, ordm.data(),
108+
norb, ham_gen.Td(), norb);
107109
macis::four_index_transform(norb, norb, ham_gen.V(), norb, ordm.data(),
108110
norb, ham_gen.V(), norb);
109111
auto rot_en = hrt_t::now();
@@ -114,7 +116,8 @@ auto asci_grow(ASCISettings asci_settings, MCSCFSettings mcscf_settings,
114116
// Broadcast rotated integrals
115117
#ifdef MACIS_ENABLE_MPI
116118
if(world_size > 1) {
117-
bcast(ham_gen.T(), norb * norb, 0, comm);
119+
bcast(ham_gen.Tu(), norb * norb, 0, comm);
120+
bcast(ham_gen.Td(), norb * norb, 0, comm);
118121
bcast(ham_gen.V(), norb * norb * norb * norb, 0, comm);
119122
}
120123
#endif

include/macis/asci/iteration.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ auto asci_iter(ASCISettings asci_settings, MCSCFSettings mcscf_settings,
2626

2727
// Perform the ASCI search
2828
wfn = asci_search(asci_settings, ndets_max, wfn.begin(), wfn.begin() + nkeep,
29-
E0, X, norb, ham_gen.T(), ham_gen.G_red(), ham_gen.V_red(),
30-
ham_gen.G(), ham_gen.V(), ham_gen MACIS_MPI_CODE(, comm));
29+
E0, X, norb, ham_gen.Tu(), ham_gen.Td(), ham_gen.G_red(),
30+
ham_gen.V_red(), ham_gen.G(), ham_gen.V(),
31+
ham_gen MACIS_MPI_CODE(, comm));
3132

3233
// Rediagonalize
3334
std::vector<double> X_local; // Precludes guess reuse

include/macis/hamiltonian_generator.hpp

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class HamiltonianGenerator {
4040
size_t norb_;
4141
size_t norb2_;
4242
size_t norb3_;
43-
matrix_span_t T_pq_;
43+
matrix_span_t Tu_pq_;
44+
matrix_span_t Td_pq_;
4445
rank4_span_t V_pqrs_;
4546

4647
// G(i,j,k,l) = (ij|kl) - (il|kj)
@@ -72,12 +73,15 @@ class HamiltonianGenerator {
7273
full_det_iterator, double) = 0;
7374

7475
public:
75-
HamiltonianGenerator(matrix_span_t T, rank4_span_t V);
76+
HamiltonianGenerator(matrix_span_t Tu, rank4_span_t V);
7677
virtual ~HamiltonianGenerator() noexcept = default;
7778

79+
void ReadTdo( matrix_span_t Td );
80+
7881
void generate_integral_intermediates(rank4_span_t V);
7982

80-
inline auto* T() const { return T_pq_.data_handle(); }
83+
inline auto* Tu() const { return Tu_pq_.data_handle(); }
84+
inline auto* Td() const { return Td_pq_.data_handle(); }
8185
inline auto* G_red() const { return G_red_data_.data(); }
8286
inline auto* V_red() const { return V_red_data_.data(); }
8387
inline auto* G() const { return G_pqrs_data_.data(); }
@@ -90,7 +94,8 @@ class HamiltonianGenerator {
9094

9195
double matrix_element_2(spin_det_t bra, spin_det_t ket, spin_det_t ex,
9296
const std::vector<uint32_t>& bra_occ_alpha,
93-
const std::vector<uint32_t>& bra_occ_beta) const;
97+
const std::vector<uint32_t>& bra_occ_beta,
98+
const matrix_span_t& T_pq_) const;
9499

95100
double matrix_element_diag(const std::vector<uint32_t>& occ_alpha,
96101
const std::vector<uint32_t>& occ_beta) const;
@@ -102,15 +107,18 @@ class HamiltonianGenerator {
102107
const std::vector<uint32_t>& bra_occ_beta) const;
103108

104109
double single_orbital_en(uint32_t orb, const std::vector<uint32_t>& ss_occ,
105-
const std::vector<uint32_t>& os_occ) const;
110+
const std::vector<uint32_t>& os_occ,
111+
const matrix_span_t& T_pq_) const;
106112

107113
std::vector<double> single_orbital_ens(
108114
size_t norb, const std::vector<uint32_t>& ss_occ,
109-
const std::vector<uint32_t>& os_occ) const;
115+
const std::vector<uint32_t>& os_occ,
116+
const matrix_span_t& T_pq_) const;
110117

111118
double fast_diag_single(const std::vector<uint32_t>& ss_occ,
112119
const std::vector<uint32_t>& os_occ, uint32_t orb_hol,
113-
uint32_t orb_par, double orig_det_Hii) const;
120+
uint32_t orb_par, double orig_det_Hii,
121+
const matrix_span_t& T_pq_) const;
114122

115123
double fast_diag_single(double hol_en, double par_en, uint32_t orb_hol,
116124
uint32_t orb_par, double orig_det_Hii) const;
@@ -124,7 +132,8 @@ class HamiltonianGenerator {
124132
const std::vector<uint32_t>& os_occ,
125133
uint32_t orb_hol1, uint32_t orb_hol2,
126134
uint32_t orb_par1, uint32_t orb_par2,
127-
double orig_det_Hii) const;
135+
double orig_det_Hii,
136+
const matrix_span_t& T_pq_) const;
128137

129138
double fast_diag_os_double(double en_holu, double en_hold, double en_paru,
130139
double en_pard, uint32_t orb_holu,
@@ -160,21 +169,32 @@ class HamiltonianGenerator {
160169
void rdm_contributions_22(spin_det_t bra_alpha, spin_det_t ket_alpha,
161170
spin_det_t ex_alpha, spin_det_t bra_beta,
162171
spin_det_t ket_beta, spin_det_t ex_beta, double val,
163-
rank4_span_t trdm);
172+
rank4_span_t trdm_ud, rank4_span_t trdm_du);
164173
void rdm_contributions_2(spin_det_t bra, spin_det_t ket, spin_det_t ex,
165174
const std::vector<uint32_t>& bra_occ_alpha,
166175
const std::vector<uint32_t>& bra_occ_beta,
167-
double val, matrix_span_t ordm, rank4_span_t trdm);
176+
double val, matrix_span_t ordm, rank4_span_t trdm_ss,
177+
rank4_span_t trdm_so, rank4_span_t trdm_os);
168178
void rdm_contributions_diag(const std::vector<uint32_t>& occ_alpha,
169179
const std::vector<uint32_t>& occ_beta, double val,
170-
matrix_span_t ordm, rank4_span_t trdm);
180+
matrix_span_t ordm_u, matrix_span_t ordm_d,
181+
rank4_span_t trdm_uu, rank4_span_t trdm_ud,
182+
rank4_span_t trdm_du, rank4_span_t trdm_dd);
171183

172184
void rdm_contributions(spin_det_t bra_alpha, spin_det_t ket_alpha,
173185
spin_det_t ex_alpha, spin_det_t bra_beta,
174186
spin_det_t ket_beta, spin_det_t ex_beta,
175187
const std::vector<uint32_t>& bra_occ_alpha,
176188
const std::vector<uint32_t>& bra_occ_beta, double val,
177-
matrix_span_t ordm, rank4_span_t trdm);
189+
matrix_span_t ordm_u, matrix_span_t ordm_d,
190+
rank4_span_t trdm_uu, rank4_span_t trdm_ud,
191+
rank4_span_t trdm_du, rank4_span_t trdm_dd);
192+
193+
virtual void form_rdms(full_det_iterator, full_det_iterator,
194+
full_det_iterator, full_det_iterator, double* C,
195+
matrix_span_t ordm_u, matrix_span_t ordm_d,
196+
rank4_span_t trdm_uu, rank4_span_t trdm_ud,
197+
rank4_span_t trdm_du, rank4_span_t trdm_dd) = 0;
178198

179199
virtual void form_rdms(full_det_iterator, full_det_iterator,
180200
full_det_iterator, full_det_iterator, double* C,

include/macis/hamiltonian_generator/double_loop.hpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ class DoubleLoopHamiltonianGenerator : public HamiltonianGenerator<N> {
116116
public:
117117
void form_rdms(full_det_iterator bra_begin, full_det_iterator bra_end,
118118
full_det_iterator ket_begin, full_det_iterator ket_end,
119-
double *C, matrix_span_t ordm, rank4_span_t trdm) override {
119+
double *C, matrix_span_t ordm_u, matrix_span_t ordm_d,
120+
rank4_span_t trdm_uu, rank4_span_t trdm_ud,
121+
rank4_span_t trdm_du, rank4_span_t trdm_dd) override {
120122
const size_t nbra_dets = std::distance(bra_begin, bra_end);
121123
const size_t nket_dets = std::distance(ket_begin, ket_end);
122124

@@ -153,7 +155,8 @@ class DoubleLoopHamiltonianGenerator : public HamiltonianGenerator<N> {
153155
if(std::abs(val) > 1e-16) {
154156
rdm_contributions(bra_alpha, ket_alpha, ex_alpha, bra_beta,
155157
ket_beta, ex_beta, bra_occ_alpha,
156-
bra_occ_beta, val, ordm, trdm);
158+
bra_occ_beta, val, ordm_u, ordm_d,
159+
trdm_uu, trdm_ud, trdm_du, trdm_dd);
157160
}
158161
} // Possible non-zero connection (Hamming distance)
159162

@@ -164,6 +167,14 @@ class DoubleLoopHamiltonianGenerator : public HamiltonianGenerator<N> {
164167
} // Loop over bra determinants
165168
}
166169

170+
void form_rdms(full_det_iterator bra_begin, full_det_iterator bra_end,
171+
full_det_iterator ket_begin, full_det_iterator ket_end,
172+
double *C, matrix_span_t ordm, rank4_span_t trdm) override {
173+
form_rdms( bra_begin, bra_end, ket_begin, ket_end,
174+
C, ordm, ordm,
175+
trdm, trdm, trdm, trdm);
176+
}
177+
167178
public:
168179
template <typename... Args>
169180
DoubleLoopHamiltonianGenerator(Args &&...args)

include/macis/hamiltonian_generator/fast_diagonals.hpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace macis {
1414
template <size_t N>
1515
double HamiltonianGenerator<N>::single_orbital_en(
1616
uint32_t orb, const std::vector<uint32_t>& ss_occ,
17-
const std::vector<uint32_t>& os_occ) const {
17+
const std::vector<uint32_t>& os_occ,
18+
const matrix_span_t& T_pq_) const {
1819
// One electron component
1920
double orb_en = T_pq_(orb, orb);
2021

@@ -31,7 +32,8 @@ double HamiltonianGenerator<N>::single_orbital_en(
3132
template <size_t N>
3233
std::vector<double> HamiltonianGenerator<N>::single_orbital_ens(
3334
size_t norb, const std::vector<uint32_t>& ss_occ,
34-
const std::vector<uint32_t>& os_occ) const {
35+
const std::vector<uint32_t>& os_occ,
36+
const matrix_span_t& T_pq_) const {
3537
std::vector<double> ens(norb);
3638
for(size_t i = 0; i < norb; ++i) {
3739
// One electron component
@@ -63,9 +65,10 @@ template <size_t N>
6365
double HamiltonianGenerator<N>::fast_diag_single(
6466
// These refer to original determinant
6567
const std::vector<uint32_t>& ss_occ, const std::vector<uint32_t>& os_occ,
66-
uint32_t orb_hol, uint32_t orb_par, double orig_det_Hii) const {
67-
const auto hol_en = single_orbital_en(orb_hol, ss_occ, os_occ);
68-
const auto par_en = single_orbital_en(orb_par, ss_occ, os_occ);
68+
uint32_t orb_hol, uint32_t orb_par, double orig_det_Hii,
69+
const matrix_span_t& T_pq_) const {
70+
const auto hol_en = single_orbital_en(orb_hol, ss_occ, os_occ, T_pq_);
71+
const auto par_en = single_orbital_en(orb_par, ss_occ, os_occ, T_pq_);
6972
return fast_diag_single(hol_en, par_en, orb_hol, orb_par, orig_det_Hii);
7073
}
7174

@@ -89,11 +92,11 @@ double HamiltonianGenerator<N>::fast_diag_ss_double(
8992
// These refer to original determinant
9093
const std::vector<uint32_t>& ss_occ, const std::vector<uint32_t>& os_occ,
9194
uint32_t orb_hol1, uint32_t orb_hol2, uint32_t orb_par1, uint32_t orb_par2,
92-
double orig_det_Hii) const {
93-
auto hol1_en = single_orbital_en(orb_hol1, ss_occ, os_occ);
94-
auto hol2_en = single_orbital_en(orb_hol2, ss_occ, os_occ);
95-
auto par1_en = single_orbital_en(orb_par1, ss_occ, os_occ);
96-
auto par2_en = single_orbital_en(orb_par2, ss_occ, os_occ);
95+
double orig_det_Hii, const matrix_span_t& T_pq_) const {
96+
auto hol1_en = single_orbital_en(orb_hol1, ss_occ, os_occ, T_pq_);
97+
auto hol2_en = single_orbital_en(orb_hol2, ss_occ, os_occ, T_pq_);
98+
auto par1_en = single_orbital_en(orb_par1, ss_occ, os_occ, T_pq_);
99+
auto par2_en = single_orbital_en(orb_par2, ss_occ, os_occ, T_pq_);
97100
return fast_diag_ss_double(hol1_en, hol2_en, par1_en, par2_en, orb_hol1,
98101
orb_hol2, orb_par1, orb_par2, orig_det_Hii);
99102
}
@@ -117,10 +120,10 @@ double HamiltonianGenerator<N>::fast_diag_os_double(
117120
const std::vector<uint32_t>& ss_occ, const std::vector<uint32_t>& os_occ,
118121
uint32_t orb_holu, uint32_t orb_hold, uint32_t orb_paru, uint32_t orb_pard,
119122
double orig_det_Hii) const {
120-
auto holu_en = single_orbital_en(orb_holu, ss_occ, os_occ);
121-
auto hold_en = single_orbital_en(orb_hold, os_occ, ss_occ);
122-
auto paru_en = single_orbital_en(orb_paru, ss_occ, os_occ);
123-
auto pard_en = single_orbital_en(orb_pard, os_occ, ss_occ);
123+
auto holu_en = single_orbital_en(orb_holu, ss_occ, os_occ, Tu_pq_);
124+
auto hold_en = single_orbital_en(orb_hold, os_occ, ss_occ, Td_pq_);
125+
auto paru_en = single_orbital_en(orb_paru, ss_occ, os_occ, Tu_pq_);
126+
auto pard_en = single_orbital_en(orb_pard, os_occ, ss_occ, Td_pq_);
124127
return fast_diag_os_double(holu_en, hold_en, paru_en, pard_en, orb_holu,
125128
orb_hold, orb_paru, orb_pard, orig_det_Hii);
126129
}

include/macis/hamiltonian_generator/impl.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,22 @@
1212
namespace macis {
1313

1414
template <size_t N>
15-
HamiltonianGenerator<N>::HamiltonianGenerator(matrix_span<double> T,
15+
HamiltonianGenerator<N>::HamiltonianGenerator(matrix_span<double> Tu,
1616
rank4_span_t V)
17-
: norb_(T.extent(0)),
17+
: norb_(Tu.extent(0)),
1818
norb2_(norb_ * norb_),
1919
norb3_(norb2_ * norb_),
20-
T_pq_(T),
20+
Tu_pq_(Tu),
21+
Td_pq_(Tu),
2122
V_pqrs_(V) {
2223
generate_integral_intermediates(V_pqrs_);
2324
}
2425

26+
template <size_t N>
27+
void HamiltonianGenerator<N>::ReadTdo( matrix_span<double> Td ){
28+
Td_pq_ = Td;
29+
}
30+
2531
template <size_t N>
2632
void HamiltonianGenerator<N>::generate_integral_intermediates(rank4_span_t V) {
2733
if(V.extent(0) != norb_ or V.extent(1) != norb_ or V.extent(2) != norb_ or

0 commit comments

Comments
 (0)