ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LR::Z_vector_UR< T > Class Template Reference

Open-shell (spin-unrestricted) counterpart of Z_vector_R. More...

#include <hamilt_zeq_r.h>

Inheritance diagram for LR::Z_vector_UR< T >:
Collaboration diagram for LR::Z_vector_UR< T >:

Public Member Functions

 Z_vector_UR (const std::string &xc_kernel, const int &nspin, const int &naos, const std::vector< int > &nocc, const std::vector< int > &nvirt, const UnitCell &ucell, const std::vector< double > &orb_cutoff, const Grid_Driver &gd, const psi::Psi< T > &psi_ks, const ModuleBase::matrix &eig_ks, std::weak_ptr< PotHxcLR > pot, std::weak_ptr< PotHxcLR > pot_hxc_gs, const K_Vectors &kv, const std::vector< Parallel_Blkcyclic > &pX, const Parallel_Blkcyclic &pc, const Parallel_Orbitals &pmat, const std::string &ks_solver, const std::string &dft_functional, const int nk, const int local_dimension, const int global_dimension)
Public Member Functions inherited from LR::ZeqULR< T >
 ZeqULR (const std::vector< int > &nocc_in, const std::vector< int > &nvirt_in, const std::vector< Parallel_Blkcyclic > &pX_in, const int nk_in, const int local_dimension, const int global_dimension)
virtual ~ZeqULR ()
void hPsi (const T *const psi_in, T *const hpsi, const int ld_psi, const int nband)
void hPsi (const T *psi_in, T *hpsi, const int ld_psi, const int nband, const std::vector< std::vector< ct::Tensor > > &window_density)
std::vector< T > matrix ()
 The full (replicated) matrix, column by column. Only used by the LAPACK solver.

Protected Member Functions

void band_extra (const T *const X, T *const out) const override
 optional per-band contribution that does not fit the 2x2 block structure. NOTE matrix() deliberately does NOT call this: it exists for the right-hand side, which is not a linear operator, while matrix() is only ever used for the LHS.
void set_dm (const int is, const T *const X, const std::vector< ct::Tensor > *density_add) override
Protected Member Functions inherited from LR::ZeqULR< T >
void apply (const T *const psi_in, T *const hpsi, const int ld_psi, const int nband, const std::vector< std::vector< ct::Tensor > > *window_density)

Private Types

using ATYPE = typename OperatorLRHxc<T>::MO_TO_AO_TYPE

Private Attributes

const int naos_ = 1
const Parallel_Blkcyclic & pc_
const Parallel_Orbitals & pmat_
const psi::Psi< T > & psi_ks_
std::vector< psi::Psi< T > > psi_ks_spin_
std::unique_ptr< module_dm::DensityMatrix< T, T > > DM_trans
std::unique_ptr< module_dm::DensityMatrix< T, T > > DM_diff
std::vector< ct::Tensor > dmx_buf_
std::vector< ct::Tensor > dmd_buf_
std::unique_ptr< OperatorGxcULR< T > > gxc_

Additional Inherited Members

Public Attributes inherited from LR::ZeqULR< T >
const std::vector< int > & nocc
const std::vector< int > & nvirt
const std::vector< Parallel_Blkcyclic > & pX
const int nk = 1
const int ldim = 1
const int gdim = 1
Protected Attributes inherited from LR::ZeqULR< T >
std::vector< hamilt::Operator< T > * > ops

Detailed Description

template<typename T>
class LR::Z_vector_UR< T >

Open-shell (spin-unrestricted) counterpart of Z_vector_R.

