ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
elecstate Namespace Reference

Classes

struct  ChargeMoments
 Moments about one common origin. Charges carry their physical sign. More...
class  ElecState
class  ElecStateLCAO
class  ElecStatePW
class  ElecStatePW_SDFT
struct  fenergy
struct  Efermi
struct  elecstate_pw_op< FPTYPE, base_device::DEVICE_CPU >
struct  elecstate_pw_op
struct  MakovPayneResult
class  Efield
class  PotEfield
class  Gatefield
class  PotGate
class  H_Hartree_pw
class  PotHartree
class  H_TDDFT_pw
 Length-gauge RT-TDDFT potential backed by TDFieldManager. More...
class  PotBase
class  Pot_Cosikr
class  PotLocal
class  ML_EXX
class  PotML_EXX
class  PotPcc
 Self-consistent vacuum point-counter-charge (PCC) correction. More...
struct  SccsResume
class  PotSccs
class  PotSep
class  PotSurChem
class  PotXC
class  PotXC_FDM
class  Potential
class  SccsFixedSources
struct  PccOutput
struct  SccsOutput
struct  SolventGridField
struct  TDFieldSample
 Sampling location used to evaluate one time-dependent field profile. More...
class  TDFieldProfile
 Scalar time profile of one configured electric field. More...
class  TDField
 One configured field occurrence and its Cartesian direction. More...
struct  TDFieldState
 Field values for one trial interval, independent of the committed step counter. More...
class  TDFieldManager
 Own and advance all time-dependent electric fields in RT-TDDFT. More...
class  TDGaussianProfile
 Carrier cosine multiplied by a Gaussian envelope. More...
class  TDTrapezoidProfile
 Carrier cosine with linear-rise, plateau, and linear-fall envelope. More...
class  TDTrigonometricProfile
 Cosine carrier multiplied by a squared-sine envelope. More...
class  TDHeavisideProfile
 Constant field switched off at a specified electronic step. More...
class  TDSupersineProfile
 Compact supersine pulse derived from an analytic vector potential. More...
class  ParamUpdater
struct  Pcc0dParameters
struct  Pcc2dParameters
class  MockElecState
class  MockPot
class  MockPotComponent
class  UsppProjector
 Accumulate explicitly weighted collinear USPP states with reusable device buffers. More...

Functions

bool read_orb_file (int it, std::string &orbital_file, std::ofstream &ofs_running, Atom *atom)
void cal_dm (const Parallel_Orbitals *ParaV, const ModuleBase::matrix &wg, const psi::Psi< double > &wfc, std::vector< ModuleBase::matrix > &dm)
void cal_dm (const Parallel_Orbitals *ParaV, const ModuleBase::matrix &wg, const psi::Psi< std::complex< double > > &wfc, std::vector< ModuleBase::ComplexMatrix > &dm)
ChargeMoments charge_moments (const double *charges, const ModuleBase::Vector3< double > *relative_positions, const int count, const double weight)
ChargeMoments add_charge_moments (const ChargeMoments &left, const ChargeMoments &right)
void init_scf (const UnitCell &ucell, const Parallel_Grid &pgrid, const ModuleBase::ComplexMatrix &strucfac, const bool *numeric, const int istep, const std::string &out_dir, const Input_para &inp, ElecState *pelec)
 Init rho_core, init rho, renormalize rho, init pot.
void print_scf_iterinfo (const std::string &ks_solver, const int &istep, const int &witer, const std::vector< double > &mag, const int &wmag, const double &etot, const double &ediff, const int &wener, const std::vector< double > &drho, const int &wrho, const double &time, const int &wtime, const double &ds_rms)
void print_etot (const Magnetism &magnet, const ElecState &elec, const bool converged, const int &iter_in, const int iter_limit, const double &scf_thr, const double &scf_thr_kin, const double &duration, const Input_para &inp, const bool two_fermi, const double &pw_diag_thr, const double &avg_iter, const bool print, const double &ds_rms)
 print total free energy and other energies
void print_format (const std::string &name, const double &value)
 function to print name, value and value*Ry_to_eV
