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

Representation of the local operator. More...

#include <local_operator.hpp>

Classes

struct  v_local_index_t
 

Public Member Functions

 Local_operator (Simulation_context const &ctx__, fft::spfft_transform_type< T > &fft_coarse__, std::shared_ptr< fft::Gvec_fft > gvec_coarse_fft__, Potential *potential__=nullptr)
 Constructor. More...
 
void prepare_k (fft::Gvec_fft const &gkvec_p__)
 Prepare the k-point dependent arrays. More...
 
void apply_h (fft::spfft_transform_type< T > &spfftk__, std::shared_ptr< fft::Gvec_fft > gkvec_fft__, wf::spin_range spins__, wf::Wave_functions< T > const &phi__, wf::Wave_functions< T > &hphi__, wf::band_range br__)
 Apply local part of Hamiltonian to pseudopotential wave-functions. More...
 
void apply_fplapw (fft::spfft_transform_type< T > &spfftik__, std::shared_ptr< fft::Gvec_fft > gkvec_fft__, wf::band_range b__, wf::Wave_functions< T > &phi__, wf::Wave_functions< T > *hphi__, wf::Wave_functions< T > *ophi__, wf::Wave_functions< T > *bzphi__, wf::Wave_functions< T > *bxyphi__)
 Apply local part of LAPW Hamiltonian and overlap operators. More...
 
v0 (int ispn__) const
 Apply magnetic field to the full-potential wave-functions. More...
 

Private Attributes

Simulation_context const & ctx_
 Common parameters. More...
 
fft::spfft_transform_type< T > & fft_coarse_
 Coarse-grid FFT driver for this operator. More...
 
std::shared_ptr< fft::Gvec_fftgvec_coarse_p_
 Distribution of the G-vectors for the FFT transformation. More...
 
sddk::mdarray< T, 1 > pw_ekin_
 Kinetic energy of G+k plane-waves. More...
 
sddk::mdarray< T, 2 > gkvec_cart_
 
std::array< std::unique_ptr< Smooth_periodic_function< T > >, 6 > veff_vec_
 Effective potential components and unit step function on a coarse FFT grid. More...
 
sddk::mdarray< std::complex< T >, 1 > vphi_
 Temporary array to store [V*phi](G) More...
 
sddk::mdarray< std::complex< T >, 1 > buf_rg_
 Temporary array to store psi_{up}(r). More...
 
v0_ [2]
 V(G=0) matrix elements. More...
 

Detailed Description

template<typename T>
class sirius::Local_operator< T >

Representation of the local operator.

The following functionality is implementated:

Definition at line 207 of file local_operator.hpp.

Constructor & Destructor Documentation

◆ Local_operator()

template<typename T >
sirius::Local_operator< T >::Local_operator ( Simulation_context const &  ctx__,
fft::spfft_transform_type< T > &  fft_coarse__,
std::shared_ptr< fft::Gvec_fft gvec_coarse_fft__,
Potential potential__ = nullptr 
)

Constructor.

Prepares k-point independent part of the local potential. If potential is provided, it is mapped to the coarse FFT grid, otherwise the constant potential is assumed for the debug and benchmarking purposes. In the case of GPU-enabled FFT driver all effective fields on the coarse grid are copied to the device and remain there until the local operator is destroyed.

Parameters
[in]ctxSimulation context.
[in]fft_coarseExplicit FFT driver for the coarse mesh.
[in]gvec_coarse_pFFT-friendly G-vector distribution for the coarse mesh.
[in]potentialEffective potential and magnetic fields \( V_{eff}({\bf r}) \) and \( {\bf B}_{eff}({\bf r}) \) on the fine FFT grid.

Definition at line 34 of file local_operator.cpp.

Member Function Documentation

◆ prepare_k()

template<typename T >
void sirius::Local_operator< T >::prepare_k ( fft::Gvec_fft const &  gkvec_p__)

Prepare the k-point dependent arrays.

Parameters
[in]gkvec_pFFT-friendly G+k vector partitioning.

Definition at line 179 of file local_operator.cpp.

◆ apply_h()

template<typename T >
void sirius::Local_operator< T >::apply_h ( fft::spfft_transform_type< T > &  spfftk__,
std::shared_ptr< fft::Gvec_fft gkvec_fft__,
wf::spin_range  spins__,
wf::Wave_functions< T > const &  phi__,
wf::Wave_functions< T > &  hphi__,
wf::band_range  br__ 
)

Apply local part of Hamiltonian to pseudopotential wave-functions.

Parameters
[in]spfftkSpFFT transform object for G+k vectors.
[in]gkvec_pFFT-friendly G+k vector partitioning.
[in]spinsRange of wave-function spins to which Hloc is applied.
[in]phiInput wave-functions.
[out]hphiLocal hamiltonian applied to wave-function.
[in]idx0Starting index of wave-functions.
[in]nNumber of wave-functions to which H is applied.

