Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
Points Class Reference

Base class for storing wavevectors in the Brillouin zone. More...

#include <points.h>

Collaboration diagram for Points:

Public Member Functions

 Points (Crystal &crystalObj_)
 Default constructor.
 
 Points (Crystal &crystalObj_, const Eigen::Vector3i &mesh_, const Eigen::Vector3d &offset_=Eigen::Vector3d::Zero())
 Constructor for a Monkhorst-Pack grid of wavevectors. More...
 
 Points (Crystal &crystal_, const Eigen::Tensor< double, 3 > &pathExtrema, const double &delta)
 Constructor for points on a path. More...
 
void setActiveLayer (const Eigen::VectorXi &filter_)
 Constructor for Active Points. More...
 
 Points (const Points &obj)
 Copy constructor.
 
Pointsoperator= (const Points &obj)
 Copy assignment operator.
 
std::tuple< Eigen::Vector3i, Eigen::Vector3d > getMesh ()
 Returns the details of the Monkhorst-pack mesh of wavevectors. More...
 
int getNumPoints () const
 Returns the number of wavevectors stored in the points class.
 
Eigen::Vector3d crystalToCartesian (const Eigen::Vector3d &point)
 Converts a wavevector from crystal to cartesian coordinates. More...
 
Eigen::Vector3d cartesianToCrystal (const Eigen::Vector3d &point)
 Converts a wavevector from cartesian to crystal coordinates. More...
 
Eigen::Vector3d bzToWs (const Eigen::Vector3d &point, const int &basis)
 Folds a wavevector in crystal coordinates to the Wigner Seitz zone. More...
 
Eigen::Vector3d foldToBz (const Eigen::Vector3d &pointCrystal, const int &basis)
 
CrystalgetCrystal ()
 Returns a reference to the crystal object on which the Points are defined.
 
Point getPoint (const int &index)
 Returns a Point object given its integer index. More...
 
Eigen::Vector3d getPointCoordinates (const int &index, const int &basis=crystalCoordinates)
 Get the coordinates of a wavevector from its index. More...
 
int getIndex (const Eigen::Vector3d &point)
 Get the wavevector index given the crystal coordinates of a wavevector. More...
 
int isPointStored (const Eigen::Vector3d &crystalCoordinates_)
 Like getIndex, get the wavevector index given the crystal coordinates of a wavevector, but returns -1 if point not found. More...
 
void setIrreduciblePoints (std::vector< Eigen::MatrixXd > *groupVelocities=nullptr)
 setIrreduciblePoints analyzes a current set of points to find its irreducible set. More...
 
std::vector< int > irrPointsIterator ()
 Returns an iterator on the index of irreducible points. More...
 
std::vector< int > parallelIrrPointsIterator ()
 Similar to irrPointsIterator, returns an iterator on the index of irreducible points. More...
 
