Skip to content

Commit 05fe897

Browse files
committed
feature: lapack solvers of linear equations
1 parent 87db32b commit 05fe897

File tree

15 files changed

+203
-64
lines changed

15 files changed

+203
-64
lines changed

source/module_lr/Grad/CVCX/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ AddTest(
33
TARGET CVCX_test
44
LIBS base ${math_libs} container device psi
55
SOURCES CVCX_test.cpp ../../../utils/lr_util.cpp ../CVCX_parallel.cpp ../CVCX_serial.cpp
6-
../../../../module_basis/module_ao/parallel_2d.cpp
76
)

source/module_lr/Grad/CVCX/test/CVCX_test.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ TEST_F(AXTest, DoubleParallel)
167167
{
168168
X.fix_k(isk);
169169
X_full.fix_k(isk);
170-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, s.nvirt, s.nocc);
170+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
171171
}
172172
}
173173

@@ -189,17 +189,17 @@ TEST_F(AXTest, DoubleParallel)
189189
{
190190
AX_pblas_loc.fix_k(isk);
191191
AX_gather.fix_k(isk);
192-
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer(), false/*pblas: row first*/, s.nvirt, s.nocc);
192+
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer());
193193
}
194194
// compare to global AX
195195
std::vector<container::Tensor> V_full(s.nks, container::Tensor(DAT::DT_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
196196
psi::Psi<double, base_device::DEVICE_CPU> c_full(s.nks, s.nocc + s.nvirt, s.naos);
197197
for (int isk = 0;isk < s.nks;++isk)
198198
{
199-
LR_Util::gather_2d_to_full(pV, V.at(isk).data<double>(), V_full.at(isk).data<double>(), false, s.naos, s.naos);
199+
LR_Util::gather_2d_to_full(pV, V.at(isk).data<double>(), V_full.at(isk).data<double>());
200200
c.fix_k(isk);
201201
c_full.fix_k(isk);
202-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
202+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
203203
}
204204
if (my_rank == 0)
205205
{
@@ -216,7 +216,7 @@ TEST_F(AXTest, DoubleParallel)
216216
{
217217
AX_pblas_loc.fix_k(isk);
218218
AX_gather.fix_k(isk);
219-
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer(), false/*pblas: row first*/, s.nvirt, s.nocc);
219+
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer());
220220
}
221221
if (my_rank == 0)
222222
{
@@ -259,7 +259,7 @@ TEST_F(AXTest, ComplexParallel)
259259
{
260260
X.fix_k(isk);
261261
X_full.fix_k(isk);
262-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, s.nvirt, s.nocc);
262+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
263263
}
264264
}
265265