template<typename Device>
const std::vector< double > * get_becsum (const ElecState &elec)
 Return the USPP projector occupancy coefficients of a PW electronic state.
template const std::vector< double > * get_becsum< base_device::DEVICE_CPU > (const ElecState &elec)
void calEBand (const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, fenergy &f_en)
void calculate_weights (const ModuleBase::matrix &ekb, ModuleBase::matrix &wg, const K_Vectors *klist, Efermi &eferm, fenergy &f_en, std::vector< double > &nelec_spin, const int global_nbands, const bool skip_weights)
void fixed_weights (const std::vector< double > &ocp_kb, const int &nbands, const double &nelec, const K_Vectors *klist, ModuleBase::matrix &wg, bool &skip_weights)
MakovPayneResult makov_payne_correction (const UnitCell &ucell, const Charge &charge, const double *v_elecstat, bool print)
void sccs_cfg_input (const Input_para &input, ModuleSccs::SccsConfig &config, ModuleSccs::PolarizationSolverParameters &solver)
std::string check_sccs_cell (const ModuleSccs::SccsConfig &config, const UnitCell &cell)
std::string check_charge (const ModuleSccs::SccsConfig &config, const UnitCell &cell, double electron_count)
void collect_output (const UnitCell &cell, const ModulePW::PW_Basis &basis, const std::vector< unitcell::AtomData > &atoms, const std::vector< ModuleBase::Vector3< double > > &grid_positions, const std::vector< double > &ions, const std::vector< double > &charge, const ModuleSccs::SccsConfig &config, const ModuleSccs::SccsResponse &response, SccsOutput &result)
void write_sccs_wait (std::ostream &output, double residual, double start_drho, int start_nmax)
void write_sccs_out (std::ostream &output, const SccsOutput &result, int level, double solvation_energy, bool pcc, double pcc_energy)
void pcc_0d_geometry (const UnitCell &cell, const std::vector< unitcell::AtomData > &atoms, unitcell::OrthogonalCell &geometry, Pcc0dParameters &parameters)
void pcc_0d_relative (const unitcell::OrthogonalCell &geometry, std::vector< ModuleBase::Vector3< double > > &positions)
void pcc_0d_operator (const UnitCell &cell, const ModulePW::PW_Basis &basis, const std::vector< unitcell::AtomData > &atoms, const std::vector< ModuleBase::Vector3< double > > &grid_positions, std::unique_ptr< ModuleSccs::CoulombOperator > &coulomb)
void pcc_2d_geometry (const UnitCell &cell, const std::vector< unitcell::AtomData > &atoms, int open_axis, unitcell::SlabCell &geometry, Pcc2dParameters &parameters)
void pcc_2d_project (const unitcell::SlabCell &geometry, std::vector< ModuleBase::Vector3< double > > &positions)
void pcc_2d_operator (const UnitCell &cell, const ModulePW::PW_Basis &basis, const std::vector< unitcell::AtomData > &atoms, int open_axis, const std::vector< ModuleBase::Vector3< double > > &grid_positions, std::unique_ptr< ModuleSccs::CoulombOperator > &coulomb)
std::shared_ptr< TDFieldManager > create_td_field_manager (const Input_para &input)
 Build all field profiles and convert user input to propagation units.
void occ_from_proj (const std::complex< double > *proj, const double *wg_ik, const int nbands, const int npol, const int nkb, const int nspin, const int isk, const int *nh_iat, const int nat, std::complex< double > *occ_block)
 Accumulate per-projector 2x2 occupation blocks from the onsite projector coefficients for a single k-point.
