SIRIUS 7.5.0
Electronic structure library and applications
|
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... | |
T | 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_fft > | gvec_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... | |
T | v0_ [2] |
V(G=0) matrix elements. More... | |
Representation of the local operator.
The following functionality is implementated:
Definition at line 207 of file local_operator.hpp.
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.
[in] | ctx | Simulation context. |
[in] | fft_coarse | Explicit FFT driver for the coarse mesh. |
[in] | gvec_coarse_p | FFT-friendly G-vector distribution for the coarse mesh. |
[in] | potential | Effective 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.
void sirius::Local_operator< T >::prepare_k | ( | fft::Gvec_fft const & | gkvec_p__ | ) |
Prepare the k-point dependent arrays.
[in] | gkvec_p | FFT-friendly G+k vector partitioning. |
Definition at line 179 of file local_operator.cpp.
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.
[in] | spfftk | SpFFT transform object for G+k vectors. |
[in] | gkvec_p | FFT-friendly G+k vector partitioning. |
[in] | spins | Range of wave-function spins to which Hloc is applied. |
[in] | phi | Input wave-functions. |
[out] | hphi | Local hamiltonian applied to wave-function. |
[in] | idx0 | Starting index of wave-functions. |
[in] | n | Number of wave-functions to which H is applied. |
Spin range can take the following values:
Local Hamiltonian includes kinetic term and local part of potential.
Definition at line 283 of file local_operator.cpp.
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.
[in] | spfftk | SpFFT transform object for G+k vectors. |
[in] | gkvec_p | FFT-friendly G+k vector partitioning. |
[in] | N | Starting index of wave-functions. |
[in] | n | Number of wave-functions to which H and O are applied. |
[in] | phi | Input wave-functions [always on CPU]. |
[out] | hphi | LAPW Hamiltonian applied to wave-function [CPU || GPU]. |
[out] | ophi | LAPW 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.
|
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>.
[in] | spfftk | SpFFT transform object for G+k vectors. |
[in] | phi | Input wave-functions. |
[out] | bphi | Output vector of magentic field components, applied to the wave-functions. |
[in] | br | Range of bands to which B is applied. |
Definition at line 324 of file local_operator.hpp.
|
private |
Common parameters.
Definition at line 211 of file local_operator.hpp.
|
private |
Coarse-grid FFT driver for this operator.
Definition at line 214 of file local_operator.hpp.
|
private |
Distribution of the G-vectors for the FFT transformation.
Definition at line 217 of file local_operator.hpp.
|
private |
Kinetic energy of G+k plane-waves.
Definition at line 220 of file local_operator.hpp.
|
private |
Definition at line 222 of file local_operator.hpp.
|
private |
Effective potential components and unit step function on a coarse FFT grid.
The following elements are stored in the array:
Definition at line 244 of file local_operator.hpp.
|
private |
Temporary array to store [V*phi](G)
Definition at line 247 of file local_operator.hpp.
|
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.
|
private |
V(G=0) matrix elements.
Definition at line 254 of file local_operator.hpp.