ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
psi::Psi< T, Device > Class Template Reference

#include <psi.h>

Collaboration diagram for psi::Psi< T, Device >:

Public Member Functions

 Psi ()
 Psi (const int nk_in, const int nbd_in, const int nbs_in, const std::vector< int > &ngk_in, const bool k_first_in)
 Psi (const Psi &psi_in)
template<typename T_in, typename Device_in = Device>
 Psi (const Psi< T_in, Device_in > &psi_in)
 Psi (T *psi_pointer, const int nk_in, const int nbd_in, const int nbs_in, const int current_nbasis_in, const bool k_first_in=true)
 Psi (const int nk_in, const int nbd_in, const int nbs_in, const int current_nbasis_in, const bool k_first_in)
 ~Psi ()
void set_all_psi (const T *another_pointer, const std::size_t size_in)
void zero_out ()
size_t size () const
Psi & operator= (const Psi &psi_in)
void resize (const int nks_in, const int nbands_in, const int nbasis_in)
T * get_pointer () const
T * get_pointer (const int &ikb) const
const int & get_nk () const
const int & get_nbands () const
const int & get_nbasis () const
void fix_k (const int ik) const
void fix_b (const int ib) const
void fix_kb (const int ik, const int ib) const
T & operator() (const int ikb1, const int ikb2, const int ibasis) const
T & operator() (const int ikb2, const int ibasis) const
T & operator() (const int ibasis) const
int get_current_k () const
int get_current_b () const
int get_current_nbas () const
const int & get_ngk (const int ik_in) const
const int * get_ngk_pointer () const
const bool & get_k_first () const
const Device * get_device () const
const size_t & get_psi_bias () const
const int & get_current_ngk () const
std::tuple< const T *, int > to_range (const Range &range) const
int get_npol () const

Private Types

using delete_memory_op = base_device::memory::delete_memory_op<T, Device>
using resize_memory_op = base_device::memory::resize_memory_op<T, Device>
using set_memory_op = base_device::memory::set_memory_op<T, Device>
using synchronize_memory_op = base_device::memory::synchronize_memory_op<T, Device, Device>

Private Attributes

T * psi = nullptr
Device * ctx = {}
int nk = 1
int nbands = 1
int nbasis = 1
int current_k = 0
int current_b = 0
int current_nbasis = 1
T * psi_current = nullptr
size_t psi_bias = 0
const int * ngk = nullptr
bool k_first = true
bool allocate_inside = true
 whether allocate psi inside Psi class

Member Typedef Documentation

◆ delete_memory_op

template<typename T, typename Device = base_device::DEVICE_CPU>
using psi::Psi< T, Device >::delete_memory_op = base_device::memory::delete_memory_op<T, Device>
private

◆ resize_memory_op

template<typename T, typename Device = base_device::DEVICE_CPU>
using psi::Psi< T, Device >::resize_memory_op = base_device::memory::resize_memory_op<T, Device>
private

◆ set_memory_op

template<typename T, typename Device = base_device::DEVICE_CPU>
using psi::Psi< T, Device >::set_memory_op = base_device::memory::set_memory_op<T, Device>
private

◆ synchronize_memory_op

template<typename T, typename Device = base_device::DEVICE_CPU>
using psi::Psi< T, Device >::synchronize_memory_op = base_device::memory::synchronize_memory_op<T, Device, Device>
private

Constructor & Destructor Documentation

◆ Psi() [1/6]

template<typename T, typename Device>
psi::Psi< T, Device >::Psi ( )
Here is the caller graph for this function:

◆ Psi() [2/6]

template<typename T, typename Device>
psi::Psi< T, Device >::Psi ( const int nk_in,
const int nbd_in,
const int nbs_in,
const std::vector< int > & ngk_in,
const bool k_first_in )

◆ Psi() [3/6]

template<typename T, typename Device>
psi::Psi< T, Device >::Psi ( const Psi< T, Device > & psi_in)
Here is the call graph for this function:

◆ Psi() [4/6]

template<typename T, typename Device>
template<typename T_in, typename Device_in>
psi::Psi< T, Device >::Psi ( const Psi< T_in, Device_in > & psi_in)
Here is the call graph for this function:

◆ Psi() [5/6]

template<typename T, typename Device>
psi::Psi< T, Device >::Psi ( T * psi_pointer,
const int nk_in,
const int nbd_in,
const int nbs_in,
const int current_nbasis_in,
const bool k_first_in = true )

◆ Psi() [6/6]

template<typename T, typename Device>
psi::Psi< T, Device >::Psi ( const int nk_in,
const int nbd_in,
const int nbs_in,
const int current_nbasis_in,
const bool k_first_in )

◆ ~Psi()

template<typename T, typename Device>
psi::Psi< T, Device >::~Psi ( )

Member Function Documentation

◆ fix_b()

template<typename T, typename Device>
void psi::Psi< T, Device >::fix_b ( const int ib) const

if k_first=true: choose band index, then Psi(ibasis) can reach Psi(ik, iband, ibasis) if k_first=false: choose band index, then Psi(ik, ibasis) can reach Psi(iband, ik, ibasis)

Here is the caller graph for this function:

◆ fix_k()

template<typename T, typename Device>
void psi::Psi< T, Device >::fix_k ( const int ik) const

if k_first=true: choose k-point index , then Psi(iband, ibasis) can reach Psi(ik, iband, ibasis) if k_first=false: choose k-point index, then Psi(ibasis) can reach Psi(iband, ik, ibasis)

◆ fix_kb()

template<typename T, typename Device>
void psi::Psi< T, Device >::fix_kb ( const int ik,
const int ib ) const

