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

Self-consistent vacuum point-counter-charge (PCC) correction. More...

#include <pot_pcc.h>

Inheritance diagram for elecstate::PotPcc:
Collaboration diagram for elecstate::PotPcc:

Public Types

enum class  Dimension { molecule , slab }

Public Member Functions

 PotPcc (const ModulePW::PW_Basis *basis, double electron_count)
 PotPcc (const ModulePW::PW_Basis *basis, Dimension dimension, int open_axis, double electron_count)
void cal_v_eff (const Charge *charge, const UnitCell *cell, ModuleBase::matrix &potential) override
double get_energy () const override
const std::vector< double > & electron_potential () const
void add_force (const UnitCell &cell, ModuleBase::matrix &force) const
Public Member Functions inherited from elecstate::PotBase
 PotBase ()
virtual ~PotBase ()
virtual void cal_fixed_v (double *vl_pseudo)
virtual void sol_energy (double &electrostatic, double &non_electrostatic) const
virtual void add_sol_force (const UnitCell &, ModuleBase::matrix &) const
virtual const std::vector< double > * sol_elec_pot () const
virtual void add_sol_fields (std::vector< SolventGridField > &) const

Static Public Member Functions

static void validate_kpoints (const std::vector< ModuleBase::Vector3< double > > &points, int count, int open_axis)

Private Member Functions

void prepare_ions (const UnitCell &cell, ChargeMoments &ionic_moments)
ChargeMoments collect_electrons (const Charge &charge, const UnitCell &cell, std::vector< ModuleBase::Vector3< double > > &positions) const
ModuleBase::Vector3< double > relative_position (const ModuleBase::Vector3< double > &position) const
double correction_energy () const
double correction_potential (const ModuleBase::Vector3< double > &position) const
ModuleBase::Vector3< double > correction_force (double charge, const ModuleBase::Vector3< double > &position) const

Private Attributes

const Dimension dimension_
const int open_axis_
const double electron_count_
unitcell::SlabCell slab_
Pcc2dParameters slab_parameters_
unitcell::OrthogonalCell geometry_
Pcc0dParameters parameters_
ChargeMoments moments_
std::vector< ModuleBase::Vector3< double > > ionic_positions_
std::vector< double > ionic_charges_
std::vector< double > electron_potential_
double energy_rydberg_ = 0.0

Additional Inherited Members

Public Attributes inherited from elecstate::PotBase
bool fixed_mode = 0
bool dynamic_mode = 0
Protected Attributes inherited from elecstate::PotBase
const ModulePW::PW_Basis * rho_basis_ = nullptr
const ModulePW::PW_Basis * rho_basis_smooth_ = nullptr

Detailed Description

Self-consistent vacuum point-counter-charge (PCC) correction.

Owns the result of its last density update. The correction removes the spurious interaction of the total charge with its periodic images by expanding that charge to second order in its multipoles about the mass-weighted ionic center (charge q, dipole d, second moment Q). The charge seen here is ionic + electronic only; any solvent polarization charge must be corrected by its own component. In Hartree atomic units, for a unit positive test charge at r (or at the normal coordinate z for slabs):

0D (cubic cell of edge L, volume V = L^3, Madelung constant alpha of the simple cubic lattice): v(r) = alpha q / L - 2 pi / (3 V) * (q r^2 - 2 d.r + Q)

2D (periodic area A, normal period L): v(z) = -pi q L / (3 A) - 2 pi / (A L) * (q z^2 - 2 d_z z + Q_zz)

The correction energy is E = 1/2 * integral rho_total(r) v(r) dr and the forces follow from the gradient of v at the ionic positions. The kernels are implemented in pcc_0d.cpp and pcc_2d.cpp; see pcc_2d.h for the gauge of the charged-slab constant.

