ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Functions
diago_bpcg_test.cpp File Reference
#include "source_base/inverse_matrix.h"
#include "source_base/module_external/lapack_connector.h"
#include "source_pw/module_pwdft/structure_factor.h"
#include "source_psi/psi.h"
#include "source_hamilt/hamilt.h"
#include "source_pw/module_pwdft/hamilt_pw.h"
#include "../diago_iter_assist.h"
#include "../diago_bpcg.h"
#include "diago_mock.h"
#include "mpi.h"
#include "source_basis/module_pw/test/test_tool.h"
#include <gtest/gtest.h>
#include <complex>
#include <random>
Include dependency graph for diago_bpcg_test.cpp:

Classes

class  DiagoBPCGPrepare
 
class  DiagoBPCGTest
 

Functions

void lapackEigen (int &npw, std::vector< std::complex< double > > &hm, double *e, bool outtime=false)
 
 TEST_P (DiagoBPCGTest, RandomHamilt)
 
 INSTANTIATE_TEST_SUITE_P (VerifyCG, DiagoBPCGTest, ::testing::Values(DiagoBPCGPrepare(10, 500, 0, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(20, 1000, 8, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(40, 1000, 8, true, 1e-6, 300, 5e-2)))
 
 TEST (DiagoBPCGTest, Hamilt)
 
 TEST (DiagoBPCGTest, readH)
 
int main (int argc, char **argv)
 

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( VerifyCG  ,
DiagoBPCGTest  ,
::testing::Values(DiagoBPCGPrepare(10, 500, 0, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(20, 1000, 8, true, 1e-5, 300, 5e-2), DiagoBPCGPrepare(40, 1000, 8, true, 1e-6, 300, 5e-2))   
)

◆ lapackEigen()

void lapackEigen ( int &  npw,
std::vector< std::complex< double > > &  hm,
double *  e,
bool  outtime = false 
)

Class Diago_BPCG is an approach for eigenvalue problems This unittest test the function Diago_BPCG::diag() for FPTYPE=double, Device=cpu with different examples.

  • the Hermite matrices (npw=500,1000) produced using random numbers and with sparsity of 0%, 60%, 80%
  • the Hamiltonian matrix read from "data-H", produced by using out_hs in INPUT of a LCAO calculation
  • a 2x2 Hermite matrix for learning and checking

Note: The test is passed when the eignvalues are closed to these calculated by LAPACK. It is used together with a header file diago_mock.h. The default Hermite matrix generated here is real symmetric, one can add an imaginary part by changing two commented out lines in diago_mock.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)
Here is the call graph for this function:

◆ TEST() [1/2]

TEST ( DiagoBPCGTest  ,
Hamilt   
)
Here is the call graph for this function:

◆ TEST() [2/2]

TEST ( DiagoBPCGTest  ,
readH   
)
Here is the call graph for this function:

◆ TEST_P()

TEST_P ( DiagoBPCGTest  ,
RandomHamilt   
)
Here is the call graph for this function: