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

QList class for managing q-points. More...

#include <qlist.h>

Inheritance diagram for ModuleCell::QList:
Collaboration diagram for ModuleCell::QList:

Public Member Functions

 QList ()
 Default constructor.
 ~QList ()
 Destructor.
void generate_mesh (UnitCell &ucell, ModuleSymmetry::Symmetry &symm, const std::vector< int > &mp_grid, bool use_irreps)
 Generate the Monkhorst-Pack q-point mesh and reduce it by star.
void read_from_file (const std::string &filename, UnitCell &ucell)
 Read q-points from a q-points file.
void print_qlists (std::ofstream &ofs) const
 Print the q-points in both Cartesian and direct coordinates.
int get_nq () const
 Get the number of q-points.
ModuleBase::Vector3< double > get_q (int idx) const
 Get q-point at given index.
int get_nirr (int idx) const
 Get the number of irreps at given q-point.
std::vector< int > get_irrep_modes (int q_idx, int irrep_idx) const
 Get irrep modes at given q-point and irrep index.
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) override
 Reduce the q-points by star (time-reversal included).
Public Member Functions inherited from ModuleCell::ReciprocalGrid
 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.

Private Member Functions

void interpolate_q_between (std::ifstream &ifq, std::vector< ModuleBase::Vector3< double > > &qvec)
 Interpolate q-points between successive special points.
void get_irreps (const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm)
 Get irreps for each q-point.

Private Attributes

std::vector< int > nirr_
 number of irreps for each q-point
std::vector< std::vector< std::vector< int > > > irrep_modes_
 irrep modes
ModuleSymmetry::LittleGroup little_group_
 little group of the current q-point

Additional Inherited Members

Public Attributes inherited from ModuleCell::ReciprocalGrid
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 inherited from ModuleCell::ReciprocalGrid
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

QList class for managing q-points.

Inherits the spin-free reciprocal-grid functionality (mesh generation, coordinate conversion, weights, star reduction primitive) from ReciprocalGrid and adds the q-specific star reduction (always including the time-reversal partner -q, no spin expansion) together with the little-group irreducible-representation data (placeholder in the current version).

Constructor & Destructor Documentation

◆ QList()

ModuleCell::QList::QList ( )

Default constructor.

◆ ~QList()

ModuleCell::QList::~QList ( )

Destructor.

Member Function Documentation

◆ generate_mesh()

void ModuleCell::QList::generate_mesh ( UnitCell & ucell,
ModuleSymmetry::Symmetry & symm,
const std::vector< int > & mp_grid,
bool use_irreps )

Generate the Monkhorst-Pack q-point mesh and reduce it by star.

Parameters
ucellunit cell
symmsymmetry object
mp_gridMonkhorst-Pack grid
use_irrepswhether to use irreps
Here is the call graph for this function:

◆ get_irrep_modes()

std::vector< int > ModuleCell::QList::get_irrep_modes ( int q_idx,
int irrep_idx ) const

Get irrep modes at given q-point and irrep index.

Parameters
q_idxq-point index
irrep_idxirrep index
Returns
irrep modes

◆ get_irreps()

void ModuleCell::QList::get_irreps ( const UnitCell & ucell,
const ModuleSymmetry::Symmetry & symm )
private

Get irreps for each q-point.

Currently fills a fully-symmetric placeholder (one A1 irrep per q-point); the LittleGroup decomposition is implemented in Phase 3.

Parameters
ucellunit cell
symmsymmetry object
Here is the caller graph for this function:

◆ get_nirr()

int ModuleCell::QList::get_nirr ( int idx) const
inline

Get the number of irreps at given q-point.

Parameters
idxq-point index
Returns
number of irreps (0 if no irrep data was computed)

◆ get_nq()

int ModuleCell::QList::get_nq ( ) const
inline

Get the number of q-points.

Returns
number of q-points
Here is the caller graph for this function:

◆ get_q()

ModuleBase::Vector3< double > ModuleCell::QList::get_q ( int idx) const
inline

Get q-point at given index.

Parameters
idxq-point index
Returns
q-point vector (direct coordinates); zero vector if idx is out of range
Here is the caller graph for this function:

◆ interpolate_q_between()

void ModuleCell::QList::interpolate_q_between ( std::ifstream & ifq,
std::vector< ModuleBase::Vector3< double > > & qvec )
private

Interpolate q-points between successive special points.

Parameters
ifqinput stream positioned at the special-point list
qvecoutput q-point coordinates
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_qlists()

void ModuleCell::QList::print_qlists ( std::ofstream & ofs) const

Print the q-points in both Cartesian and direct coordinates.

Parameters
ofsoutput stream
Here is the call graph for this function:

◆ read_from_file()

void ModuleCell::QList::read_from_file ( const std::string & filename,
UnitCell & ucell )

Read q-points from a q-points file.

Supports the same formats as the K-points file: a Monkhorst-Pack mesh (nkstot == 0), an explicit Direct/Cartesian list, or a Line_Direct/Line_Cartesian path (interpolated). No symmetry reduction is performed here (the interface has no symmetry object); use generate_mesh for a symmetry-reduced mesh.

Parameters
filenamefilename
ucellunit cell
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduce_by_symmetry()

void ModuleCell::QList::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 )
overridevirtual

Reduce the q-points by star (time-reversal included).

Implements the pure-virtual hook of ReciprocalGrid: builds the reciprocal-space point-group operations via build_star_ops, always doubles them by -q, and folds the mesh with ReciprocalGrid::reduce_ibz.

Parameters
ucellunit cell
symmsymmetry object
use_symmwhether symmetry reduction is enabled
skptoutput string (unused for q-points)
matchset to false if the reciprocal lattice is not compatible with the real-space lattice

Implements ModuleCell::ReciprocalGrid.

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

Member Data Documentation

◆ irrep_modes_

std::vector<std::vector<std::vector<int> > > ModuleCell::QList::irrep_modes_
private

irrep modes

◆ little_group_

ModuleSymmetry::LittleGroup ModuleCell::QList::little_group_
private

little group of the current q-point

◆ nirr_

std::vector<int> ModuleCell::QList::nirr_
private

number of irreps for each q-point


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