SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Attributes | List of all members
sirius::wf::Wave_functions< T > Class Template Reference

Wave-functions representation. More...

#include <wave_functions.hpp>

Inherits sirius::wf::Wave_functions_mt< T >.

Public Member Functions

 Wave_functions (std::shared_ptr< fft::Gvec > gkvec__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__)
 Constructor for pure plane-wave functions. More...
 
 Wave_functions (std::shared_ptr< fft::Gvec > gkvec__, std::vector< int > num_mt_coeffs__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__)
 Constructor for wave-functions with plane-wave and muffin-tin parts (LAPW case). More...
 
auto & pw_coeffs (int ig__, spin_index ispn__, band_index i__)
 Return reference to the plane-wave coefficient for a given plane-wave, spin and band indices. More...
 
auto & pw_coeffs (spin_index ispn__)
 
const auto & pw_coeffs (spin_index ispn__) const
 
auto grid_layout_pw (spin_index ispn__, band_range b__) const
 Return COSTA layout for the plane-wave part for a given spin index and band range. More...
 
auto const & gkvec () const
 
auto gkvec_sptr () const
 
auto checksum_pw (sddk::memory_t mem__, spin_index s__, band_range b__) const
 
auto checksum (sddk::memory_t mem__, spin_index s__, band_range b__) const
 
auto checksum (sddk::memory_t mem__, band_range b__) const
 
- Public Member Functions inherited from sirius::wf::Wave_functions_mt< T >
 Wave_functions_mt ()
 Constructor. More...
 
 Wave_functions_mt (mpi::Communicator const &comm__, std::vector< int > num_mt_coeffs__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__, int num_pw__=0)
 Constructor. More...
 
auto & mt_coeffs (int xi__, atom_index_t::local ia__, spin_index ispn__, band_index i__)
 Return reference to the coefficient by atomic orbital index, atom, spin and band indices. More...
 
auto const & mt_coeffs (int xi__, atom_index_t::local ia__, spin_index ispn__, band_index i__) const
 Return const reference to the coefficient by atomic orbital index, atom, spin and band indices. More...
 
std::complex< T > const * at (sddk::memory_t mem__, int xi__, atom_index_t::local ia__, spin_index s__, band_index b__) const
 Return const pointer to the coefficient by atomic orbital index, atom, spin and band indices. More...
 
auto at (sddk::memory_t mem__, int xi__, atom_index_t::local ia__, spin_index s__, band_index b__)
 Return pointer to the coefficient by atomic orbital index, atom, spin and band indices. More...
 
auto const & spl_num_atoms () const
 Return a split index for the number of atoms. More...
 
void copy_mt_to (sddk::memory_t mem__, spin_index s__, band_range br__)
 Copy muffin-tin coefficients to host or GPU memory. More...
 
auto grid_layout_mt (spin_index ispn__, band_range b__)
 Return COSTA layout for the muffin-tin part for a given spin index and band range. More...
 
auto checksum_mt (sddk::memory_t mem__, spin_index s__, band_range br__) const
 Compute checksum of the muffin-tin coefficients. More...
 
auto num_mt_coeffs () const
 Return vector of muffin-tin coefficients for all atoms. More...
 
auto const & comm () const
 Return const reference to the communicator. More...
 
auto const & mt_coeffs_distr () const
 
- Public Member Functions inherited from sirius::wf::Wave_functions_base< T >
 Wave_functions_base ()
 Constructor. More...
 
 Wave_functions_base (int num_pw__, int num_mt__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__)
 Constructor. More...
 
auto memory_guard (sddk::memory_t mem__, wf::copy_to copy_to__=copy_to::none) const
 Return an instance of the memory guard. More...
 
auto num_sc () const
 Return number of spin components. More...
 
auto num_md () const
 Return number of magnetic dimensions. More...
 
auto num_wf () const
 Return number of wave-functions. More...
 
auto ld () const
 Return leading dimensions of the wave-functions coefficients array. More...
 
auto actual_spin_index (spin_index s__) const
 Return the actual spin index of the wave-functions. More...
 
void zero (sddk::memory_t mem__, spin_index s__, band_range br__)
 Zero a spin component of the wave-functions in a band range. More...
 
void zero (sddk::memory_t mem__)
 Zero all wave-functions. More...
 
std::complex< T > const * at (sddk::memory_t mem__, int i__, spin_index s__, band_index b__) const
 Return const pointer to the wave-function coefficient at a given index, spin and band. More...
 
auto at (sddk::memory_t mem__, int i__, spin_index s__, band_index b__)
 Return pointer to the wave-function coefficient at a given index, spin and band. More...
 
void allocate (sddk::memory_t mem__)
 Allocate wave-functions. More...
 
void deallocate (sddk::memory_t mem__)
 Deallocate wave-functions. More...
 
void copy_to (sddk::memory_t mem__)
 Copy date to host or device. More...
 

Private Attributes

std::shared_ptr< fft::Gvecgkvec_
 Pointer to G+k- vectors object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sirius::wf::Wave_functions_mt< T >
 Wave_functions_mt (mpi::Communicator const &comm__, num_mag_dims num_md__, num_bands num_wf__, sddk::memory_t default_mem__, int num_pw__)
 Construct without muffin-tin part. More...
 
