SIRIUS 7.5.0
Electronic structure library and applications
|
Base class for the wave-functions. More...
#include <wave_functions.hpp>
Inherited by sirius::wf::Wave_functions_fft< T >, and sirius::wf::Wave_functions_mt< T >.
Public Member Functions | |
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... | |
Protected Attributes | |
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... | |
Friends | |
class | Wave_functions_fft< T > |
Friend class declaration. More... | |
Base class for the wave-functions.
Wave-functions are represented by a set of plane-wave and muffin-tin coefficients stored consecutively in a 2D array. The leading dimensions of this array is a sum of the number of plane-waves and the number of muffin-tin coefficients.
band index +-----------+ | | | | ig | PW part | | | | | +-----------+ | | xi | MT part | | | +-----------+
Definition at line 324 of file wave_functions.hpp.
|
inline |
Constructor.
Definition at line 348 of file wave_functions.hpp.
|
inline |
Constructor.
Definition at line 352 of file wave_functions.hpp.
|
inline |
Return an instance of the memory guard.
When the instance is created, it allocates the GPU memory and optionally copies data to the GPU. When the instance is destroyed, the data is optionally copied to host and GPU memory is deallocated.
Definition at line 377 of file wave_functions.hpp.
|
inline |
Return number of spin components.
Definition at line 383 of file wave_functions.hpp.
|
inline |
Return number of magnetic dimensions.
Definition at line 389 of file wave_functions.hpp.
|
inline |
Return number of wave-functions.
Definition at line 395 of file wave_functions.hpp.
|
inline |
Return leading dimensions of the wave-functions coefficients array.
Definition at line 401 of file wave_functions.hpp.
|
inline |
Return the actual spin index of the wave-functions.
Return 0 if the wave-functions are non-magnetic, otherwise return the input spin index.
Definition at line 408 of file wave_functions.hpp.
|
inline |
Zero a spin component of the wave-functions in a band range.
Definition at line 419 of file wave_functions.hpp.
|
inline |
Zero all wave-functions.
Definition at line 436 of file wave_functions.hpp.
|
inline |
Return const pointer to the wave-function coefficient at a given index, spin and band.
Definition at line 447 of file wave_functions.hpp.
|
inline |
Return pointer to the wave-function coefficient at a given index, spin and band.
Definition at line 454 of file wave_functions.hpp.
|
inline |
Allocate wave-functions.
This function is primarily called by a memory_guard to allocate GPU memory.
Definition at line 462 of file wave_functions.hpp.
|
inline |
Deallocate wave-functions.
This function is primarily called by a memory_guard to deallocate GPU memory.
Definition at line 472 of file wave_functions.hpp.
|
inline |
Copy date to host or device.
Definition at line 481 of file wave_functions.hpp.
|
friend |
Friend class declaration.
Wave_functions_fft needs access to data to alias the pointers and avoid copy in trivial cases.
Definition at line 337 of file wave_functions.hpp.
|
protected |
Local number of plane-wave coefficients.
Definition at line 328 of file wave_functions.hpp.
|
protected |
Local number of muffin-tin coefficients.
Definition at line 330 of file wave_functions.hpp.
|
protected |
Number of magnetic dimensions (0, 1, or 3).
This helps to distinguish between non-magnetic, collinear and full spinor wave-functions.
Definition at line 333 of file wave_functions.hpp.
|
protected |
Total number of wave-functions.
Definition at line 335 of file wave_functions.hpp.
|
protected |
Number of spin components (1 or 2).
Definition at line 337 of file wave_functions.hpp.
|
protected |
Data storage for the wave-functions.
Wave-functions are stored as two independent arrays for spin-up and spin-dn. The planewave and muffin-tin coefficients are stored consecutively.
Definition at line 344 of file wave_functions.hpp.