void mix_occ_with_save (std::vector< std::vector< std::vector< ModuleBase::matrix > > > &occ_mat, const std::vector< std::vector< std::vector< ModuleBase::matrix > > > &occ_mat_save, const UnitCell &cell, const std::vector< int > &l_channel, const int nspin, const double beta)
bool make_pcc_0d_parameters (const unitcell::OrthogonalCell &cell, const double relative_tolerance, Pcc0dParameters &parameters)
double pcc_0d_potential (const ChargeMoments &moments, const ModuleBase::Vector3< double > &position, const Pcc0dParameters &parameters)
ModuleBase::Vector3< double > pcc_0d_gradient (const ChargeMoments &moments, const ModuleBase::Vector3< double > &position, const Pcc0dParameters &parameters)
double pcc_0d_bilinear_energy (const ChargeMoments &left, const ChargeMoments &right, const Pcc0dParameters &parameters)
double pcc_0d_energy (const ChargeMoments &moments, const Pcc0dParameters &parameters)
ModuleBase::Vector3< double > pcc_0d_force (const ChargeMoments &moments, const double ionic_charge, const ModuleBase::Vector3< double > &position, const Pcc0dParameters &parameters)
Pcc2dParameters make_pcc_2d_parameters (const unitcell::SlabCell &cell)
double pcc_2d_potential (const ChargeMoments &moments, const double coordinate, const ModuleBase::Vector3< double > &normal, const Pcc2dParameters &parameters)
ModuleBase::Vector3< double > pcc_2d_gradient (const ChargeMoments &moments, const double coordinate, const ModuleBase::Vector3< double > &normal, const Pcc2dParameters &parameters)
double pcc_2d_energy (const ChargeMoments &moments, const Pcc2dParameters &parameters)
ModuleBase::Vector3< double > pcc_2d_force (const ChargeMoments &moments, const double ionic_charge, const double coordinate, const ModuleBase::Vector3< double > &normal, const Pcc2dParameters &parameters)
void setup_estate_pw (UnitCell &ucell, K_Vectors &kv, Structure_Factor &sf, elecstate::ElecState *&pelec, Charge &chr, pseudopot_cell_vl &locpp, pseudopot_cell_vnl &ppcell, VSep *&vsep_cell, ModulePW::PW_Basis_K *pw_wfc, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, ModulePW::PW_Basis_Big *pw_big, surchem &solvent, const Input_para &inp)
template<typename T, typename Device>
void setup_estate_pw_impl (UnitCell &ucell, K_Vectors &kv, Structure_Factor &sf, elecstate::ElecState *&pelec, Charge &chr, pseudopot_cell_vl &locpp, pseudopot_cell_vnl &ppcell, VSep *&vsep_cell, ModulePW::PW_Basis_K *pw_wfc, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, ModulePW::PW_Basis_Big *pw_big, surchem &solvent, const Input_para &inp)
void teardown_estate_pw (elecstate::ElecState *&pelec, VSep *&vsep_cell)
template<typename T, typename Device>
void teardown_estate_pw_impl (elecstate::ElecState *&pelec, VSep *&vsep_cell)
void update_pot (UnitCell &ucell, elecstate::ElecState *&pelec, const Charge &chr, const bool conv_esolver)
int uspp_becsum_size (const UnitCell &ucell, const pseudopot_cell_vnl &ppcell, const int nspin)
 Size of the canonical [spin][atom][packed projector pair] storage.
void add_uspp_density (const UnitCell &ucell, const pseudopot_cell_vnl &ppcell, const ModulePW::PW_Basis &basis, const int nspin, const std::vector< double > &becsum, std::complex< double > **rhog)
 Add USPP augmentation to caller-owned dense-grid reciprocal densities. becsum uses i <= j pairs, with the off-diagonal multiplicity already included. The Q(G) tables supply volume normalization; state weights are dimensionless. The current scalar/collinear contraction does not acquire spinor support by setting nspin=4. Spinor support requires charge/magnetization coefficients and a compatible Q/projector representation, including review of the packed-pair convention for SOC.
std::vector< std::vector< std::complex< double > > > restore_dm (const K_Vectors &kv, const std::vector< std::vector< std::complex< double > > > &dm_k_ibz, const ModuleSymmetry::Symmetry_rotation &symrot, const Parallel_Blkcyclic &pv)
 for symmetry, multi-k, nspin<4: restore DM(k) form DM(k_ibz)
std::vector< std::vector< double > > restore_dm (const K_Vectors &kv, const std::vector< std::vector< double > > &dm_k_ibz, const ModuleSymmetry::Symmetry_rotation &symrot, const Parallel_Blkcyclic &pv)
 do nothing if gamma_only

