ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleCell::ReciprocalGrid Class Referenceabstract

Abstract base class shared by K_Vectors (electrons) and QList (phonons). More...

#include <reciprocal_grid.h>

Inheritance diagram for ModuleCell::ReciprocalGrid:
Collaboration diagram for ModuleCell::ReciprocalGrid:

Public Member Functions

 ReciprocalGrid ()=default
virtual ~ReciprocalGrid ()=default
ReciprocalGrid & operator= (const ReciprocalGrid &)=default
ReciprocalGrid & operator= (ReciprocalGrid &&)=default
virtual void renew (const int &kpoint_number)
 Resize the point-related containers.
double Monkhorst_Pack_formula (const int &k_type, const double &offset, const int &n, const int &dim)
 Coordinate of a point generated by the Monkhorst-Pack scheme.
void Monkhorst_Pack (const int *nmp_in, const double *koffset_in, const int k_type)
 Generate a Monkhorst-Pack mesh.
void kvec_d2c (const ModuleBase::Matrix3 &reciprocal_vec)
 Convert direct to Cartesian coordinates.
void kvec_c2d (const ModuleBase::Matrix3 &latvec)
 Convert Cartesian to direct coordinates.
void set_both_kvec (const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &R, std::string &skpt, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 Set both the direct and Cartesian coordinates, and print the table.
void normalize_wk (const int &degspin)
 Normalize the weights so that they sum to the spin degeneracy.
void print_klists (std::ofstream &ofs) const
 Print the points in both Cartesian and direct coordinates.
void reduce_ibz (const ModuleBase::Matrix3 *rot_ops, int nrotkm, const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &k_lattice, const ModuleBase::Matrix3 *kkmatrix, double epsilon, std::vector< ModuleBase::Vector3< double > > &vec_ibz, std::vector< double > &wk_ibz, std::vector< int > &ibz_index, std::vector< int > &ibz2bz)
 Star (IBZ) reduction primitive shared by k-points and q-points.
virtual void reduce_by_symmetry (const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, bool use_symm, std::string &skpt, bool &match, const int my_rank, std::ofstream &ofs_running)=0
 Reduce this grid according to symmetry operations.

Public Attributes

std::vector< ModuleBase::Vector3< double > > kvec_c
 Cartesian coordinates of the points, in unit of 2*pi/lat0.
std::vector< ModuleBase::Vector3< double > > kvec_d
 Direct coordinates of the points.
std::vector< ModuleBase::Vector3< double > > kvec_c_full
 Cartesian coordinates of the full (unreduced) mesh, in unit of 2*pi/lat0.
std::vector< double > wk
 Weight of each point.
std::vector< int > ngk
 Number of plane waves for each point (filled by the PW basis).
int nmp [3] = {0, 0, 0}
 Monkhorst-Pack grid dimensions.
std::vector< int > kl_segids
 Index of the k-line segment each point belongs to.
bool kc_done = false
 Whether the Cartesian coordinates have been computed.
bool kd_done = false
 Whether the direct coordinates have been computed.
int nks = 0
 Number of points in the current pool (spin-free view).
int nkstot = 0
int nkstot_nospin = 0
bool is_mp = false
 Whether this is a Monkhorst-Pack grid.
int k_nkstot = 0
 Total number of points read from a point-list file (0 = auto mesh).
std::string k_kword
 Type keyword of the point-list file.

Protected Member Functions

virtual int spin_factor () const
 Spin-like multiplicity used by renew() (1 for q-points).
bool build_star_ops (const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, bool use_symm, ModuleBase::Matrix3 &k_vec, std::vector< ModuleBase::Matrix3 > &kgmatrix, int &nrotkm) const
 Build the reciprocal-space point-group operations for star reduction.

Detailed Description

Abstract base class shared by K_Vectors (electrons) and QList (phonons).

This base class is deliberately spin-free and irrep-free:

  • spin expansion (isk, nspin doubling) is implemented in K_Vectors;
  • irreducible-representation analysis is implemented in QList.

Constructor & Destructor Documentation

◆ ReciprocalGrid()

ModuleCell::ReciprocalGrid::ReciprocalGrid ( )
default
Here is the caller graph for this function:

◆ ~ReciprocalGrid()

virtual ModuleCell::ReciprocalGrid::~ReciprocalGrid ( )
virtualdefault

Member Function Documentation

◆ build_star_ops()

bool ModuleCell::ReciprocalGrid::build_star_ops ( const UnitCell & ucell,
const ModuleSymmetry::Symmetry & symm,
bool use_symm,
ModuleBase::Matrix3 & k_vec,
std::vector< ModuleBase::Matrix3 > & kgmatrix,
int & nrotkm ) const
protected

Build the reciprocal-space point-group operations for star reduction.

Determines the Bravais lattice of the reciprocal lattice (and of the k-lattice for Monkhorst-Pack meshes), checks its compatibility with the real-space lattice, constructs the point-group operations, and verifies that every Symmetry::kgmatrix entry belongs to that group.

Parameters
ucellunit cell
symmsymmetry of the system
use_symmwhether symmetry reduction is enabled
k_vecoutput: k-lattice basis matrix (valid when is_mp)
kgmatrixoutput: rotation operations (capacity at least 96)
nrotkmoutput: number of operations written into kgmatrix (0 means no reduction is possible)
Returns
false if the reciprocal lattice is incompatible with the real-space lattice (the caller should then set match to false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvec_c2d()

void ModuleCell::ReciprocalGrid::kvec_c2d ( const ModuleBase::Matrix3 & latvec)

Convert Cartesian to direct coordinates.

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

◆ kvec_d2c()

void ModuleCell::ReciprocalGrid::kvec_d2c ( const ModuleBase::Matrix3 & reciprocal_vec)

Convert direct to Cartesian coordinates.

Here is the caller graph for this function:

◆ Monkhorst_Pack()

void ModuleCell::ReciprocalGrid::Monkhorst_Pack ( const int * nmp_in,
const double * koffset_in,
const int k_type )

Generate a Monkhorst-Pack mesh.

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

◆ Monkhorst_Pack_formula()

double ModuleCell::ReciprocalGrid::Monkhorst_Pack_formula ( const int & k_type,
const double & offset,
const int & n,
const int & dim )

Coordinate of a point generated by the Monkhorst-Pack scheme.

Here is the caller graph for this function:

◆ normalize_wk()

void ModuleCell::ReciprocalGrid::normalize_wk ( const int & degspin)

Normalize the weights so that they sum to the spin degeneracy.

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

◆ operator=() [1/2]

ReciprocalGrid & ModuleCell::ReciprocalGrid::operator= ( const ReciprocalGrid & )
default
Here is the call graph for this function:

◆ operator=() [2/2]

ReciprocalGrid & ModuleCell::ReciprocalGrid::operator= ( ReciprocalGrid && )
default
Here is the call graph for this function:

◆ print_klists()

void ModuleCell::ReciprocalGrid::print_klists ( std::ofstream & ofs) const

Print the points in both Cartesian and direct coordinates.

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

◆ reduce_by_symmetry()

virtual void ModuleCell::ReciprocalGrid::reduce_by_symmetry ( const UnitCell & ucell,
const ModuleSymmetry::Symmetry & symm,
bool use_symm,
std::string & skpt,
bool & match,
const int my_rank,
std::ofstream & ofs_running )
pure virtual

Reduce this grid according to symmetry operations.

Pure virtual: implemented by K_Vectors (electron IBZ, including the magnetic/time-reversal handling) and by QList (q-point star reduction plus irreducible-representation analysis).

Implemented in K_Vectors, ModuleCell::QList, and TestGrid.

◆ reduce_ibz()

void ModuleCell::ReciprocalGrid::reduce_ibz ( const ModuleBase::Matrix3 * rot_ops,
int nrotkm,
const ModuleBase::Matrix3 & G,
const ModuleBase::Matrix3 & k_lattice,
const ModuleBase::Matrix3 * kkmatrix,
double epsilon,
std::vector< ModuleBase::Vector3< double > > & vec_ibz,
std::vector< double > & wk_ibz,
std::vector< int > & ibz_index,
std::vector< int > & ibz2bz )

Star (IBZ) reduction primitive shared by k-points and q-points.

Rotates every point by each operation in rot_ops, folds equivalent points together and accumulates their weights. The rotation matrices in the k-lattice (Monkhorst-Pack) frame are provided in kkmatrix when is_mp is true; the k-lattice basis is k_lattice.

Parameters
rot_opsrotation matrices in the reciprocal-space frame
nrotkmnumber of rotation operations
Greciprocal lattice matrix
k_latticek-lattice basis matrix (valid when is_mp)
kkmatrixrotation matrices in the k-lattice frame (valid when is_mp)
epsilonsymmetry tolerance used by restrict/equivalence checks
vec_ibzoutput: irreducible points
wk_ibzoutput: weight of each irreducible point
ibz_indexoutput: mapping point index -> irreducible index
ibz2bzoutput: origin (full-mesh) index of each irreducible point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renew()

void ModuleCell::ReciprocalGrid::renew ( const int & kpoint_number)
virtual

Resize the point-related containers.

Parameters
kpoint_numbernew number of points

Reimplemented in K_Vectors.

Here is the caller graph for this function:

◆ set_both_kvec()

void ModuleCell::ReciprocalGrid::set_both_kvec ( const ModuleBase::Matrix3 & G,
const ModuleBase::Matrix3 & R,
std::string & skpt,
std::ofstream & ofs_running,
std::ofstream & ofs_warning )

Set both the direct and Cartesian coordinates, and print the table.

Parameters
Greciprocal lattice matrix
Rreal space lattice matrix
skptoutput string holding the point table
ofs_runningrunning-log stream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spin_factor()

virtual int ModuleCell::ReciprocalGrid::spin_factor ( ) const
inlineprotectedvirtual

Spin-like multiplicity used by renew() (1 for q-points).

Reimplemented in K_Vectors.

Member Data Documentation

◆ is_mp

bool ModuleCell::ReciprocalGrid::is_mp = false

Whether this is a Monkhorst-Pack grid.

◆ k_kword

std::string ModuleCell::ReciprocalGrid::k_kword

Type keyword of the point-list file.

◆ k_nkstot

int ModuleCell::ReciprocalGrid::k_nkstot = 0

Total number of points read from a point-list file (0 = auto mesh).

◆ kc_done

bool ModuleCell::ReciprocalGrid::kc_done = false

Whether the Cartesian coordinates have been computed.

◆ kd_done

bool ModuleCell::ReciprocalGrid::kd_done = false

Whether the direct coordinates have been computed.

◆ kl_segids

std::vector<int> ModuleCell::ReciprocalGrid::kl_segids

Index of the k-line segment each point belongs to.

◆ kvec_c

std::vector<ModuleBase::Vector3<double> > ModuleCell::ReciprocalGrid::kvec_c

Cartesian coordinates of the points, in unit of 2*pi/lat0.

◆ kvec_c_full

std::vector<ModuleBase::Vector3<double> > ModuleCell::ReciprocalGrid::kvec_c_full

Cartesian coordinates of the full (unreduced) mesh, in unit of 2*pi/lat0.

◆ kvec_d

std::vector<ModuleBase::Vector3<double> > ModuleCell::ReciprocalGrid::kvec_d

Direct coordinates of the points.

◆ ngk

std::vector<int> ModuleCell::ReciprocalGrid::ngk

Number of plane waves for each point (filled by the PW basis).

◆ nks

int ModuleCell::ReciprocalGrid::nks = 0

Number of points in the current pool (spin-free view).

◆ nkstot

int ModuleCell::ReciprocalGrid::nkstot = 0

Total number of (symmetry-reduced) points, INCLUDING spin multiplicity (i.e. nkstot = nkstot_nospin * spin_mult after K_Vectors::set_kup_and_kdw).

◆ nkstot_nospin

int ModuleCell::ReciprocalGrid::nkstot_nospin = 0

Total number of physical k-points before symmetry reduction, WITHOUT spin multiplicity. EXX/RI/LR code relies on this convention (see e.g. ri_2d_comm.hpp: ik_full + is_k * nkstot_nospin).

◆ nmp

int ModuleCell::ReciprocalGrid::nmp[3] = {0, 0, 0}

Monkhorst-Pack grid dimensions.

◆ wk

std::vector<double> ModuleCell::ReciprocalGrid::wk

Weight of each point.


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