choose k-point index and band index, then Psi(ibasis) can reach Psi(ik, iband, ibasis) for k_first=true or Psi(iband, ik, ibasis) for k_first=false

Here is the caller graph for this function:

◆ get_current_b()

template<typename T, typename Device>
int psi::Psi< T, Device >::get_current_b ( ) const
Here is the caller graph for this function:

◆ get_current_k()

template<typename T, typename Device>
int psi::Psi< T, Device >::get_current_k ( ) const
Here is the caller graph for this function:

◆ get_current_nbas()

template<typename T, typename Device>
int psi::Psi< T, Device >::get_current_nbas ( ) const
Here is the caller graph for this function:

◆ get_current_ngk()

template<typename T, typename Device>
const int & psi::Psi< T, Device >::get_current_ngk ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_device()

template<typename T, typename Device>
const Device * psi::Psi< T, Device >::get_device ( ) const

◆ get_k_first()

template<typename T, typename Device>
const bool & psi::Psi< T, Device >::get_k_first ( ) const
Here is the caller graph for this function:

◆ get_nbands()

template<typename T, typename Device>
const int & psi::Psi< T, Device >::get_nbands ( ) const
Here is the caller graph for this function:

◆ get_nbasis()

template<typename T, typename Device>
const int & psi::Psi< T, Device >::get_nbasis ( ) const
Here is the caller graph for this function:

◆ get_ngk()

template<typename T, typename Device>
const int & psi::Psi< T, Device >::get_ngk ( const int ik_in) const
Here is the caller graph for this function:

◆ get_ngk_pointer()

template<typename T, typename Device>
const int * psi::Psi< T, Device >::get_ngk_pointer ( ) const
Here is the caller graph for this function:

◆ get_nk()

template<typename T, typename Device>
const int & psi::Psi< T, Device >::get_nk ( ) const
Here is the caller graph for this function:

◆ get_npol()

template<typename T, typename Device>
int psi::Psi< T, Device >::get_npol ( ) const
Here is the caller graph for this function:

◆ get_pointer() [1/2]

template<typename T, typename Device>
T * psi::Psi< T, Device >::get_pointer ( ) const

◆ get_pointer() [2/2]

template<typename T, typename Device>
T * psi::Psi< T, Device >::get_pointer ( const int & ikb) const

◆ get_psi_bias()

template<typename T, typename Device>
const size_t & psi::Psi< T, Device >::get_psi_bias ( ) const
Here is the caller graph for this function:

◆ operator()() [1/3]

template<typename T, typename Device>
T & psi::Psi< T, Device >::operator() ( const int ibasis) const

◆ operator()() [2/3]

template<typename T, typename Device>
T & psi::Psi< T, Device >::operator() ( const int ikb1,
const int ikb2,
const int ibasis ) const

use operator "(ikb1, ikb2, ibasis)" to reach target element if k_first=true, ikb=ik, ikb2=iband if k_first=false, ikb=iband, ikb2=ik

◆ operator()() [3/3]

template<typename T, typename Device>
T & psi::Psi< T, Device >::operator() ( const int ikb2,
const int ibasis ) const

use operator "(ikb2, ibasis)" to reach target element for current k if k_first=true, ikb2=iband if k_first=false, ikb2=ik

◆ operator=()

template<typename T, typename Device>
Psi< T, Device > & psi::Psi< T, Device >::operator= ( const Psi< T, Device > & psi_in)
Here is the call graph for this function:

◆ resize()

template<typename T, typename Device>
void psi::Psi< T, Device >::resize ( const int nks_in,
const int nbands_in,
const int nbasis_in )
Here is the caller graph for this function:

◆ set_all_psi()

template<typename T, typename Device>
void psi::Psi< T, Device >::set_all_psi ( const T * another_pointer,
const std::size_t size_in )
Here is the call graph for this function:

◆ size()

template<typename T, typename Device>
std::size_t psi::Psi< T, Device >::size ( ) const
Here is the caller graph for this function:

◆ to_range()

template<typename T, typename Device>
std::tuple< const T *, int > psi::Psi< T, Device >::to_range ( const Range & range) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero_out()

template<typename T, typename Device>
void psi::Psi< T, Device >::zero_out ( )
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allocate_inside

template<typename T, typename Device = base_device::DEVICE_CPU>
bool psi::Psi< T, Device >::allocate_inside = true
private

whether allocate psi inside Psi class

◆ ctx

template<typename T, typename Device = base_device::DEVICE_CPU>
Device* psi::Psi< T, Device >::ctx = {}
private

◆ current_b

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::current_b = 0
mutableprivate

◆ current_k

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::current_k = 0
mutableprivate

◆ current_nbasis

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::current_nbasis = 1
mutableprivate

◆ k_first

template<typename T, typename Device = base_device::DEVICE_CPU>
bool psi::Psi< T, Device >::k_first = true
private

◆ nbands

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::nbands = 1
private

◆ nbasis

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::nbasis = 1
private

◆ ngk

template<typename T, typename Device = base_device::DEVICE_CPU>
const int* psi::Psi< T, Device >::ngk = nullptr
private

◆ nk

template<typename T, typename Device = base_device::DEVICE_CPU>
int psi::Psi< T, Device >::nk = 1
private

◆ psi

template<typename T, typename Device = base_device::DEVICE_CPU>
T* psi::Psi< T, Device >::psi = nullptr
private

◆ psi_bias

template<typename T, typename Device = base_device::DEVICE_CPU>
size_t psi::Psi< T, Device >::psi_bias = 0
mutableprivate

◆ psi_current

template<typename T, typename Device = base_device::DEVICE_CPU>
T* psi::Psi< T, Device >::psi_current = nullptr
mutableprivate

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