@@ -282,17 +282,17 @@ TEST_F(AXTest, ComplexParallel)
282282
{
283283
AX_pblas_loc.fix_k(isk);
284284
AX_gather.fix_k(isk);
285-
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer(), false/*pblas: row first*/, s.nvirt, s.nocc);
285+
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer());
286286
}
287287
// compare to global AX
288288
std::vector<container::Tensor> V_full(s.nks, container::Tensor(DAT::DT_COMPLEX_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
289289
psi::Psi<std::complex<double>, base_device::DEVICE_CPU> c_full(s.nks, s.nocc + s.nvirt, s.naos);
290290
for (int isk = 0;isk < s.nks;++isk)
291291
{
292-
LR_Util::gather_2d_to_full(pV, V.at(isk).data<std::complex<double>>(), V_full.at(isk).data<std::complex<double>>(), false, s.naos, s.naos);
292+
LR_Util::gather_2d_to_full(pV, V.at(isk).data<std::complex<double>>(), V_full.at(isk).data<std::complex<double>>());
293293
c.fix_k(isk);
294294
c_full.fix_k(isk);
295-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
295+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
296296
}
297297
if (my_rank == 0)
298298
{
@@ -308,7 +308,7 @@ TEST_F(AXTest, ComplexParallel)
308308
{
309309
AX_pblas_loc.fix_k(isk);
310310
AX_gather.fix_k(isk);
311-
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer(), false/*pblas: row first*/, s.nvirt, s.nocc);
311+
LR_Util::gather_2d_to_full(px, AX_pblas_loc.get_pointer(), AX_gather.get_pointer());
312312
}
313313
if (my_rank == 0)
314314
{

source/module_lr/Grad/dm_diff/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ AddTest(
33
TARGET dm_diff_test
44
LIBS psi base ${math_libs} device container
55
SOURCES dm_diff_test.cpp ../../../utils/lr_util.cpp
6-
../../../../module_basis/module_ao/parallel_2d.cpp
76
)

source/module_lr/Grad/dm_diff/test/dm_diff_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ TEST_F(DMDiffTest, DoubleParallel)
127127
{
128128
X.fix_k(isk);
129129
X_full.fix_k(isk);
130-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, s.nvirt, s.nocc);
130+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
131131
}
132132
}
133133
for (int istate = 0;istate < nstate;++istate)
@@ -143,15 +143,15 @@ TEST_F(DMDiffTest, DoubleParallel)
143143
// gather dm and output
144144
std::vector<container::Tensor> dm_gather(s.nks, container::Tensor(DAT::DT_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
145145
for (int isk = 0;isk < s.nks;++isk)
146-
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<double>(), dm_gather[isk].data<double>(), false, s.naos, s.naos);
146+
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<double>(), dm_gather[isk].data<double>());
147147

148148
// compare to global matrix
149149
psi::Psi<double, base_device::DEVICE_CPU> c_full(s.nks, s.nocc + s.nvirt, s.naos);
150150
for (int isk = 0;isk < s.nks;++isk)
151151
{
152152
c.fix_k(isk);
153153
c_full.fix_k(isk);
154-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
154+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
155155
}
156156
if (my_rank == 0)
157157
{
@@ -186,7 +186,7 @@ TEST_F(DMDiffTest, ComplexParallel)
186186
{
187187
X.fix_k(isk);
188188
X_full.fix_k(isk);
189-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, s.nvirt, s.nocc);
189+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
190190
}
191191
}
192192
for (int istate = 0;istate < nstate;++istate)
@@ -202,15 +202,15 @@ TEST_F(DMDiffTest, ComplexParallel)
202202
// gather dm and output
203203
std::vector<container::Tensor> dm_gather(s.nks, container::Tensor(DAT::DT_COMPLEX_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
204204
for (int isk = 0;isk < s.nks;++isk)
205-
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<std::complex<double>>(), dm_gather[isk].data<std::complex<double>>(), false, s.naos, s.naos);
205+
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<std::complex<double>>(), dm_gather[isk].data<std::complex<double>>());
206206

207207
// compare to global matrix
208208
psi::Psi<std::complex<double>, base_device::DEVICE_CPU> c_full(s.nks, s.nocc + s.nvirt, s.naos);
209209
for (int isk = 0;isk < s.nks;++isk)
210210
{
211211
c.fix_k(isk);
212212
c_full.fix_k(isk);
213-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
213+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
214214
}
215215
if (my_rank == 0)
216216
{

source/module_lr/Grad/multipliers/zeq_solver.hpp

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,37 @@ namespace LR
6060
throw std::runtime_error("complex Z-vector solver is not implemented yet");
6161
}
6262

63+
template<typename T>
64+
inline void solve_Z_lapack(T* const Z, const T* const R, const int& ld, const int& nstates,
65+
const HamiltLR<T>& hm)
66+
{
67+
ModuleBase::TITLE("Z_vector", "solve_Z_lapack");
68+
assert(ld == hm.nk * hm.pX[0].get_local_size());
69+
70+
std::vector<T> hessian_full = hm.matrix(); // MO-hessian, A+B
71+
72+
const int n_global = hm.nk * hm.nocc[0] * hm.nvirt[0];
73+
std::vector<T> Z_full = std::vector<T>(n_global * nstates, T(0.0));
74+
75+
// use lapack to solve the linear equation
76+
ModuleBase::timer::tick("Z_vector", "lapack_solver");
77+
LR_Util::lapack_linear_solver(hessian_full.data(), Z_full.data(), R, n_global, nstates);
78+
ModuleBase::timer::tick("Z_vector", "lapack_solver");
79+
80+
// test: print full Z
81+
std::cout << "The full Z-vector solved by LAPACK:" << std::endl;
82+
LR_Util::print_value(Z_full.data(), nstates, n_global);
83+
84+
// copy the local part of Z_full to Z
85+
for (int istate = 0; istate < nstates; ++istate)
86+
{
87+
const int global_offset = istate * n_global;
88+
const int offset = istate * ld;
89+
LR_Util::scatter_full_to_2d(hm.pX[0], Z_full.data() + global_offset, Z + offset, false);
90+
}
91+
std::cout << "The local Z-vector solved by LAPACK:" << std::endl;
92+
LR_Util::print_value(Z, nstates, ld);
93+
}
6394