int asIrreducibleIndex (const int &ik)
 Given an index of an irreducible point in the set [0,numPoints[, returns its index in the set of [0,numIrredPoints[ irreducible wavevectors. More...
 
int asReducibleIndex (const int &ik)
 Given the index of an irreducible point in the set [0,numIrredPoints[, returns its index in the set of [0,numPoints[ reducible wavevectors. More...
 
std::tuple< int, Eigen::Matrix3d > getRotationToIrreducible (const Eigen::Vector3d &x, const int &basis=cartesianCoordinates)
 Given the coordinates of a wavevector, getRotationToIrreducible returns the index of the irreducible point, and the rotation R such that k^irr = R k^red. More...
 
std::vector< Eigen::Matrix3d > getRotationsStar (const int &ik)
 Given the index of an irreducible point in the reducible list, returns the set of rotations that allow to map k^red = R k^irr. More...
 
std::vector< int > getReducibleStarFromIrreducible (const int &ik)
 Given the index of an irreducible point in the reducible list, returns the list of indices of the symmetry equivalent wavevectors. More...
 

Static Public Member Functions

static std::tuple< Eigen::Vector3i, Eigen::Vector3d > findMesh (const Eigen::Matrix< double, 3, Eigen::Dynamic > &points)
 Given a list of points, finds the monkhorst-pack mesh. More...
 

Static Public Attributes

static const int crystalCoordinates = crystalCoordinates_
 
static const int cartesianCoordinates = cartesianCoordinates_
 

Protected Member Functions

void setMesh (const Eigen::Vector3i &mesh_, const Eigen::Vector3d &offset_)
 Change the crystal object for a different one. More...
 
void setupGVectors ()
 

Protected Attributes

CrystalcrystalObj
 
Eigen::Vector3i mesh
 
Eigen::Vector3d offset
 
int numPoints = 0
 
Eigen::MatrixXd gVectors
 
bool explicitlyStored = false
 
bool isPointsListSorted = false
 
Eigen::MatrixXd pointsList
 
Eigen::VectorXi filteredToFullIndices
 
std::vector< Eigen::Matrix3d > rotationMatricesCrystal
 
std::vector< Eigen::Matrix3d > rotationMatricesCartesian
 
Eigen::VectorXi mapEquivalenceRotationIndex
 
Eigen::VectorXi mapIrreducibleToReducibleList
 
Eigen::VectorXi mapReducibleToIrreducibleList
 
int numIrrPoints = 0
 
std::vector< std::vector< int > > irreducibleStars
 
Eigen::VectorXi equiv
 

Detailed Description

The base class mostly refers to a uniform grid sampling the Brillouin zone. Different subclasses will specialize to different kinds of wavevector sets.

Constructor & Destructor Documentation

◆ Points() [1/2]

Points::Points ( Crystal crystalObj_,
const Eigen::Vector3i &  mesh_,
const Eigen::Vector3d &  offset_ = Eigen::Vector3d::Zero() 
)
Parameters
crystalthe crystal object that defines the Brillouin zone.
meshgrid size of the Monkhorst-pack.
offsetthe offset of the grid w.r.t. the Gamma point. Offset ranges in values from 0 to 1. 0.5 means half displacement of the grid.
Here is the call graph for this function:

◆ Points() [2/2]

Points::Points ( Crystal crystal_,
const Eigen::Tensor< double, 3 > &  pathExtrema,
const double &  delta 
)
Parameters
crystalthe crystal object that defines the Brillouin zone.
pathExtremaextrema of segments defining a path of points. PathExtrema has size (numSegments, 2, 3), where the first index spans the segments of the path, 2 is the beginning and the last element of the segment, and 3 is the cartesian coordinates of the extrema. Point coordinates must be in crystal coordinates. Example: if we want a path G->X->L, we have: 2 segments: G->X and X->L pathExtrema(0,0,:) = G. coordinates pathExtrema(0,1,:) = X. coordinates pathExtrema(1,0,:) = X. coordinates pathExtrema(1,1,:) = L. coordinates
deltasegments are populated with points, with a distance "delta" between different points in crystal coordinates.

Member Function Documentation

◆ asIrreducibleIndex()

int Points::asIrreducibleIndex ( const int &  ik)
Parameters
ikindex of the irreducible point in the reducible list.
Returns
ikIrr: index in the irreducible list.
Here is the caller graph for this function:

◆ asReducibleIndex()

int Points::asReducibleIndex ( const int &  ik)
Parameters
ikindex of the irreducible point in the irreducible list.
Returns
ikIrr: index in the reducible list.
Here is the caller graph for this function:

◆ bzToWs()

Eigen::Vector3d Points::bzToWs ( const Eigen::Vector3d &  point,
const int &  basis 
)
Parameters
pointCrystalthe coordinates of a wavevector
basisbasis (Points::cartesianCoordinates or Points::crystalCoordinates) of input and output wavevector.
Returns
wavevector: the wavevector coordinates folded in the WS zone.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cartesianToCrystal()

Eigen::Vector3d Points::cartesianToCrystal ( const Eigen::Vector3d &  point)
Parameters
pointthe input wavevector in cartesian coordinates.
Returns
wavevector: the output wavevector in crystal coordinates.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ crystalToCartesian()

Eigen::Vector3d Points::crystalToCartesian ( const Eigen::Vector3d &  point)
Parameters
pointthe input wavevector in crystal coordinates.
Returns
wavevector: the output wavevector in cartesian coordinates.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMesh()

std::tuple< Eigen::Vector3i, Eigen::Vector3d > Points::findMesh ( const Eigen::Matrix< double, 3, Eigen::Dynamic > &  points)
static
Parameters
pointsa matrix (3,numPoints) of wavevectors in crystal coordinates.
Returns
mesh,offset: the monkhorst-pack grid size and the offset w.r.t. the gamma point, that generates the input points list. Calls an error if the mesh doesn't correspond to a complete list.
Here is the caller graph for this function:

◆ getIndex()

int Points::getIndex ( const Eigen::Vector3d &  point)

Throws an error if the wavevector is not found in points.

Parameters
pointthe wavevector in crystal coordinates.
Returns
index: the index of the wavevector in the range [0,numPoints[
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMesh()

std::tuple< Eigen::Vector3i, Eigen::Vector3d > Points::getMesh ( )
Returns
<grid, offset>: grid is the 3D integration mesh used for the Brillouin zone sampling, and the 3D offset of the grid w.r.t. the Gamma point (values of offset from 0 to 1).
Here is the caller graph for this function:

◆ getPoint()

Point Points::getPoint ( const int &  index)

The Point object is used to move around the code the coordinates of the wavevector.

Parameters
indexthe integer wavevector index ranging in [0,numPoints[
Returns
point: a point object.
Here is the caller graph for this function:

◆ getPointCoordinates()

Eigen::Vector3d Points::getPointCoordinates ( const int &  index,
const int &  basis = crystalCoordinates 
)
Parameters
indexthe index of the desired wavevector.
basisspecify the basis to be used for the output coordinates. Either Points::crystalCoordinates or Points::cartesianCoordinates.
Returns
wavevector: the coordinates of the desired wavevector.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReducibleStarFromIrreducible()

std::vector< int > Points::getReducibleStarFromIrreducible ( const int &  ik)
Parameters
ikindex of irreducible point in the reducible list.
Returns
vector<int>: a vector with the indices of symmetry-equivalent points
Here is the caller graph for this function:

◆ getRotationsStar()

std::vector< Eigen::Matrix3d > Points::getRotationsStar ( const int &  ik)
Parameters
ikindex of irreducible point in the reducible list.
Returns
vector<Matrix3d>: a vector with the set of rotation to reconstruct the star.
Here is the caller graph for this function:

◆ getRotationToIrreducible()

std::tuple< int, Eigen::Matrix3d > Points::getRotationToIrreducible ( const Eigen::Vector3d &  x,
const int &  basis = cartesianCoordinates 
)
Parameters
xa 3d vector with the coordinates of the wavevector. They can be in crystal or cartesian basis, as specified by basis.
basiseither Points::cartesianCoordinates or crystalCoordinates, specifies the basis in which x is specified.
Returns
tuple: the first element of the tuple is the index of the irreducible point, the second is the 3d matrix with the rotation symmetry operation. The rotation is crystal or cartesian, depending on the value of basis.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ irrPointsIterator()

std::vector< int > Points::irrPointsIterator ( )

If setIrreduciblePoints has not been called, it just loops on all points.

Returns
std::vector<int>: a list of irreducible wavevector indices.
Here is the caller graph for this function:

◆ isPointStored()

int Points::isPointStored ( const Eigen::Vector3d &  crystalCoordinates_)
Parameters
crystalCoordinates_a 3d Eigen vector with crystal coordinates of a wavevector.
Returns
index: the index of the wavevector in the range [0,numPoints[ if the point is in the set of points, or -1 if not found.
Here is the caller graph for this function:

◆ parallelIrrPointsIterator()

std::vector< int > Points::parallelIrrPointsIterator ( )

If setIrreduciblePoints has not been called, it just loops on all points. However, the returned list has already been scattered across different MPI processes, so each MPI process has only a subset of irreducible points.

Note that symmetries do introduce some load unbalance. In fact, some irreducible points may have more symmetry-equivalent points than others, and thus may perform more work.

Returns
std::vector<int> a MPI-distributed list of irreducible wavevector indices.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setActiveLayer()

void Points::setActiveLayer ( const Eigen::VectorXi &  filter_)
Parameters
filtera vector of integers of "filtered" points, i.e. the indices of the wavevectors in parentPoints that we want to keep.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIrreduciblePoints()

void Points::setIrreduciblePoints ( std::vector< Eigen::MatrixXd > *  groupVelocities = nullptr)

It also builds the logic for storing all symmetry operations, such as finding which rotation maps an reducible point to its irreducible point and similar symmetry operations.

Parameters
groupVelocitiesan optional parameter, one can pass the values of the group velocities at all wavevectors. If passed, setIrreduciblePoints will try to find the best set of symmetries acting on wavevector that also transforms the group velocities (i.e. there may sometimes be more than one symmetry mapping v and k to irreducible values). Useful since we want symmetries in the BTE to be the same as group velocities.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMesh()

void Points::setMesh ( const Eigen::Vector3i &  mesh_,
const Eigen::Vector3d &  offset_ 
)
protected

Used as a helper by the symmetrize function in the bandstructure class.

Parameters
crystalthe new crystal to swap in
Here is the caller graph for this function: