Skip to content

Commit 1a23ad1

Browse files
committed
remove useless code
1 parent 743b5a9 commit 1a23ad1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

source/module_hsolver/hsolver_pw.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
377377
if (this->method == "cg")
378378
{
379379
// wrap the subspace_func into a lambda function
380-
auto subspace_func = [hm, ngk_pointer, ngk_vector](const ct::Tensor& psi_in, ct::Tensor& psi_out) {
380+
auto subspace_func = [hm, ngk_vector](const ct::Tensor& psi_in, ct::Tensor& psi_out) {
381381
// psi_in should be a 2D tensor:
382382
// psi_in.shape() = [nbands, nbasis]
383383
const auto ndim = psi_in.shape().ndim();
@@ -411,7 +411,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
411411
using ct_Device = typename ct::PsiToContainer<Device>::type;
412412

413413
// wrap the hpsi_func and spsi_func into a lambda function
414-
auto hpsi_func = [hm, ngk_pointer, ngk_vector](const ct::Tensor& psi_in, ct::Tensor& hpsi_out) {
414+
auto hpsi_func = [hm, ngk_vector](const ct::Tensor& psi_in, ct::Tensor& hpsi_out) {
415415
ModuleBase::timer::tick("DiagoCG_New", "hpsi_func");
416416
// psi_in should be a 2D tensor:
417417
// psi_in.shape() = [nbands, nbasis]
@@ -482,7 +482,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
482482
const int nband = psi.get_nbands();
483483
const int nbasis = psi.get_nbasis();
484484
// hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec
485-
auto hpsi_func = [hm, ngk_pointer, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
485+
auto hpsi_func = [hm, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
486486
ModuleBase::timer::tick("DavSubspace", "hpsi_func");
487487

488488
// Convert "pointer data stucture" to a psi::Psi object
@@ -503,7 +503,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
503503
else if (this->method == "dav_subspace")
504504
{
505505
// hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec
506-
auto hpsi_func = [hm, ngk_pointer, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
506+
auto hpsi_func = [hm, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
507507
ModuleBase::timer::tick("DavSubspace", "hpsi_func");
508508

509509
// Convert "pointer data stucture" to a psi::Psi object
@@ -554,7 +554,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
554554
// Davidson matrix-blockvector functions
555555
/// wrap hpsi into lambda function, Matrix \times blockvector
556556
// hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec
557-
auto hpsi_func = [hm, ngk_pointer, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
557+
auto hpsi_func = [hm, ngk_vector](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) {
558558
ModuleBase::timer::tick("David", "hpsi_func");
559559

560560
// Convert pointer of psi_in to a psi::Psi object

source/module_psi/psi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class Psi
6666
const bool k_first_in = true);
6767

6868
// Constructor 8-2: a pointer version of constructor 3
69+
// only used in hsolver-pw function pointer.
6970
Psi(T* psi_pointer,
7071
const int nk_in,
7172
const int nbd_in,

0 commit comments

Comments
 (0)