Variables

template<typename TK>
int ElecStateLCAO< TK >::out_wfc_lcao = 0
template<typename TK>
bool ElecStateLCAO< TK >::need_psi_grid = true
double tmp_ucell_omega = 500.0
double tmp_gridecut = 80.0

Detailed Description

Function Documentation

◆ add_charge_moments()

ChargeMoments elecstate::add_charge_moments ( const ChargeMoments & left,
const ChargeMoments & right )
Here is the caller graph for this function:

◆ add_uspp_density()

void elecstate::add_uspp_density ( const UnitCell & ucell,
const pseudopot_cell_vnl & ppcell,
const ModulePW::PW_Basis & basis,
const int nspin,
const std::vector< double > & becsum,
std::complex< double > ** rhog )

Add USPP augmentation to caller-owned dense-grid reciprocal densities. becsum uses i <= j pairs, with the off-diagonal multiplicity already included. The Q(G) tables supply volume normalization; state weights are dimensionless. The current scalar/collinear contraction does not acquire spinor support by setting nspin=4. Spinor support requires charge/magnetization coefficients and a compatible Q/projector representation, including review of the packed-pair convention for SOC.

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

◆ cal_dm() [1/2]

void elecstate::cal_dm ( const Parallel_Orbitals * ParaV,
const ModuleBase::matrix & wg,
const psi::Psi< double > & wfc,
std::vector< ModuleBase::matrix > & dm )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_dm() [2/2]

void elecstate::cal_dm ( const Parallel_Orbitals * ParaV,
const ModuleBase::matrix & wg,
const psi::Psi< std::complex< double > > & wfc,
std::vector< ModuleBase::ComplexMatrix > & dm )
inline
Here is the call graph for this function:

◆ calculate_weights()

void elecstate::calculate_weights ( const ModuleBase::matrix & ekb,
ModuleBase::matrix & wg,
const K_Vectors * klist,
Efermi & eferm,
fenergy & f_en,
std::vector< double > & nelec_spin,
const int global_nbands,
const bool skip_weights )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calEBand()

void elecstate::calEBand ( const ModuleBase::matrix & ekb,
const ModuleBase::matrix & wg,
fenergy & f_en )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ charge_moments()

ChargeMoments elecstate::charge_moments ( const double * charges,
const ModuleBase::Vector3< double > * relative_positions,
int count,
double weight )

Local moments only; no MPI or cell/model dependencies. Use weight=1 for point charges and the volume element for a signed grid density. Zero samples are permitted.

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

◆ check_charge()

std::string elecstate::check_charge ( const ModuleSccs::SccsConfig & config,
const UnitCell & cell,
double electron_count )
Here is the caller graph for this function:

◆ check_sccs_cell()

std::string elecstate::check_sccs_cell ( const ModuleSccs::SccsConfig & config,
const UnitCell & cell )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ collect_output()

void elecstate::collect_output ( const UnitCell & cell,
const ModulePW::PW_Basis & basis,
const std::vector< unitcell::AtomData > & atoms,
const std::vector< ModuleBase::Vector3< double > > & grid_positions,
const std::vector< double > & ions,
const std::vector< double > & charge,
const ModuleSccs::SccsConfig & config,
const ModuleSccs::SccsResponse & response,
SccsOutput & result )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_td_field_manager()

std::shared_ptr< TDFieldManager > elecstate::create_td_field_manager ( const Input_para & input)

Build all field profiles and convert user input to propagation units.

Parameters specific to a waveform are paired with td_ttype by occurrence, while td_vext_dire is paired by the overall field index.

Parameters
inputValidated ABACUS input parameters.
Returns
Shared manager used by the ESolver and time-dependent potential.
Here is the caller graph for this function:

◆ fixed_weights()

void elecstate::fixed_weights ( const std::vector< double > & ocp_kb,
const int & nbands,
const double & nelec,
const K_Vectors * klist,
ModuleBase::matrix & wg,
bool & skip_weights )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_becsum()

