A class that implements the block-Davidson algorithm for solving generalized eigenvalue problems.
More...
|
| | DiagoDavid (const Real *precondition_in, const int nband_in, const int dim_in, const int david_ndim_in, const bool use_uspp_in, const diag_comm_info &diag_comm_in) |
| | Constructor for the DiagoDavid class.
|
| | ~DiagoDavid () |
| | Destructor for the DiagoDavid class.
|
| int | diag (const HSOperator< T, Device > &op, const int ld_psi, T *psi_in, Real *eigenvalue_in, const std::vector< double > ðr_band, const int david_maxiter, const int ntry_max=5, const int notconv_max=0) |
| | Performs iterative diagonalization using the David algorithm.
|
|
| using | Real = typename GetTypeReal<T>::type |
| using | resmem_complex_op = base_device::memory::resize_memory_op<T, Device> |
| using | delmem_complex_op = base_device::memory::delete_memory_op<T, Device> |
| using | setmem_complex_op = base_device::memory::set_memory_op<T, Device> |
| using | resmem_var_op = base_device::memory::resize_memory_op<Real, Device> |
| using | delmem_var_op = base_device::memory::delete_memory_op<Real, Device> |
| using | setmem_var_op = base_device::memory::set_memory_op<Real, Device> |
| using | syncmem_var_h2d_op = base_device::memory::synchronize_memory_op<Real, Device, base_device::DEVICE_CPU> |
| using | syncmem_var_d2h_op = base_device::memory::synchronize_memory_op<Real, base_device::DEVICE_CPU, Device> |
| using | syncmem_complex_op = base_device::memory::synchronize_memory_op<T, Device, Device> |
| using | castmem_complex_op = base_device::memory::cast_memory_op<std::complex<double>, T, Device, Device> |
| using | syncmem_h2d_op = base_device::memory::synchronize_memory_op<T, Device, base_device::DEVICE_CPU> |
| using | syncmem_d2h_op = base_device::memory::synchronize_memory_op<T, base_device::DEVICE_CPU, Device> |
| using | ct_Device = typename ct::PsiToContainer<Device>::type |
|
| int | diag_once (const HSOperator< T, Device > &op, const int dim, const int nband, const int ld_psi, T *psi_in, Real *eigenvalue_in, const std::vector< double > ðr_band, const int david_maxiter) |
| void | cal_grad (const HSOperator< T, Device > &op, const int &dim, const int &nbase, const int nbase_x, const int ¬conv, T *hpsi, T *spsi, const T *vcc, const int *unconv, const Real *eigenvalue) |
| void | cal_elem (const int &dim, int &nbase, const int nbase_x, const int ¬conv, const T *hpsi, const T *spsi, T *hcc) |
| void | refresh (const int &dim, const int &nband, int &nbase, const int nbase_x, const Real *eigenvalue, const T *psi_in, const int ld_psi, T *hpsi, T *spsi, T *hcc, T *vcc) |
| bool | SchmidtOrth (const int &dim, const int nband, const int m, const T *spsi, T *lagrange_m, const int mm_size, const int mv_size) |
| void | planSchmidtOrth (const int nband, std::vector< int > &pre_matrix_mm_m, std::vector< int > &pre_matrix_mv_m) |
| | Plans the Schmidt orthogonalization for a given number of bands.
|
| void | diag_zhegvx (const int &nbase, const int &nband, const T *hcc, const int &nbase_x, Real *eigenvalue, T *vcc) |
| bool | check_block_conv (const int &ntry, const int ¬conv, const int &ntry_max, const int ¬conv_max) |
| | Check the convergence of block eigenvectors in the Davidson iteration.
|
| bool | use_block_qr () const |
| | Whether to form CUDA float Davidson bases with a single-pass QR.
|
|
| int | test_david = 0 |
| diag_comm_info | diag_comm |
| const int | nband |
| | number of required eigenpairs
|
| const int | dim |
| | dimension of the input matrix to be diagonalized
|
| const int | nbase_x |
| | maximum dimension of the reduced basis set
|
| const int | david_ndim = 4 |
| | dimension of the subspace allowed in Davidson
|
| const bool | use_uspp = false |
| | whether the SCF uses ultrasoft pseudopotentials
|
| int | notconv = 0 |
| | number of unconverged eigenvalues
|
| const Real * | precondition = nullptr |
| | precondition for diag, diagonal approximation of matrix A(i.e. Hamilt)
|
| Real * | d_precondition = nullptr |
| Real * | eigenvalue = nullptr |
| | eigenvalue results
|
| T * | basis = nullptr |
| T * | hpsi = nullptr |
| | pointer to basis set(dim, nbase_x), leading dimension = dim
|
| T * | spsi = nullptr |
| | the product of H and psi in the reduced basis set
|
| T * | hcc = nullptr |
| | the Product of S and psi in the reduced basis set
|
| T * | vcc = nullptr |
| | Hamiltonian on the reduced basis.
|
| T * | lagrange_matrix = nullptr |
| | eigenvectors of hc
|
| Device * | ctx = {} |
| | device type of psi
|
| base_device::DEVICE_CPU * | cpu_ctx = {} |
| base_device::AbacusDevice_t | device = {} |
| const T * | one = nullptr |
| const T * | zero = nullptr |
| const T * | neg_one = nullptr |
| const T | one_ = static_cast<T>(1.0) |
| const T | zero_ = static_cast<T>(0.0) |
| const T | neg_one_ = static_cast<T>(-1.0) |
template<typename
T = std::complex<double>, typename Device = base_device::DEVICE_CPU>
class hsolver::DiagoDavid< T, Device >
A class that implements the block-Davidson algorithm for solving generalized eigenvalue problems.
The DiagoDavid class provides methods for performing iterative diagonalization using the Davidson algorithm. It supports both real and complex data types and can be executed on different devices (CPU or GPU).
- Template Parameters
-
| T | The data type of the matrices and arrays (e.g., float, double, std::complex<float>, std::complex<double>). |
| Device | The device type (e.g., base_device::DEVICE_CPU or DEVICE_GPU). |
template<typename
T, typename Device>
| bool DiagoDavid::SchmidtOrth |
( |
const int & | dim, |
|
|
const int | nband, |
|
|
const int | m, |
|
|
const T * | spsi, |
|
|
T * | lagrange_m, |
|
|
const int | mm_size, |
|
|
const int | mv_size ) |
|
private |
SchmidtOrth function performs orthogonalization of the starting eigenfunction to those already calculated. It takes the dimension of the basis, number of bands, index of the current band, starting eigenfunction psi_m, lagrange_m array, mm_size, and mv_size as input parameters.
- Parameters
-
| dim | The dimension of the basis. |
| nband | The number of bands. |
| m | The index of the current band. |
| spsi | Pointer to the starting eigenfunction psi_m. |
| lagrange_m | Pointer to the lagrange_m array. |
| mm_size | The size of the square matrix for future lagranges. |
| mv_size | The size of the lagrange_m array. |