- Static Protected Member Functions inherited from sirius::wf::Wave_functions_mt< T >
static int get_local_num_mt_coeffs (std::vector< int > num_mt_coeffs__, mpi::Communicator const &comm__)
 Calculate the local number of muffin-tin coefficients. More...
 
- Protected Attributes inherited from sirius::wf::Wave_functions_mt< T >
mpi::Communicator const & comm_
 Communicator that is used to split atoms between MPI ranks. More...
 
int num_atoms_ {0}
 Total number of atoms. More...
 
splindex_block< atom_index_tspl_num_atoms_
 Distribution of atoms between MPI ranks. More...
 
mpi::block_data_descriptor mt_coeffs_distr_
 Local size of muffin-tin coefficients for each rank. More...
 
std::vector< int > offset_in_local_mt_coeffs_
 Local offset in the block of MT coefficients for current rank. More...
 
std::vector< int > num_mt_coeffs_
 Numbef of muffin-tin coefficients for each atom. More...
 
- Protected Attributes inherited from sirius::wf::Wave_functions_base< T >
int num_pw_ {0}
 Local number of plane-wave coefficients. More...
 
int num_mt_ {0}
 Local number of muffin-tin coefficients. More...
 
num_mag_dims num_md_ {0}
 Number of magnetic dimensions (0, 1, or 3). More...
 
num_bands num_wf_ {0}
 Total number of wave-functions. More...
 
num_spins num_sc_ {0}
 Number of spin components (1 or 2). More...
 
std::array< sddk::mdarray< std::complex< T >, 2 >, 2 > data_
 Data storage for the wave-functions. More...
 

Detailed Description

template<typename T>
class sirius::wf::Wave_functions< T >

Wave-functions representation.

Wave-functions consist of two parts: plane-wave part and mufin-tin part. Wave-functions have one or two spin components. In case of collinear magnetism each component represents a pure (up- or dn-) spinor state and they are independent. In non-collinear case the two components represent a full spinor state.

Template Parameters
TPrecision type of the wave-functions (double or float).

Definition at line 690 of file wave_functions.hpp.

Constructor & Destructor Documentation

◆ Wave_functions() [1/2]

template<typename T >
sirius::wf::Wave_functions< T >::Wave_functions ( std::shared_ptr< fft::Gvec gkvec__,
num_mag_dims  num_md__,
num_bands  num_wf__,
sddk::memory_t  default_mem__ 
)
inline

Constructor for pure plane-wave functions.

Definition at line 697 of file wave_functions.hpp.

◆ Wave_functions() [2/2]

template<typename T >
sirius::wf::Wave_functions< T >::Wave_functions ( std::shared_ptr< fft::Gvec gkvec__,
std::vector< int >  num_mt_coeffs__,
num_mag_dims  num_md__,
num_bands  num_wf__,
sddk::memory_t  default_mem__ 
)
inline

Constructor for wave-functions with plane-wave and muffin-tin parts (LAPW case).

Definition at line 704 of file wave_functions.hpp.

Member Function Documentation

◆ pw_coeffs() [1/3]

template<typename T >
auto & sirius::wf::Wave_functions< T >::pw_coeffs ( int  ig__,
spin_index  ispn__,
band_index  i__ 
)
inline

Return reference to the plane-wave coefficient for a given plane-wave, spin and band indices.

Definition at line 713 of file wave_functions.hpp.

◆ pw_coeffs() [2/3]

template<typename T >
auto & sirius::wf::Wave_functions< T >::pw_coeffs ( spin_index  ispn__)
inline

Definition at line 718 of file wave_functions.hpp.

◆ pw_coeffs() [3/3]

template<typename T >
const auto & sirius::wf::Wave_functions< T >::pw_coeffs ( spin_index  ispn__) const
inline

Definition at line 723 of file wave_functions.hpp.

◆ grid_layout_pw()

template<typename T >
auto sirius::wf::Wave_functions< T >::grid_layout_pw ( spin_index  ispn__,
band_range  b__ 
) const
inline

Return COSTA layout for the plane-wave part for a given spin index and band range.

Definition at line 730 of file wave_functions.hpp.

◆ gkvec()

template<typename T >
auto const & sirius::wf::Wave_functions< T >::gkvec ( ) const
inline

Definition at line 754 of file wave_functions.hpp.

◆ gkvec_sptr()

template<typename T >
auto sirius::wf::Wave_functions< T >::gkvec_sptr ( ) const
inline

Definition at line 760 of file wave_functions.hpp.

◆ checksum_pw()

template<typename T >
auto sirius::wf::Wave_functions< T >::checksum_pw ( sddk::memory_t  mem__,
spin_index  s__,
band_range  b__ 
) const
inline

Definition at line 765 of file wave_functions.hpp.

◆ checksum() [1/2]

template<typename T >
auto sirius::wf::Wave_functions< T >::checksum ( sddk::memory_t  mem__,
spin_index  s__,
band_range  b__ 
) const
inline

Definition at line 784 of file wave_functions.hpp.

◆ checksum() [2/2]

template<typename T >
auto sirius::wf::Wave_functions< T >::checksum ( sddk::memory_t  mem__,
band_range  b__ 
) const
inline

Definition at line 789 of file wave_functions.hpp.

Member Data Documentation

◆ gkvec_

template<typename T >
std::shared_ptr<fft::Gvec> sirius::wf::Wave_functions< T >::gkvec_
private

Pointer to G+k- vectors object.

Definition at line 694 of file wave_functions.hpp.


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