template<typename Device>
const std::vector< double > * elecstate::get_becsum ( const ElecState & elec)

Return the USPP projector occupancy coefficients of a PW electronic state.

Parameters
elecElectronic state to inspect.
Returns
Read-only coefficients, or nullptr when the state is not a supported PW state for Device.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_becsum< base_device::DEVICE_CPU >()

template const std::vector< double > * elecstate::get_becsum< base_device::DEVICE_CPU > ( const ElecState & elec)

◆ init_scf()

void elecstate::init_scf ( const UnitCell & ucell,
const Parallel_Grid & pgrid,
const ModuleBase::ComplexMatrix & strucfac,
const bool * numeric,
const int istep,
const std::string & out_dir,
const Input_para & inp,
ElecState * pelec )

Init rho_core, init rho, renormalize rho, init pot.

Parameters
ucellunit cell
pgridparallel grid
strucfacstructure factor
numericnumeric flag
istepionic step index
out_diroutput directory
inpinput parameters
pelecpointer to ElecState

core correction potential.

renormalize the charge density

initialize the potential

output the initial potential

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

◆ make_pcc_0d_parameters()

bool elecstate::make_pcc_0d_parameters ( const unitcell::OrthogonalCell & cell,
double relative_tolerance,
Pcc0dParameters & parameters )

Return false unless the OrthogonalCell has equal edges within relative_tolerance. No cell geometry is stored here.

Here is the caller graph for this function:

◆ make_pcc_2d_parameters()

Pcc2dParameters elecstate::make_pcc_2d_parameters ( const unitcell::SlabCell & cell)
Here is the caller graph for this function:

◆ makov_payne_correction()

MakovPayneResult elecstate::makov_payne_correction ( const UnitCell & ucell,
const Charge & charge,
const double * v_elecstat = nullptr,
bool print = true )

Calculate and print the Makov-Payne isolated-cell correction for cubic cells. All energies are in Ry; the optional corrected vacuum level is in eV.

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

◆ mix_occ_with_save()

void elecstate::mix_occ_with_save ( std::vector< std::vector< std::vector< ModuleBase::matrix > > > & occ_mat,
const std::vector< std::vector< std::vector< ModuleBase::matrix > > > & occ_mat_save,
const UnitCell & cell,
const std::vector< int > & l_channel,
const int nspin,
const double beta )

occ = beta * occ + (1-beta) * occ_save, applied to the correlated orbital of every atom. nspin-aware: nspin=4 mixes the single Pauli block, nspin=1/2 mixes both spin channels. Replaces the duplicated LCAO k/gamma mixing loops.

occ = beta * occ + (1-beta) * occ_save on every atom's correlated orbital. nspin-aware: nspin=4 mixes the single Pauli block, nspin=1/2 mixes both spin channels. Replaces the duplicated LCAO k/gamma mixing loops.

Here is the caller graph for this function:

◆ occ_from_proj()

void elecstate::occ_from_proj ( const std::complex< double > * proj,
const double * wg_ik,
const int nbands,
const int npol,
const int nkb,
const int nspin,
const int isk,
const int * nh_iat,
const int nat,
std::complex< double > * occ_block )

Accumulate per-projector 2x2 occupation blocks from the onsite projector coefficients for a single k-point.

For each projector (l,m) (global index iprj), the occupation block is

rho^{ss'}_{iprj} = sum_i w_{k,i} * conj(proj^s_{i,iprj}) * proj^{s'}_{i,iprj}

where proj^s_{i,iprj} = <alpha_{iprj}|Psi^s_{k,i}> and w_{k,i} is the band occupation weight. The block is stored as occ_block[iprj*4 + {0,1,2,3}] = {rho^{up,up}, rho^{up,dn}, rho^{dn,up}, rho^{dn,dn}}.

