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

Pseudopot_upf class for reading pseudopotential files. More...

#include <read_pp.h>

Collaboration diagram for Pseudopot_upf:

Public Member Functions

 Pseudopot_upf ()
 Default constructor.
 ~Pseudopot_upf ()
 Destructor.
int init_pseudo_reader (const std::string &fn, std::string &type, Atom_pseudo &pp)
 Initialize pseudopotential reader.
void print_pseudo_upf (std::ofstream &ofs, Atom_pseudo &pp)
 Print pseudopotential information.
int average_p (const double &lambda, Atom_pseudo &pp, const bool lspinorb)
 Average pseudopotential.
void set_empty_element (Atom_pseudo &pp)
 Set empty element for BSSE.
void set_upf_q (Atom_pseudo &pp)
 Set UPF Q function.
void complete_default (Atom_pseudo &pp, const double pseudo_rcut)
 Complete default values.

Public Attributes

std::string relativistic
 relativistic: no, scalar, full
int lmax_rho
 maximum angular momentum component in rho (should be 2*lmax)
double xmin
 the minimum x of the linear mesh
double rmax
 the maximum radius of the mesh
double zmesh
 the nuclear charge used for mesh
double dx
int lloc
bool q_with_l
 if .true. qfunc is pseudized in
int nqf
 number of Q coefficients
bool coulomb_potential = false
 Dynamic arrays.
ModuleBase::matrix chi
 chi(nwfc,mesh) atomic wavefcts
std::vector< int > kbeta = {}
 kbeta(nbeta):number of mesh points for projector i (must be .le. mesh )
std::vector< std::string > els_beta = {}
 els_beta(nwfc):label for the beta
std::vector< int > nchi = {}
 nchi(nwfc) value of pseudo-n for wavefcts
std::vector< double > epseu = {}
 epseu(nwfc) pseudo one-particle energy
std::vector< double > rcut_chi = {}
 rcut_chi(nwfc) cutoff inner radius
std::vector< double > rcutus_chi = {}
 rcutus_chi(nwfc) ultrasoft outer radius
std::vector< double > rinner = {}
 rinner(2*lmax+1) r_L
ModuleBase::matrix qfunc
 qfunc(nbeta*(nbeta+1)/2,mesh) Q_{mu,nu}(|r|) function for |r|> r_L
ModuleBase::realArray qfcoef
 qfcoef(nbeta,nbeta,2*lmax+1,nqf) coefficients for Q for |r|<r_L
std::vector< double > rcut = {}
 cut-off radius(nbeta)
std::vector< double > rcutus = {}
 ultrasoft cut-off radius (nbeta)
int nd
 nl_5 // Number of nonzero Dij
int spd_loc
 VWR format.
int iTB_s
 TB s orbital index.
int iTB_p
 TB p orbital index.
int iTB_d
 TB d orbital index.

Private Member Functions

void skip_number (std::ifstream &ifs, bool mesh_changed)
 Skip the last number if the mesh is even.
