Skip to content

Commit c1e8046

Browse files
committed
clean useless code
1 parent eb61c5c commit c1e8046

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

source/module_hsolver/diago_bpcg.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ DiagoBPCG<T, Device>::~DiagoBPCG() {
3333
template<typename T, typename Device>
3434
void DiagoBPCG<T, Device>::init_iter(const int nband, const int nbasis) {
3535
// Specify the problem size n_basis, n_band, while lda is n_basis
36-
// this->n_band = psi_in.get_nbands();
37-
// this->n_basis = psi_in.get_nbasis();
3836
this->n_band = nband;
3937
this->n_basis = nbasis;
4038

@@ -54,9 +52,6 @@ void DiagoBPCG<T, Device>::init_iter(const int nband, const int nbasis) {
5452

5553
this->prec = std::move(ct::Tensor(r_type, device_type, {this->n_basis}));
5654

57-
//TODO: Remove class Psi, using ct::Tensor instead!
58-
// this->grad_wrapper = new psi::Psi<T, Device>(1, this->n_band, this->n_basis, psi_in.get_ngk_pointer());
59-
// this->grad = std::move(ct::TensorMap(grad_wrapper->get_pointer(), t_type, device_type, {this->n_band, this->n_basis}));
6055
this->grad = std::move(ct::Tensor(t_type, device_type, {this->n_band, this->n_basis}));
6156
}
6257

@@ -183,12 +178,7 @@ void DiagoBPCG<T, Device>::calc_hpsi_with_block(
183178
ct::Tensor& hpsi_out)
184179
{
185180
// calculate all-band hpsi
186-
// psi::Range all_bands_range(1, psi_in.get_current_k(), 0, psi_in.get_nbands() - 1);
187-
// hpsi_info info(&psi_in, all_bands_range, hpsi_out.data<T>());
188-
// hamilt_in->ops->hPsi(info);
189181
hpsi_func(psi_in, hpsi_out.data<T>(), this->n_basis, this->n_band);
190-
191-
// return;
192182
}
193183

194184
template<typename T, typename Device>

source/module_hsolver/hsolver_pw.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
486486
ModuleBase::timer::tick("DavSubspace", "hpsi_func");
487487
};
488488
DiagoBPCG<T, Device> bpcg(pre_condition.data());
489-
// bpcg.init_iter(psi);
490489
bpcg.init_iter(nband, nbasis);
491-
// bpcg.diag(hm, psi, eigenvalue);
492490
bpcg.diag(hpsi_func, psi.get_pointer(), eigenvalue);
493491
}
494492
else if (this->method == "dav_subspace")

source/module_hsolver/test/diago_bpcg_test.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -241,30 +241,6 @@ TEST(DiagoBPCGTest, Hamilt)
241241
}
242242
}*/
243243

244-
// This test will not work for now!
245-
// bpcg for a 2x2 matrix
246-
// #ifdef __MPI
247-
// #else
248-
// TEST(DiagoBPCGTest, TwoByTwo)
249-
// {
250-
// int dim = 2;
251-
// int nband = 2;
252-
// ModuleBase::ComplexMatrix hm(2, 2);
253-
// hm(0, 0) = std::complex<double>{4.0, 0.0};
254-
// hm(0, 1) = std::complex<double>{1.0, 0.0};
255-
// hm(1, 0) = std::complex<double>{1.0, 0.0};
256-
// hm(1, 1) = std::complex<double>{3.0, 0.0};
257-
// // nband, npw, sub, sparsity, reorder, eps, maxiter, threshold
258-
// DiagoBPCGPrepare dcp(nband, dim, 0, true, 1e-4, 50, 1e-10);
259-
// hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_NMAX = dcp.maxiter;
260-
// hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_THR = dcp.eps;
261-
// HPsi<std::complex<double>> hpsi;
262-
// hpsi.create(nband, dim);
263-
// DIAGOTEST::hmatrix = hm;
264-
// DIAGOTEST::npw = dim;
265-
// dcp.CompareEigen(hpsi.precond());
266-
// }
267-
// #endif
268244

269245
TEST(DiagoBPCGTest, readH)
270246
{

0 commit comments

Comments
 (0)