The 2x2 layout is a storage convention, not an assumption of spin physics; the content of the four slots depends on nspin: nspin=1: rho is split evenly into occ[0]/occ[3], off-diagonal slots stay zero. No Pauli structure is involved; the even split only makes the magnetization readout M ~ occ[0] - occ[3] vanish. nspin=2: isk=0 accumulates into occ[0], isk=1 into occ[3]; the two diagonal slots are simply two independent spin channels. nspin=4: both spinor components cross, filling all four slots with a genuine 2x2 Hermitian spin density matrix (the only case where the Pauli decomposition rho = (n*I + M.sigma)/2 applies).

Accumulation semantics (+=): the caller zeroes occ_block before the k-point loop and performs the MPI reduction after it.

Parameters
projonsite projector coefficients <alpha|psi>, laid out as (nbands*npol) x nkb with spinor components offset by nkb
wg_ikband occupation weights for this k-point (nbands values)
nbandsnumber of bands
npolnumber of spinor components (1 collinear, 2 non-collinear)
nkbtotal number of projectors
nspin1, 2 or 4
iskspin channel of this k-point (0/1); used only when nspin=2
nh_iatnumber of projectors per atom (nat values)
natnumber of atoms
occ_block[in,out] blocks to accumulate into, size sum(nh_iat)*4
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_0d_bilinear_energy()

double elecstate::pcc_0d_bilinear_energy ( const ChargeMoments & left,
const ChargeMoments & right,
const Pcc0dParameters & parameters )
Here is the caller graph for this function:

◆ pcc_0d_energy()