6495
template<typename T, typename TGint>
6596
void Z_vector_equation(const T* const X,
@@ -86,7 +117,8 @@ namespace LR
86117
const std::vector<Parallel_2D>& px,
87118
const Parallel_2D& pc,
88119
const Parallel_Orbitals& pmat,
89-
const std::string& spin_type)
120+
const std::string& spin_type,
121+
const std::string& zvec_solver = "cg")
90122
{
91123
ModuleBase::TITLE("Z_vector", "Z_vector");
92124
const int nk = kv.get_nks() / nspin;
@@ -102,6 +134,8 @@ namespace LR
102134
ModuleBase::timer::tick("Z_vector", "Z_vector_R");
103135
ops_R.hPsi(X, R.data<T>(), nloc_per_band, nstates); // act each operators on X
104136
ModuleBase::timer::tick("Z_vector", "Z_vector_R");
137+
std::cout << "The right side of the Z-vector equation:" << std::endl;
138+
LR_Util::print_value(R.data<T>(), nstates, nloc_per_band);
105139

106140
// 2. the left-hand side of Z-vector equation
107141
// Z-vector (need a init?)
@@ -113,9 +147,32 @@ namespace LR
113147
gint, pot_hxc_gs, kv, px, pc, pmat, spin_type);
114148

115149
// 3. solve Z-vector equation
116-
std::cout << "The right side of the Z-vector equation:" << std::endl;
117-
LR_Util::print_value(R.data<T>(), nstates, nloc_per_band);
118-
solve_Z_CG(Z, R.data<T>(), nloc_per_band, nstates, std::bind(&HamiltLR<T>::hPsi, &ops_L, std::placeholders::_1, std::placeholders::_2, nloc_per_band, nstates));
150+
auto solve = [&](const std::string& solver)
151+
{
152+
// clear Z
153+
for (int i = 0; i < nstates * nloc_per_band; ++i) { Z[i] = T(0.0); }
154+
if (solver == "cg")
155+
{
156+
solve_Z_CG(Z, R.data<T>(), nloc_per_band, nstates,
157+
std::bind(&HamiltLR<T>::hPsi, &ops_L, std::placeholders::_1, std::placeholders::_2, nloc_per_band, nstates));
158+
}
159+
else if (solver == "lapack")
160+
{
161+
solve_Z_lapack(Z, R.data<T>(), nloc_per_band, nstates, ops_L);
162+
}
163+
else
164+
{
165+
throw std::runtime_error("Unsupported Z-vector solver: " + solver);
166+
}
167+
};
168+
169+
solve(zvec_solver);
170+
171+
// test: try supported solvers one by one
172+
const std::vector<std::string> supported_solvers = { "cg", "lapack" };
173+
for (const auto& s : supported_solvers)
174+
solve(s);
175+
119176
// test: set Z to 0
120177
// for (int i = 0; i < nstates * nloc_per_band; ++i) { Z[i] = T(0.0); }
121178
}