References:

  • O. Andreussi and N. Marzari, Phys. Rev. B 90, 245101 (2014) (parabolic 0D and 2D point-counter-charge corrections).
  • I. Dabo, B. Kozinsky, N. E. Singh-Miller and N. Marzari, Phys. Rev. B 77, 115139 (2008) (density-countercharge corrections).
  • M. J. Rutter, Electron. Struct. 3, 015002 (2021) (charged slabs: the zero-mean periodic potential of a charged plane fixes the 2D constant).

The implementation follows the PCC corrections of the ENVIRON library (www.quantum-environ.org).

Member Enumeration Documentation

◆ Dimension

enum class elecstate::PotPcc::Dimension
strong
Enumerator
molecule 
slab 

Constructor & Destructor Documentation

◆ PotPcc() [1/2]

elecstate::PotPcc::PotPcc ( const ModulePW::PW_Basis * basis,
double electron_count )

electron_count is the expected number of electrons (INPUT nelec); a grid charge that differs from it by more than 1e-6 e is reported in the warning log, and the correction uses the grid charge.

◆ PotPcc() [2/2]

elecstate::PotPcc::PotPcc ( const ModulePW::PW_Basis * basis,
Dimension dimension,
int open_axis,
double electron_count )

Member Function Documentation

◆ add_force()

void elecstate::PotPcc::add_force ( const UnitCell & cell,
ModuleBase::matrix & force ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_v_eff()

void elecstate::PotPcc::cal_v_eff ( const Charge * charge,
const UnitCell * cell,
ModuleBase::matrix & potential )
overridevirtual

Reimplemented from elecstate::PotBase.

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

◆ collect_electrons()

ChargeMoments elecstate::PotPcc::collect_electrons ( const Charge & charge,
const UnitCell & cell,
std::vector< ModuleBase::Vector3< double > > & positions ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correction_energy()

double elecstate::PotPcc::correction_energy ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correction_force()

ModuleBase::Vector3< double > elecstate::PotPcc::correction_force ( double charge,
const ModuleBase::Vector3< double > & position ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correction_potential()

double elecstate::PotPcc::correction_potential ( const ModuleBase::Vector3< double > & position) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ electron_potential()

const std::vector< double > & elecstate::PotPcc::electron_potential ( ) const
Here is the caller graph for this function:

◆ get_energy()

double elecstate::PotPcc::get_energy ( ) const
overridevirtual

Reimplemented from elecstate::PotBase.

Here is the caller graph for this function:

◆ prepare_ions()

void elecstate::PotPcc::prepare_ions ( const UnitCell & cell,
ChargeMoments & ionic_moments )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relative_position()

ModuleBase::Vector3< double > elecstate::PotPcc::relative_position ( const ModuleBase::Vector3< double > & position) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_kpoints()

void elecstate::PotPcc::validate_kpoints ( const std::vector< ModuleBase::Vector3< double > > & points,
int count,
int open_axis )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ dimension_

const Dimension elecstate::PotPcc::dimension_
private

◆ electron_count_

const double elecstate::PotPcc::electron_count_
private

◆ electron_potential_

std::vector<double> elecstate::PotPcc::electron_potential_
private

◆ energy_rydberg_

double elecstate::PotPcc::energy_rydberg_ = 0.0
private

◆ geometry_

unitcell::OrthogonalCell elecstate::PotPcc::geometry_
private

◆ ionic_charges_

std::vector<double> elecstate::PotPcc::ionic_charges_
private

◆ ionic_positions_

std::vector<ModuleBase::Vector3<double> > elecstate::PotPcc::ionic_positions_
private

◆ moments_

ChargeMoments elecstate::PotPcc::moments_
private

◆ open_axis_

const int elecstate::PotPcc::open_axis_
private

◆ parameters_

Pcc0dParameters elecstate::PotPcc::parameters_
private

◆ slab_

unitcell::SlabCell elecstate::PotPcc::slab_
private

◆ slab_parameters_

Pcc2dParameters elecstate::PotPcc::slab_parameters_
private

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