double elecstate::pcc_0d_energy ( const ChargeMoments & moments,
const Pcc0dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_0d_force()

ModuleBase::Vector3< double > elecstate::pcc_0d_force ( const ChargeMoments & moments,
const double ionic_charge,
const ModuleBase::Vector3< double > & position,
const Pcc0dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_0d_geometry()

void elecstate::pcc_0d_geometry ( const UnitCell & cell,
const std::vector< unitcell::AtomData > & atoms,
unitcell::OrthogonalCell & geometry,
Pcc0dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_0d_gradient()

ModuleBase::Vector3< double > elecstate::pcc_0d_gradient ( const ChargeMoments & moments,
const ModuleBase::Vector3< double > & position,
const Pcc0dParameters & parameters )
Here is the caller graph for this function:

◆ pcc_0d_operator()

void elecstate::pcc_0d_operator ( const UnitCell & cell,
const ModulePW::PW_Basis & basis,
const std::vector< unitcell::AtomData > & atoms,
const std::vector< ModuleBase::Vector3< double > > & grid_positions,
std::unique_ptr< ModuleSccs::CoulombOperator > & coulomb )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_0d_potential()

double elecstate::pcc_0d_potential ( const ChargeMoments & moments,
const ModuleBase::Vector3< double > & position,
const Pcc0dParameters & parameters )

Numerical kernels require validated parameters and moments about a common origin. Coordinates are relative to that origin. Energies/potentials are in Hartree; gradients/forces are in Hartree/Bohr. The potential is for unit positive charge; electron potential conversion belongs to the host adapter.

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

◆ pcc_0d_relative()

void elecstate::pcc_0d_relative ( const unitcell::OrthogonalCell & geometry,
std::vector< ModuleBase::Vector3< double > > & positions )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_2d_energy()

double elecstate::pcc_2d_energy ( const ChargeMoments & moments,
const Pcc2dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_2d_force()

ModuleBase::Vector3< double > elecstate::pcc_2d_force ( const ChargeMoments & moments,
const double ionic_charge,
const double coordinate,
const ModuleBase::Vector3< double > & normal,
const Pcc2dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_2d_geometry()

void elecstate::pcc_2d_geometry ( const UnitCell & cell,
const std::vector< unitcell::AtomData > & atoms,
int open_axis,
unitcell::SlabCell & geometry,
Pcc2dParameters & parameters )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_2d_gradient()

ModuleBase::Vector3< double > elecstate::pcc_2d_gradient ( const ChargeMoments & moments,
const double coordinate,
const ModuleBase::Vector3< double > & normal,
const Pcc2dParameters & parameters )
Here is the caller graph for this function:

◆ pcc_2d_operator()

void elecstate::pcc_2d_operator ( const UnitCell & cell,
const ModulePW::PW_Basis & basis,
const std::vector< unitcell::AtomData > & atoms,
int open_axis,
const std::vector< ModuleBase::Vector3< double > > & grid_positions,
std::unique_ptr< ModuleSccs::CoulombOperator > & coulomb )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcc_2d_potential()

double elecstate::pcc_2d_potential ( const ChargeMoments & moments,
double coordinate,
const ModuleBase::Vector3< double > & normal,
const Pcc2dParameters & parameters )

Hartree kernels. Parameters must be validated; moments use normal-projected positions r = normal * u, so second_moment is the normal second moment. The open planar kernel is zero on the source plane; its periodic counterpart has zero mean. This gauge fixes the charged-slab constant to -pi*L/(3*A); see M. J. Rutter, Electron. Struct. 3, 015002 (2021).

Here is the caller graph for this function:

◆ pcc_2d_project()

void elecstate::pcc_2d_project ( const unitcell::SlabCell & geometry,
std::vector< ModuleBase::Vector3< double > > & positions )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_etot()

void elecstate::print_etot ( const Magnetism & magnet,
const ElecState & elec,
const bool converged,
const int & iter_in,
const int iter_limit,
const double & scf_thr,
const double & scf_thr_kin,
const double & duration,
const Input_para & inp,
const bool two_fermi,
const double & pw_diag_thr,
const double & avg_iter,
const bool print,
const double & ds_rms )

print total free energy and other energies

Parameters
ucellunit cell
convergedif converged
iter_initer
scf_thrthreshold for scf
durationtime of each iteration
pw_diag_thrthreshold for diagonalization
avg_iteraveraged diagonalization iteration of each scf iteration
printif print to screen
inpthe INPUT parameters whose flags decide which energy terms and headers are printed
two_fermiwhether the run keeps two Fermi levels; derived, so it does not live in Input_para
iter_limitmaximum iterations for this SCF attempt, including propagation

Kohn-Sham functional energy

Kohn-Sham energy with sigma->0

Harris functional energy

band energy

one-electron energy

Hartree energy

exchange-correlation energy

Ewald energy

entropy energy

correction energy for scf

local potential energy

vdw energy

hybrid functional energy

solvation energy

electric field energy

gate energy

deepks energy

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

◆ print_format()

void elecstate::print_format ( const std::string & name,
const double & value )

function to print name, value and value*Ry_to_eV

Parameters
namename
valuevalue
Here is the caller graph for this function:

◆ print_scf_iterinfo()

void elecstate::print_scf_iterinfo ( const std::string & ks_solver,
const int & istep,
const int & witer,
const std::vector< double > & mag,
const int & wmag,
const double & etot,
const double & ediff,
const int & wener,
const std::vector< double > & drho,
const int & wrho,
const double & time,
const int & wtime,
const double & ds_rms )

Notes on refactor of ESolver's functions

the print of SCF iteration on-the-fly information.

  1. Previously it is expected for nspin 1, 2, and 4, also with xc_type 3/5 or not, the information will organized in different ways. This brings inconsistencies between patterns of print and make it hard to vectorize information.
  2. the function print_etot actually do two kinds of things, 1) print information into running_*.log, 2) print information onto screen. These two tasks are, in no way should be placed/implemented in one function directly
  3. there are information redundance: the istep of SCF can provide information determing whether print out the SCF iteration info. table header or not, rather than dividing into two functions and hard code the format.

For nspin 1, print: ITER, ETOT, EDIFF, DRHO, TIME nspin 2, print: ITER, TMAG, AMAG, ETOT, EDIFF, DRHO, TIME nspin 4 with nlcc, print: ITER, TMAGX, TMAGY, TMAGZ, AMAG, ETOT, EDIFF, DRHO, TIME xc type_id 3/5: DKIN

Based on summary above, there are several groups of info:

  1. counting: ITER
  2. (optional) magnetization: TMAG or TMAGX-TMAGY-TMAGZ, AMAG
  3. energies: ETOT, EDIFF
  4. densities: DRHO, DKIN(optional)
  5. time: TIME
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_orb_file()

bool elecstate::read_orb_file ( int it,
std::string & orbital_file,
std::ofstream & ofs_running,
Atom * atom )

◆ restore_dm() [1/2]

std::vector< std::vector< double > > elecstate::restore_dm ( const K_Vectors & kv,
const std::vector< std::vector< double > > & dm_k_ibz,
const ModuleSymmetry::Symmetry_rotation & symrot,
const Parallel_Blkcyclic & pv )

do nothing if gamma_only

◆ restore_dm() [2/2]

std::vector< std::vector< std::complex< double > > > elecstate::restore_dm ( const K_Vectors & kv,
const std::vector< std::vector< std::complex< double > > > & dm_k_ibz,
const ModuleSymmetry::Symmetry_rotation & symrot,
const Parallel_Blkcyclic & pv )

for symmetry, multi-k, nspin<4: restore DM(k) form DM(k_ibz)

◆ sccs_cfg_input()

void elecstate::sccs_cfg_input ( const Input_para & input,
ModuleSccs::SccsConfig & config,
ModuleSccs::PolarizationSolverParameters & solver )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_estate_pw()

void elecstate::setup_estate_pw ( UnitCell & ucell,
K_Vectors & kv,
Structure_Factor & sf,
elecstate::ElecState *& pelec,
Charge & chr,
pseudopot_cell_vl & locpp,
pseudopot_cell_vnl & ppcell,
VSep *& vsep_cell,
ModulePW::PW_Basis_K * pw_wfc,
ModulePW::PW_Basis * pw_rho,
ModulePW::PW_Basis * pw_rhod,
ModulePW::PW_Basis_Big * pw_big,
surchem & solvent,
const Input_para & inp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_estate_pw_impl()

template<typename T, typename Device>
void elecstate::setup_estate_pw_impl ( UnitCell & ucell,
K_Vectors & kv,
Structure_Factor & sf,
elecstate::ElecState *& pelec,
Charge & chr,
pseudopot_cell_vl & locpp,
pseudopot_cell_vnl & ppcell,
VSep *& vsep_cell,
ModulePW::PW_Basis_K * pw_wfc,
ModulePW::PW_Basis * pw_rho,
ModulePW::PW_Basis * pw_rhod,
ModulePW::PW_Basis_Big * pw_big,
surchem & solvent,
const Input_para & inp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ teardown_estate_pw()

void elecstate::teardown_estate_pw ( elecstate::ElecState *& pelec,
VSep *& vsep_cell )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ teardown_estate_pw_impl()

template<typename T, typename Device>
void elecstate::teardown_estate_pw_impl ( elecstate::ElecState *& pelec,
VSep *& vsep_cell )
Here is the call graph for this function:

◆ update_pot()

void elecstate::update_pot ( UnitCell & ucell,
elecstate::ElecState *& pelec,
const Charge & chr,
const bool conv_esolver )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uspp_becsum_size()

int elecstate::uspp_becsum_size ( const UnitCell & ucell,
const pseudopot_cell_vnl & ppcell,
const int nspin )

Size of the canonical [spin][atom][packed projector pair] storage.

Here is the caller graph for this function:

◆ write_sccs_out()

void elecstate::write_sccs_out ( std::ostream & output,
const SccsOutput & result,
int level,
double solvation_energy,
bool pcc,
double pcc_energy )
Here is the caller graph for this function:

◆ write_sccs_wait()

void elecstate::write_sccs_wait ( std::ostream & output,
double residual,
double start_drho,
int start_nmax )
Here is the caller graph for this function:

Variable Documentation

◆ ElecStateLCAO< TK >::need_psi_grid

template<typename TK>
bool elecstate::ElecStateLCAO< TK >::need_psi_grid = true

◆ ElecStateLCAO< TK >::out_wfc_lcao

template<typename TK>
int elecstate::ElecStateLCAO< TK >::out_wfc_lcao = 0

◆ tmp_gridecut

double elecstate::tmp_gridecut = 80.0

◆ tmp_ucell_omega

double elecstate::tmp_ucell_omega = 500.0