int read_pseudo_upf (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF format pseudopotential.
int read_pseudo_vwr (std::ifstream &ifs, Atom_pseudo &pp)
 Read VWR format pseudopotential.
int read_pseudo_blps (std::ifstream &ifs, Atom_pseudo &pp)
 Read BLPS format pseudopotential.
void read_pseudo_header (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential header.
void read_pseudo_mesh (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential mesh.
void read_pseudo_nlcc (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential NLCC.
void read_pseudo_local (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential local potential.
void read_pseudo_nl (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential non-local potential.
void read_pseudo_pswfc (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential pseudo wavefunctions.
void read_pseudo_rhoatom (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential atomic charge density.
void read_pseudo_addinfo (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential additional info.
void read_pseudo_so (std::ifstream &ifs, Atom_pseudo &pp)
 Read pseudopotential spin-orbit coupling.
int read_pseudo_upf201 (std::ifstream &ifs, Atom_pseudo &pp)
 UPF201 format.
void read_pseudo_upf201_header (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF201 header.
void read_pseudo_upf201_mesh (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF201 mesh.
void read_pseudo_upf201_nonlocal (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF201 non-local potential.
void read_pseudo_upf201_pswfc (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF201 pseudo wavefunctions.
void read_pseudo_upf201_so (std::ifstream &ifs, Atom_pseudo &pp)
 Read UPF201 spin-orbit coupling.
void getnameval (std::ifstream &, int &, std::string *, std::string *)
 Get name-value pair from input stream.
void complete_default_atom (Atom_pseudo &pp, const double pseudo_rcut)
void complete_default_vl (Atom_pseudo &pp)

Private Attributes

bool mesh_changed = false
 if the mesh is even, it will be changed to odd

Friends

class AtomPseudoTest
 the unit tests drive the private format readers and the complete_default_* helpers directly; see source_cell/test/
class AtomSpecTest
class NCPPTest
class ReadPPTest

Detailed Description

Pseudopot_upf class for reading pseudopotential files.

This class handles reading various pseudopotential formats (UPF, VWR, BLPS). It supports UPF format versions including UPF201.

Constructor & Destructor Documentation

◆ Pseudopot_upf()

Pseudopot_upf::Pseudopot_upf ( )

Default constructor.

PP_INFO PP_HEADER PP_MESH PP_NLCC PP_LOCAL PP_NONLOCAL PP_PSWFC PP_PSRHOATOM addinfo

◆ ~Pseudopot_upf()

Pseudopot_upf::~Pseudopot_upf ( )

Destructor.

Member Function Documentation

◆ average_p()

int Pseudopot_upf::average_p ( const double & lambda,
Atom_pseudo & pp,
const bool lspinorb )

Average pseudopotential.

Parameters
lambdaaveraging parameter
ppatom pseudopotential object
lspinorbwhether spin-orbit is enabled
Returns
error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ complete_default()

void Pseudopot_upf::complete_default ( Atom_pseudo & pp,
const double pseudo_rcut )

Complete default values.

Parameters
ppatom pseudopotential object
pseudo_rcutpseudo cut-off radius
Here is the call graph for this function:
Here is the caller graph for this function:

◆ complete_default_atom()

void Pseudopot_upf::complete_default_atom ( Atom_pseudo & pp,
const double pseudo_rcut )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ complete_default_vl()

void Pseudopot_upf::complete_default_vl ( Atom_pseudo & pp)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getnameval()

void Pseudopot_upf::getnameval ( std::ifstream & ifs,
int & n,
std::string * name,
std::string * val )
private

Get name-value pair from input stream.

Parameters
ifsinput file stream
ivalinteger value (output)
sval1string value 1 (output)
sval2string value 2 (output)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_pseudo_reader()

int Pseudopot_upf::init_pseudo_reader ( const std::string & fn,
std::string & type,
Atom_pseudo & pp )

Initialize pseudopotential reader.

Parameters
fnfilename
typepseudopotential type (output)
ppatom pseudopotential object (output)
Returns
error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_pseudo_upf()

void Pseudopot_upf::print_pseudo_upf ( std::ofstream & ofs,
Atom_pseudo & pp )

Print pseudopotential information.

Parameters
ofsoutput file stream
ppatom pseudopotential object
Here is the call graph for this function:

◆ read_pseudo_addinfo()

void Pseudopot_upf::read_pseudo_addinfo ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential additional info.

Parameters
ifsinput file stream
ppatom pseudopotential object

◆ read_pseudo_blps()

int Pseudopot_upf::read_pseudo_blps ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read BLPS format pseudopotential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Returns
error code
Note
sunliang added 2021.07.08
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_header()

void Pseudopot_upf::read_pseudo_header ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential header.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_local()

void Pseudopot_upf::read_pseudo_local ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential local potential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_mesh()

void Pseudopot_upf::read_pseudo_mesh ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential mesh.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_nl()

void Pseudopot_upf::read_pseudo_nl ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential non-local potential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_nlcc()

void Pseudopot_upf::read_pseudo_nlcc ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential NLCC.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_pswfc()

void Pseudopot_upf::read_pseudo_pswfc ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential pseudo wavefunctions.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_rhoatom()

void Pseudopot_upf::read_pseudo_rhoatom ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential atomic charge density.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_so()

void Pseudopot_upf::read_pseudo_so ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read pseudopotential spin-orbit coupling.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the caller graph for this function:

◆ read_pseudo_upf()

int Pseudopot_upf::read_pseudo_upf ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF format pseudopotential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Returns
error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201()

int Pseudopot_upf::read_pseudo_upf201 ( std::ifstream & ifs,
Atom_pseudo & pp )
private

UPF201 format.

Read UPF201 format pseudopotential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Returns
error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201_header()

void Pseudopot_upf::read_pseudo_upf201_header ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF201 header.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201_mesh()

void Pseudopot_upf::read_pseudo_upf201_mesh ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF201 mesh.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201_nonlocal()

void Pseudopot_upf::read_pseudo_upf201_nonlocal ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF201 non-local potential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201_pswfc()

void Pseudopot_upf::read_pseudo_upf201_pswfc ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF201 pseudo wavefunctions.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_upf201_so()

void Pseudopot_upf::read_pseudo_upf201_so ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read UPF201 spin-orbit coupling.

Parameters
ifsinput file stream
ppatom pseudopotential object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pseudo_vwr()

int Pseudopot_upf::read_pseudo_vwr ( std::ifstream & ifs,
Atom_pseudo & pp )
private

Read VWR format pseudopotential.

Parameters
ifsinput file stream
ppatom pseudopotential object
Returns
error code

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

◆ set_empty_element()

void Pseudopot_upf::set_empty_element ( Atom_pseudo & pp)

Set empty element for BSSE.

Parameters
ppatom pseudopotential object
Note
Peize Lin add for bsse 2022.04.07
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_upf_q()

void Pseudopot_upf::set_upf_q ( Atom_pseudo & pp)

Set UPF Q function.

Parameters
ppatom pseudopotential object
Note
liuyu add 2023-09-21

For USPP we set the augmentation charge as an l-dependent array in all cases. This is already the case when upfq_with_l is .true. For vanderbilt US pseudos, where nqf and rinner are non zero, we do here what otherwise would be done multiple times in many parts of the code (such as in init_us_1, addusforce_r, bp_calc_btq, compute_qdipol) whenever the q_l(r) were to be constructed. For simple rrkj3 pseudos we duplicate the information contained in q(r) for all q_l(r).

This requires a little extra memory but unifies the treatment of q_l(r) and allows further weaking with the augmentation charge.

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

◆ skip_number()

void Pseudopot_upf::skip_number ( std::ifstream & ifs,
bool mesh_changed )
private

Skip the last number if the mesh is even.

Parameters
ifsinput file stream
mesh_changedwhether mesh was changed
Here is the caller graph for this function:

◆ AtomPseudoTest

friend class AtomPseudoTest
friend

the unit tests drive the private format readers and the complete_default_* helpers directly; see source_cell/test/

◆ AtomSpecTest

friend class AtomSpecTest
friend

◆ NCPPTest

friend class NCPPTest
friend

◆ ReadPPTest

friend class ReadPPTest
friend

Member Data Documentation

◆ chi

ModuleBase::matrix Pseudopot_upf::chi

chi(nwfc,mesh) atomic wavefcts

◆ coulomb_potential

bool Pseudopot_upf::coulomb_potential = false

Dynamic arrays.

coulomb potential : z/r

◆ dx

double Pseudopot_upf::dx

the deltax of the linear mesh The radial grid is: r(i+1) = exp(xmin+i*dx)/zed a.u.

◆ els_beta

std::vector<std::string> Pseudopot_upf::els_beta = {}

els_beta(nwfc):label for the beta

◆ epseu

std::vector<double> Pseudopot_upf::epseu = {}

epseu(nwfc) pseudo one-particle energy

◆ iTB_d

int Pseudopot_upf::iTB_d

TB d orbital index.

◆ iTB_p

int Pseudopot_upf::iTB_p

TB p orbital index.

◆ iTB_s

int Pseudopot_upf::iTB_s

TB s orbital index.

◆ kbeta

std::vector<int> Pseudopot_upf::kbeta = {}

kbeta(nbeta):number of mesh points for projector i (must be .le. mesh )

◆ lloc

int Pseudopot_upf::lloc

L of channel used to generate local potential (if < 0 it was generated by smoothing AE potential)

◆ lmax_rho

int Pseudopot_upf::lmax_rho

maximum angular momentum component in rho (should be 2*lmax)

◆ mesh_changed

bool Pseudopot_upf::mesh_changed = false
private

if the mesh is even, it will be changed to odd

◆ nchi

std::vector<int> Pseudopot_upf::nchi = {}

nchi(nwfc) value of pseudo-n for wavefcts

◆ nd

int Pseudopot_upf::nd

nl_5 // Number of nonzero Dij

◆ nqf

int Pseudopot_upf::nqf

number of Q coefficients

◆ q_with_l

bool Pseudopot_upf::q_with_l

if .true. qfunc is pseudized in

◆ qfcoef

ModuleBase::realArray Pseudopot_upf::qfcoef

qfcoef(nbeta,nbeta,2*lmax+1,nqf) coefficients for Q for |r|<r_L

◆ qfunc

ModuleBase::matrix Pseudopot_upf::qfunc

qfunc(nbeta*(nbeta+1)/2,mesh) Q_{mu,nu}(|r|) function for |r|> r_L

◆ rcut

std::vector<double> Pseudopot_upf::rcut = {}

cut-off radius(nbeta)

◆ rcut_chi

std::vector<double> Pseudopot_upf::rcut_chi = {}

rcut_chi(nwfc) cutoff inner radius

◆ rcutus

std::vector<double> Pseudopot_upf::rcutus = {}

ultrasoft cut-off radius (nbeta)

◆ rcutus_chi

std::vector<double> Pseudopot_upf::rcutus_chi = {}

rcutus_chi(nwfc) ultrasoft outer radius

◆ relativistic

std::string Pseudopot_upf::relativistic

relativistic: no, scalar, full

◆ rinner

std::vector<double> Pseudopot_upf::rinner = {}

rinner(2*lmax+1) r_L

◆ rmax

double Pseudopot_upf::rmax

the maximum radius of the mesh

◆ spd_loc

int Pseudopot_upf::spd_loc

VWR format.

s,p,d local component

◆ xmin

double Pseudopot_upf::xmin

the minimum x of the linear mesh

◆ zmesh

double Pseudopot_upf::zmesh

the nuclear charge used for mesh


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