ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
spinconstrain::pw::SubspaceCache Class Reference

Owning cache of PW subspace H/S/becp data plus the lambda snapshot. More...

#include <deltaspin_pw_cache.h>

Collaboration diagram for spinconstrain::pw::SubspaceCache:

Public Member Functions

 SubspaceCache ()=default
 SubspaceCache (const SubspaceCache &)=delete
SubspaceCache & operator= (const SubspaceCache &)=delete
bool allocated () const
 True when the subspace buffers are allocated.
std::vector< ModuleBase::Vector3< double > > & lambda_in_sub ()
 Lambda values captured when the cache was filled.
const std::vector< ModuleBase::Vector3< double > > & lambda_in_sub () const
std::complex< double > * h ()
 Raw base pointers (needed by hsolver subspace ops and GPU memcpy).
std::complex< double > * s ()
std::complex< double > * becp ()
std::complex< double > * h_k (int ik, int nbands)
 Per-k-point views.
std::complex< double > * s_k (int ik, int nbands)
std::complex< double > * becp_k (int ik, int size_becp)
void allocate_cpu (int nbands, int nk, int size_becp)
 Allocate the three buffers on the host (CPU path) with new[]. No-op if already allocated.
void release_cpu ()
 Release the host (CPU) buffers with delete[].

Private Attributes

std::complex< double > * sub_h_save_ = nullptr
 Cached subspace Hamiltonian for all k-points.
std::complex< double > * sub_s_save_ = nullptr
 Cached subspace overlap matrix for all k-points.
std::complex< double > * becp_save_ = nullptr
 Cached becp coefficients for all k-points.
std::vector< ModuleBase::Vector3< double > > lambda_in_sub_
 Lambda when the cache was saved.

Detailed Description

Owning cache of PW subspace H/S/becp data plus the lambda snapshot.

The buffer element type is std::complex<double> because the PW DeltaSpin path is always instantiated on complex wavefunctions; the legacy TK=double stub never allocates it.

Constructor & Destructor Documentation

◆ SubspaceCache() [1/2]

spinconstrain::pw::SubspaceCache::SubspaceCache ( )
default
Here is the caller graph for this function:

◆ SubspaceCache() [2/2]

spinconstrain::pw::SubspaceCache::SubspaceCache ( const SubspaceCache & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ allocate_cpu()

void spinconstrain::pw::SubspaceCache::allocate_cpu ( int nbands,
int nk,
int size_becp )
inline

Allocate the three buffers on the host (CPU path) with new[]. No-op if already allocated.

Here is the call graph for this function:

◆ allocated()

bool spinconstrain::pw::SubspaceCache::allocated ( ) const
inline

True when the subspace buffers are allocated.

Here is the caller graph for this function:

◆ becp()

std::complex< double > * spinconstrain::pw::SubspaceCache::becp ( )
inline

◆ becp_k()

std::complex< double > * spinconstrain::pw::SubspaceCache::becp_k ( int ik,
int size_becp )
inline
Here is the caller graph for this function:

◆ h()

std::complex< double > * spinconstrain::pw::SubspaceCache::h ( )
inline

Raw base pointers (needed by hsolver subspace ops and GPU memcpy).

◆ h_k()

std::complex< double > * spinconstrain::pw::SubspaceCache::h_k ( int ik,
int nbands )
inline

Per-k-point views.

Here is the caller graph for this function:

◆ lambda_in_sub() [1/2]

std::vector< ModuleBase::Vector3< double > > & spinconstrain::pw::SubspaceCache::lambda_in_sub ( )
inline

Lambda values captured when the cache was filled.

Here is the caller graph for this function:

◆ lambda_in_sub() [2/2]

const std::vector< ModuleBase::Vector3< double > > & spinconstrain::pw::SubspaceCache::lambda_in_sub ( ) const
inline

◆ operator=()

SubspaceCache & spinconstrain::pw::SubspaceCache::operator= ( const SubspaceCache & )
delete
Here is the call graph for this function:

◆ release_cpu()

void spinconstrain::pw::SubspaceCache::release_cpu ( )
inline

Release the host (CPU) buffers with delete[].

Here is the caller graph for this function:

◆ s()

std::complex< double > * spinconstrain::pw::SubspaceCache::s ( )
inline

◆ s_k()

std::complex< double > * spinconstrain::pw::SubspaceCache::s_k ( int ik,
int nbands )
inline
Here is the caller graph for this function:

Member Data Documentation

◆ becp_save_

std::complex<double>* spinconstrain::pw::SubspaceCache::becp_save_ = nullptr
private

Cached becp coefficients for all k-points.

◆ lambda_in_sub_

std::vector<ModuleBase::Vector3<double> > spinconstrain::pw::SubspaceCache::lambda_in_sub_
private

Lambda when the cache was saved.

◆ sub_h_save_

std::complex<double>* spinconstrain::pw::SubspaceCache::sub_h_save_ = nullptr
private

Cached subspace Hamiltonian for all k-points.

◆ sub_s_save_

std::complex<double>* spinconstrain::pw::SubspaceCache::sub_s_save_ = nullptr
private

Cached subspace overlap matrix for all k-points.


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