source/module_lr/ao_to_mo_transformer/test/ao_to_mo_test.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ TEST_F(AO2MOTest, DoubleParallel)
167167
// gather AX and output
168168
for (int isk = 0;isk < s.nks;++isk)
169169
{
170-
LR_Util::gather_2d_to_full(pvo, &vo_pblas_loc(istate, isk, 0), &vo_gather(istate, isk, 0), false/*pblas: row first*/, s.nvirt, s.nocc);
171-
LR_Util::gather_2d_to_full(poo, &oo_pblas_loc(istate, isk, 0), &oo_gather(istate, isk, 0), false/*pblas: row first*/, s.nocc, s.nocc);
172-
LR_Util::gather_2d_to_full(pvv, &vv_pblas_loc(istate, isk, 0), &vv_gather(istate, isk, 0), false/*pblas: row first*/, s.nvirt, s.nvirt);
170+
LR_Util::gather_2d_to_full(pvo, &vo_pblas_loc(istate, isk, 0), &vo_gather(istate, isk, 0));
171+
LR_Util::gather_2d_to_full(poo, &oo_pblas_loc(istate, isk, 0), &oo_gather(istate, isk, 0));
172+
LR_Util::gather_2d_to_full(pvv, &vv_pblas_loc(istate, isk, 0), &vv_gather(istate, isk, 0));
173173
}
174174
// compare to global AX
175175
std::vector<container::Tensor> V_full(s.nks, container::Tensor(DAT::DT_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
176176
std::vector<int> ngk_temp_1(s.nks, s.naos);
177177
psi::Psi<double> c_full(s.nks, s.nocc + s.nvirt, s.naos, ngk_temp_1, true);
178178
for (int isk = 0;isk < s.nks;++isk)
179179
{
180-
LR_Util::gather_2d_to_full(pV, V.at(isk).data<double>(), V_full.at(isk).data<double>(), false, s.naos, s.naos);
181-
LR_Util::gather_2d_to_full(pc, &c(isk, 0, 0), &c_full(isk, 0, 0), false, s.naos, s.nocc + s.nvirt);
180+
LR_Util::gather_2d_to_full(pV, V.at(isk).data<double>(), V_full.at(isk).data<double>(), );
181+
LR_Util::gather_2d_to_full(pc, &c(isk, 0, 0), &c_full(isk, 0, 0), false);
182182
}
183183
if (my_rank == 0)
184184
{
@@ -234,17 +234,17 @@ TEST_F(AO2MOTest, ComplexParallel)
234234
// gather AX and output
235235
for (int isk = 0;isk < s.nks;++isk)
236236
{
237-
LR_Util::gather_2d_to_full(pvo, &vo_pblas_loc(istate, isk, 0), &vo_gather(istate, isk, 0), false/*pblas: row first*/, s.nvirt, s.nocc);
238-
LR_Util::gather_2d_to_full(poo, &oo_pblas_loc(istate, isk, 0), &oo_gather(istate, isk, 0), false/*pblas: row first*/, s.nocc, s.nocc);
239-
LR_Util::gather_2d_to_full(pvv, &vv_pblas_loc(istate, isk, 0), &vv_gather(istate, isk, 0), false/*pblas: row first*/, s.nvirt, s.nvirt);
237+
LR_Util::gather_2d_to_full(pvo, &vo_pblas_loc(istate, isk, 0), &vo_gather(istate, isk, 0));
238+
LR_Util::gather_2d_to_full(poo, &oo_pblas_loc(istate, isk, 0), &oo_gather(istate, isk, 0));
239+
LR_Util::gather_2d_to_full(pvv, &vv_pblas_loc(istate, isk, 0), &vv_gather(istate, isk, 0));
240240
}
241241
// compare to global AX
242242
std::vector<container::Tensor> V_full(s.nks, container::Tensor(DAT::DT_COMPLEX_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
243243
std::vector<int> ngk_temp_2(s.nks, s.naos);
244244
psi::Psi<std::complex<double>> c_full(s.nks, s.nocc + s.nvirt, s.naos, ngk_temp_2, true);
245245
for (int isk = 0;isk < s.nks;++isk)
246246
{
247-
LR_Util::gather_2d_to_full(pV, V.at(isk).data<std::complex<double>>(), V_full.at(isk).data<std::complex<double>>(), false, s.naos, s.naos);
247+
LR_Util::gather_2d_to_full(pV, V.at(isk).data<std::complex<double>>(), V_full.at(isk).data<std::complex<double>>());
248248
LR_Util::gather_2d_to_full(pc, &c(isk, 0, 0), &c_full(isk, 0, 0), false, s.naos, s.nocc + s.nvirt);
249249
}
250250
if (my_rank == 0)

source/module_lr/dm_trans/test/dm_trans_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ TEST_F(DMTransTest, DoubleParallel)
167167
{
168168
X.fix_k(isk);
169169
X_full.fix_k(isk);
170-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, dim1, dim2);
170+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
171171
}
172172
}
173173
};
@@ -187,7 +187,7 @@ TEST_F(DMTransTest, DoubleParallel)
187187
{
188188
c.fix_k(isk);
189189
c_full.fix_k(isk);
190-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
190+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
191191
}
192192

193193
auto test = [&](psi::Psi<double>& X, psi::Psi<double>& X_full, const Parallel_2D& px, const LR::MO_TYPE type)
@@ -198,7 +198,7 @@ TEST_F(DMTransTest, DoubleParallel)
198198
std::vector<container::Tensor> dm_gather(s.nks, container::Tensor(DAT::DT_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
199199
for (int isk = 0;isk < s.nks;++isk)
200200
{
201-
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<double>(), dm_gather[isk].data<double>(), false, s.naos, s.naos);
201+
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<double>(), dm_gather[isk].data<double>());
202202
}
203203
if (my_rank == 0)
204204
{
@@ -252,7 +252,7 @@ TEST_F(DMTransTest, ComplexParallel)
252252
{
253253
X.fix_k(isk);
254254
X_full.fix_k(isk);
255-
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer(), false, dim1, dim2);
255+
LR_Util::gather_2d_to_full(px, X.get_pointer(), X_full.get_pointer());
256256
}
257257
}
258258
};
@@ -271,7 +271,7 @@ TEST_F(DMTransTest, ComplexParallel)
271271
{
272272
c.fix_k(isk);
273273
c_full.fix_k(isk);
274-
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer(), false, s.naos, s.nocc + s.nvirt);
274+
LR_Util::gather_2d_to_full(pc, c.get_pointer(), c_full.get_pointer());
275275
}
276276

