|
| static void | diag_subspace (const hamilt::Hamilt< T, Device > *const pHamilt, const psi::Psi< T, Device > &psi, psi::Psi< T, Device > &evc, Real *en, int n_band=0, const bool is_S_orthogonal=false) |
| | Diagonalizes the Hamiltonian in a subspace defined by the given wavefunction.
|
| |
| static void | diag_subspace_init (hamilt::Hamilt< T, Device > *pHamilt, const T *psi, int psi_nr, int psi_nc, psi::Psi< T, Device > &evc, Real *en, const std::function< void(T *, const int)> &add_to_hcc=[](T *null, const int n) {}, const std::function< void(const T *const, const int, const int)> &export_vcc=[](const T *null, const int n, const int m) {}) |
| | use LAPACK to diagonalize the Hamiltonian matrix
|
| |
| static void | diag_heevx (const int nstart, const int nbands, const T *hcc, const int ldh, Real *e, T *vcc) |
| |
| static void | diag_hegvd (const int nstart, const int nbands, const T *hcc, T *sc, const int ldh, Real *e, T *vcc) |
| |
| static void | cal_hs_subspace (const hamilt::Hamilt< T, Device > *pHamilt, const psi::Psi< T, Device > &psi, T *hcc, T *scc) |
| | calculate Hamiltonian and overlap matrix in subspace spanned by nstart states psi
|
| |
| static void | diag_responce (const T *hcc, T *scc, const int nbands, const T *mat_in, T *mat_out, int mat_col, Real *en) |
| | calculate the response matrix from rotation matrix solved by diagonalization of H and S matrix
|
| |
| static void | diag_subspace_psi (const T *hcc, T *scc, const int dim_subspace, psi::Psi< T, Device > &evc, Real *en) |
| | calculate the response wavefunction psi from rotation matrix solved by diagonalization of H and S matrix
|
| |
| static bool | test_exit_cond (const int &ntry, const int ¬conv) |
| |
|
| using | Real = typename GetTypeReal< T >::type |
| |
| using | hpsi_info = typename hamilt::Operator< T, Device >::hpsi_info |
| |
| using | setmem_var_op = base_device::memory::set_memory_op< Real, 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 | syncmem_var_op = base_device::memory::synchronize_memory_op< Real, Device, Device > |
| |
| using | syncmem_var_h2d_op = base_device::memory::synchronize_memory_op< Real, base_device::DEVICE_GPU, base_device::DEVICE_CPU > |
| |
| using | syncmem_var_d2h_op = base_device::memory::synchronize_memory_op< Real, base_device::DEVICE_CPU, base_device::DEVICE_GPU > |
| |
| using | setmem_complex_op = base_device::memory::set_memory_op< T, Device > |
| |
| 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 | syncmem_complex_op = base_device::memory::synchronize_memory_op< T, Device, Device > |
| |
| using | syncmem_complex_h2d_op = base_device::memory::synchronize_memory_op< T, Device, base_device::DEVICE_CPU > |
| |
| using | syncmem_complex_d2h_op = base_device::memory::synchronize_memory_op< T, base_device::DEVICE_CPU, Device > |
| |
template<typename
T , typename Device >
Diagonalizes the Hamiltonian in a subspace defined by the given wavefunction.
This static function computes the eigenvalues and eigenvectors of the Hamiltonian within the subspace spanned by the provided wavefunction psi. The resulting eigenvectors are stored in evc, and the corresponding eigenvalues are written to en.
- Template Parameters
-
| T | Data type for computation (e.g., float, double). |
| Device | Device type for computation (e.g., CPU, GPU). |
- Parameters
-
| pHamilt | Pointer to the Hamiltonian object. |
| psi | Input wavefunction defining the subspace. |
| evc | Output container for computed eigenvectors. |
| en | Output array for computed eigenvalues. |
| n_band | Number of bands (eigenvalues/eigenvectors) to compute. Default is 0 (all). |
| is_S_orthogonal | If true, assumes the input wavefunction is already orthogonalized. |
temporary array for calculation of evc
< if temp and evc share the same memory