Right-hand side of the Z-vector equation (the operators produce $-R$): $$R_{ai\sigma}=H_{ai\sigma}[T]+\sum_bX_{bi\sigma}H_{ba\sigma}[D^X] -\sum_kX_{ak\sigma}H_{ik\sigma}[D^X] +2\sum_{\kappa\lambda\sigma'}\sum_{\alpha\beta\sigma''}D^X D^X g^{xc}.$$

Factors relative to the closed-shell Z_vector_R:

  • the $K[D^X]$ term keeps -2.0. There pot is S2_singlet, which already IS $K^S$, so the factor is just $H=2K$; here pot is S2_updown, which is one $K_{\sigma\sigma'}$ component, and the $\sum_{\sigma'}$ is done by the block loop.
  • the $H[T]$ term goes -4.0 -> -2.0, because pot_hxc_gs is no longer the halved S2_gs but S2_updown (same argument as in Z_vector_UL).

Member Typedef Documentation

◆ ATYPE

template<typename T>
using LR::Z_vector_UR< T >::ATYPE = typename OperatorLRHxc<T>::MO_TO_AO_TYPE
private

Constructor & Destructor Documentation

◆ Z_vector_UR()

template<typename T>
LR::Z_vector_UR< T >::Z_vector_UR ( const std::string & xc_kernel,
const int & nspin,
const int & naos,
const std::vector< int > & nocc,
const std::vector< int > & nvirt,
const UnitCell & ucell,
const std::vector< double > & orb_cutoff,
const Grid_Driver & gd,
const psi::Psi< T > & psi_ks,
const ModuleBase::matrix & eig_ks,
std::weak_ptr< PotHxcLR > pot,
std::weak_ptr< PotHxcLR > pot_hxc_gs,
const K_Vectors & kv,
const std::vector< Parallel_Blkcyclic > & pX,
const Parallel_Blkcyclic & pc,
const Parallel_Orbitals & pmat,
const std::string & ks_solver,
const std::string & dft_functional,
const int nk,
const int local_dimension,
const int global_dimension )
inline
Here is the call graph for this function:

Member Function Documentation

◆ band_extra()

template<typename T>
void LR::Z_vector_UR< T >::band_extra ( const T *const X,
T *const out ) const
inlineoverrideprotectedvirtual

optional per-band contribution that does not fit the 2x2 block structure. NOTE matrix() deliberately does NOT call this: it exists for the right-hand side, which is not a linear operator, while matrix() is only ever used for the LHS.

Reimplemented from LR::ZeqULR< T >.

◆ set_dm()

template<typename T>
void LR::Z_vector_UR< T >::set_dm ( const int is,
const T *const X,
const std::vector< ct::Tensor > * density_add )
inlineoverrideprotectedvirtual

Rebuild BOTH density matrices from the is block of X: the CXC operators read $D^X$ (transposed, un-symmetrized – see the closed-shell Z_vector_R for why), the CC_vo operators read the difference density matrix $T$ (symmetrized).

Implements LR::ZeqULR< T >.

Here is the call graph for this function:

Member Data Documentation

◆ DM_diff

template<typename T>
std::unique_ptr<module_dm::DensityMatrix<T, T> > LR::Z_vector_UR< T >::DM_diff
private

◆ DM_trans

template<typename T>
std::unique_ptr<module_dm::DensityMatrix<T, T> > LR::Z_vector_UR< T >::DM_trans
private

◆ dmd_buf_

template<typename T>
std::vector<ct::Tensor> LR::Z_vector_UR< T >::dmd_buf_
private

◆ dmx_buf_

template<typename T>
std::vector<ct::Tensor> LR::Z_vector_UR< T >::dmx_buf_
private

◆ gxc_

template<typename T>
std::unique_ptr<OperatorGxcULR<T> > LR::Z_vector_UR< T >::gxc_
private

◆ naos_

template<typename T>
const int LR::Z_vector_UR< T >::naos_ = 1
private

◆ pc_

template<typename T>
const Parallel_Blkcyclic& LR::Z_vector_UR< T >::pc_
private

◆ pmat_

template<typename T>
const Parallel_Orbitals& LR::Z_vector_UR< T >::pmat_
private

◆ psi_ks_

template<typename T>
const psi::Psi<T>& LR::Z_vector_UR< T >::psi_ks_
private

◆ psi_ks_spin_

template<typename T>
std::vector<psi::Psi<T> > LR::Z_vector_UR< T >::psi_ks_spin_
private

The documentation for this class was generated from the following file: