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

Endpoint magnetism with reusable device workspaces and position-aware caches. More...

#include <td_spin_pw.h>

Collaboration diagram for pw::TDSpinPW< Real, Device >:

Public Member Functions

void initialize (const UnitCell &cell, const ModulePW::PW_Basis &grid, const ModulePW::PW_Basis_K &basis, const K_Vectors &kv, Structure_Factor &sf, pseudopot_cell_vnl &pp, const std::string &mag_partition, const std::string &orbital_dir, double onsite_radius, bool calc_torque)
 Bind once; dependencies outlive this object and retain their cell and layout. The caller must refresh structure factors and electronic data before sampling moved ions.
TDSpinResultPW calculate (const psi::Psi< Complex, Device > &psi, const elecstate::ElecState &state, const ModuleBase::Vector3< double > &a)
 Sample all ranks and restore the k cursor; coordinate changes invalidate geometric caches.

Private Types

using Complex = std::complex<Real>

Private Member Functions

void sync_positions ()
void density (const elecstate::ElecState &state, TDSpinResultPW *result)
void soc (const psi::Psi< Complex, Device > &psi, const ModuleBase::matrix &weights, const ModuleBase::Vector3< double > &a, TDSpinResultPW *result)
void onsite (const psi::Psi< Complex, Device > &psi, const elecstate::ElecState &state, const ModuleBase::Vector3< double > &a, TDSpinResultPW *result)

Private Attributes

const UnitCell * cell_ = nullptr
const ModulePW::PW_Basis * grid_ = nullptr
const ModulePW::PW_Basis_K * basis_ = nullptr
const K_Vectors * kv_ = nullptr
Structure_Factor * sf_ = nullptr
pseudopot_cell_vnl * pp_ = nullptr
std::string mag_partition_
std::string orbital_dir_
double onsite_radius_ = 0.0
bool calc_torque_ = false
std::vector< ModuleBase::Vector3< double > > pos_cache_
std::vector< int > labels_
hamilt::NonlocalWorkspace< Complex, Device > nonlocal_
ct::Tensor beta_
std::vector< Complex > projections_
std::vector< Complex > contracted_
std::unique_ptr< psi::Psi< std::complex< double >, Device > > onsite_psi_
std::unique_ptr< projectors::OnsiteProjector< double, Device > > onsite_projector_
double q_bound_ = 0.0

Detailed Description

template<typename Real, typename Device>
class pw::TDSpinPW< Real, Device >

Endpoint magnetism with reusable device workspaces and position-aware caches.

Member Typedef Documentation

◆ Complex

template<typename Real, typename Device>
using pw::TDSpinPW< Real, Device >::Complex = std::complex<Real>
private

Member Function Documentation

◆ calculate()

template<typename Real, typename Device>
TDSpinResultPW pw::TDSpinPW< Real, Device >::calculate ( const psi::Psi< Complex, Device > & psi,
const elecstate::ElecState & state,
const ModuleBase::Vector3< double > & a )

Sample all ranks and restore the k cursor; coordinate changes invalidate geometric caches.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ density()

template<typename Real, typename Device>
void pw::TDSpinPW< Real, Device >::density ( const elecstate::ElecState & state,
TDSpinResultPW * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

template<typename Real, typename Device>
void pw::TDSpinPW< Real, Device >::initialize ( const UnitCell & cell,
const ModulePW::PW_Basis & grid,
const ModulePW::PW_Basis_K & basis,
const K_Vectors & kv,
Structure_Factor & sf,
pseudopot_cell_vnl & pp,
const std::string & mag_partition,
const std::string & orbital_dir,
double onsite_radius,
bool calc_torque )

Bind once; dependencies outlive this object and retain their cell and layout. The caller must refresh structure factors and electronic data before sampling moved ions.

Parameters
mag_partitionAtomic moment partition: none, voronoi, or onsite.
orbital_dirDirectory containing the onsite projector orbitals.
onsite_radiusOnsite projector cutoff in Bohr.
calc_torqueWhether to calculate XC and SOC spin torques.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onsite()

template<typename Real, typename Device>
void pw::TDSpinPW< Real, Device >::onsite ( const psi::Psi< Complex, Device > & psi,
const elecstate::ElecState & state,
const ModuleBase::Vector3< double > & a,
TDSpinResultPW * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ soc()

template<typename Real, typename Device>
void pw::TDSpinPW< Real, Device >::soc ( const psi::Psi< Complex, Device > & psi,
const ModuleBase::matrix & weights,
const ModuleBase::Vector3< double > & a,
TDSpinResultPW * result )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_positions()

template<typename Real, typename Device>
void pw::TDSpinPW< Real, Device >::sync_positions ( )
private
Here is the caller graph for this function:

Member Data Documentation

◆ basis_

template<typename Real, typename Device>
const ModulePW::PW_Basis_K* pw::TDSpinPW< Real, Device >::basis_ = nullptr
private

◆ beta_

template<typename Real, typename Device>
ct::Tensor pw::TDSpinPW< Real, Device >::beta_
private

◆ calc_torque_

template<typename Real, typename Device>
bool pw::TDSpinPW< Real, Device >::calc_torque_ = false
private

◆ cell_

template<typename Real, typename Device>
const UnitCell* pw::TDSpinPW< Real, Device >::cell_ = nullptr
private

◆ contracted_

template<typename Real, typename Device>
std::vector<Complex> pw::TDSpinPW< Real, Device >::contracted_
private

◆ grid_

template<typename Real, typename Device>
const ModulePW::PW_Basis* pw::TDSpinPW< Real, Device >::grid_ = nullptr
private

◆ kv_

template<typename Real, typename Device>
const K_Vectors* pw::TDSpinPW< Real, Device >::kv_ = nullptr
private

◆ labels_

template<typename Real, typename Device>
std::vector<int> pw::TDSpinPW< Real, Device >::labels_
private

◆ mag_partition_

template<typename Real, typename Device>
std::string pw::TDSpinPW< Real, Device >::mag_partition_
private

◆ nonlocal_

template<typename Real, typename Device>
hamilt::NonlocalWorkspace<Complex, Device> pw::TDSpinPW< Real, Device >::nonlocal_
private

◆ onsite_projector_

template<typename Real, typename Device>
std::unique_ptr<projectors::OnsiteProjector<double, Device> > pw::TDSpinPW< Real, Device >::onsite_projector_
private

◆ onsite_psi_

template<typename Real, typename Device>
std::unique_ptr<psi::Psi<std::complex<double>, Device> > pw::TDSpinPW< Real, Device >::onsite_psi_
private

◆ onsite_radius_

template<typename Real, typename Device>
double pw::TDSpinPW< Real, Device >::onsite_radius_ = 0.0
private

◆ orbital_dir_

template<typename Real, typename Device>
std::string pw::TDSpinPW< Real, Device >::orbital_dir_
private

◆ pos_cache_

template<typename Real, typename Device>
std::vector<ModuleBase::Vector3<double> > pw::TDSpinPW< Real, Device >::pos_cache_
private

◆ pp_

template<typename Real, typename Device>
pseudopot_cell_vnl* pw::TDSpinPW< Real, Device >::pp_ = nullptr
private

◆ projections_

template<typename Real, typename Device>
std::vector<Complex> pw::TDSpinPW< Real, Device >::projections_
private

◆ q_bound_

template<typename Real, typename Device>
double pw::TDSpinPW< Real, Device >::q_bound_ = 0.0
private

◆ sf_

template<typename Real, typename Device>
Structure_Factor* pw::TDSpinPW< Real, Device >::sf_ = nullptr
private

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