277277
auto test = [&](psi::Psi<std::complex<double>>& X, psi::Psi<std::complex<double>>& X_full, const Parallel_2D& px, const LR::MO_TYPE type)
@@ -282,7 +282,7 @@ TEST_F(DMTransTest, ComplexParallel)
282282
std::vector<container::Tensor> dm_gather(s.nks, container::Tensor(DAT::DT_COMPLEX_DOUBLE, DEV::CpuDevice, { s.naos, s.naos }));
283283
for (int isk = 0;isk < s.nks;++isk)
284284
{
285-
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<std::complex<double>>(), dm_gather[isk].data<std::complex<double>>(), false, s.naos, s.naos);
285+
LR_Util::gather_2d_to_full(pmat, dm_pblas_loc[isk].data<std::complex<double>>(), dm_gather[isk].data<std::complex<double>>());
286286
}
287287
if (my_rank == 0)
288288
{

source/module_lr/hamilt_casida.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ namespace LR
4343
#ifdef __MPI
4444
for (int ik_ai = 0;ik_ai < this->nk;++ik_ai) {
4545
LR_Util::gather_2d_to_full(px, &A_aibj.get_pointer()[ik_ai * px.get_local_size()],
46-
Amat_full.data() + kbj * this->nk * npairs /*col, bj*/ + ik_ai * npairs/*row, ai*/,
47-
false, nv, no);
46+
Amat_full.data() + kbj * this->nk * npairs /*col, bj*/ + ik_ai * npairs/*row, ai*/);
4847
}
4948
#endif
5049
}

source/module_lr/hamilt_casida.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,14 @@ namespace LR
175175
}
176176
}
177177

178-
protected:
178+
// const references
179179
const std::vector<int>& nocc;
180180
const std::vector<int>& nvirt;
181181
const int nspin = 1;
182182
const int nk = 1;
183-
const bool tdm_sym = false; ///< whether to symmetrize the transition density matrix
184183
const std::vector<Parallel_2D>& pX;
184+
protected:
185+
const bool tdm_sym = false; ///< whether to symmetrize the transition density matrix
185186
T one()const;
186187
/// transition density matrix in AO representation
187188
/// calculate on the same address for each bands, and commonly used by all the operators

0 commit comments

Comments
 (0)