Spin range can take the following values:

  • [0, 0]: apply H_{uu} to the up- component of wave-functions
  • [1, 1]: apply H_{dd} to the dn- component of wave-functions
  • [0, 1]: apply full Hamiltonian to the spinor wave-functions

Local Hamiltonian includes kinetic term and local part of potential.

Definition at line 283 of file local_operator.cpp.

◆ apply_fplapw()

template<typename T >
void sirius::Local_operator< T >::apply_fplapw ( fft::spfft_transform_type< T > &  spfftik__,
std::shared_ptr< fft::Gvec_fft gkvec_fft__,
wf::band_range  b__,
wf::Wave_functions< T > &  phi__,
wf::Wave_functions< T > *  hphi__,
wf::Wave_functions< T > *  ophi__,
wf::Wave_functions< T > *  bzphi__,
wf::Wave_functions< T > *  bxyphi__ 
)

Apply local part of LAPW Hamiltonian and overlap operators.

Parameters
[in]spfftkSpFFT transform object for G+k vectors.
[in]gkvec_pFFT-friendly G+k vector partitioning.
[in]NStarting index of wave-functions.
[in]nNumber of wave-functions to which H and O are applied.
[in]phiInput wave-functions [always on CPU].
[out]hphiLAPW Hamiltonian applied to wave-function [CPU || GPU].
[out]ophiLAPW overlap matrix applied to wave-function [CPU || GPU].

Only plane-wave part of output wave-functions is changed.

Definition at line 477 of file local_operator.cpp.

◆ v0()

template<typename T >
T sirius::Local_operator< T >::v0 ( int  ispn__) const
inline

Apply magnetic field to the full-potential wave-functions.

In case of collinear magnetism only Bz is applied to phi and stored in the first component of bphi. In case of non-collinear magnetims Bx-iBy is also applied and stored in the third component of bphi. The second component of bphi is used to store -Bz|phi>.

Parameters
[in]spfftkSpFFT transform object for G+k vectors.
[in]phiInput wave-functions.
[out]bphiOutput vector of magentic field components, applied to the wave-functions.
[in]brRange of bands to which B is applied.

Definition at line 324 of file local_operator.hpp.

Member Data Documentation

◆ ctx_

template<typename T >
Simulation_context const& sirius::Local_operator< T >::ctx_
private

Common parameters.

Definition at line 211 of file local_operator.hpp.

◆ fft_coarse_

template<typename T >
fft::spfft_transform_type<T>& sirius::Local_operator< T >::fft_coarse_
private

Coarse-grid FFT driver for this operator.

Definition at line 214 of file local_operator.hpp.

◆ gvec_coarse_p_

template<typename T >
std::shared_ptr<fft::Gvec_fft> sirius::Local_operator< T >::gvec_coarse_p_
private

Distribution of the G-vectors for the FFT transformation.

Definition at line 217 of file local_operator.hpp.

◆ pw_ekin_

template<typename T >
sddk::mdarray<T, 1> sirius::Local_operator< T >::pw_ekin_
private

Kinetic energy of G+k plane-waves.

Definition at line 220 of file local_operator.hpp.

◆ gkvec_cart_

template<typename T >
sddk::mdarray<T, 2> sirius::Local_operator< T >::gkvec_cart_
private

Definition at line 222 of file local_operator.hpp.

◆ veff_vec_

template<typename T >
std::array<std::unique_ptr<Smooth_periodic_function<T> >, 6> sirius::Local_operator< T >::veff_vec_
private

Effective potential components and unit step function on a coarse FFT grid.

The following elements are stored in the array:

  • V(r) + B_z(r) (in PP-PW case) or V(r) (in FP-LAPW case)
  • V(r) - B_z(r) (in PP-PW case) or B_z(r) (in FP-LAPW case)
  • B_x(r)
  • B_y(r)
  • Theta(r) (in FP-LAPW case)
  • inverse of 1 + relative mass (needed for ZORA LAPW)

Definition at line 244 of file local_operator.hpp.

◆ vphi_

template<typename T >
sddk::mdarray<std::complex<T>, 1> sirius::Local_operator< T >::vphi_
private

Temporary array to store [V*phi](G)

Definition at line 247 of file local_operator.hpp.

◆ buf_rg_

template<typename T >
sddk::mdarray<std::complex<T>, 1> sirius::Local_operator< T >::buf_rg_
private

Temporary array to store psi_{up}(r).

The size of the array is equal to the size of FFT buffer.

Definition at line 251 of file local_operator.hpp.

◆ v0_

template<typename T >
T sirius::Local_operator< T >::v0_[2]
private

V(G=0) matrix elements.

Definition at line 254 of file local_operator.hpp.


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