Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
BaseBandStructure Class Referenceabstract

Base class for describing objects containing the band structure, i.e. More...

#include <bandstructure.h>

Inheritance diagram for BaseBandStructure:

Public Member Functions

virtual ~BaseBandStructure ()=default
 Base destructor for bandstructure class, silences warnings.
 
virtual Particle getParticle ()=0
 Get the Particle object associated with this class. More...
 
virtual Points getPoints ()=0
 Returns the wavevectors on which the band structure is computed. More...
 
virtual Point getPoint (const int &pointIndex)=0
 Returns a wavevector, given a wavevector index. More...
 
virtual int getNumPoints (const bool &useFullGrid=false)=0
 Returns the total number of k/q-points. More...
 
virtual int getNumBands ()=0
 Returns the number of bands. More...
 
virtual int getFullNumBands ()=0
 
virtual int getNumBands (WavevectorIndex &ik)=0
 Returns the number of bands. More...
 
virtual int hasWindow ()=0
 Checks whether the bandStructure has been built discarding some Bloch states from those available. More...
 
virtual bool getIsDistributed ()=0
 Returns the boolean determining if this band structure is distributed or not.
 
virtual size_t getIndex (const WavevectorIndex &ik, const BandIndex &ib)=0
 Builds a Bloch state index, which combines both wavevector index and band index. More...
 
virtual std::tuple< WavevectorIndex, BandIndexgetIndex (const int &is)=0
 Given a Bloch state index, finds the corresponding wavevector and band index. More...
 
virtual std::tuple< WavevectorIndex, BandIndexgetIndex (StateIndex &is)=0
 
virtual int getNumStates ()=0
 Returns the total number of Bloch states. More...
 
virtual std::vector< size_t > parallelStateIterator ()
 Returns an iterator to be used for loops over the Bloch state index. More...
 
virtual const double & getEnergy (StateIndex &is)=0
 Returns the energy of a quasiparticle from its Bloch index Used for accessing the band structure in the BTE. More...
 
virtual Eigen::VectorXd getEnergies (WavevectorIndex &ik)=0
 
virtual double getMaxEnergy ()=0
 Return the maximum energy of a bandstructure. More...
 
virtual Eigen::Vector3d getGroupVelocity (StateIndex &is)=0
 Returns the velocity of a quasiparticle from its Bloch index Used for accessing the band structure in the BTE. More...
 
virtual Eigen::MatrixXd getGroupVelocities (WavevectorIndex &ik)=0
 
virtual Eigen::Tensor< std::complex< double >, 3 > getVelocities (WavevectorIndex &ik)=0
 
virtual Eigen::MatrixXcd getEigenvectors (WavevectorIndex &ik)=0
 
virtual Eigen::Tensor< std::complex< double >, 3 > getPhEigenvectors (WavevectorIndex &ik)=0
 
virtual Eigen::Vector3d getWavevector (StateIndex &is)=0
 Returns the wavevector of a quasiparticle from its Bloch index Used for accessing the band structure in the BTE. More...
 
virtual Eigen::Vector3d getWavevector (WavevectorIndex &ik)=0
 
virtual void setEnergies (Point &point, Eigen::VectorXd &energies_)=0
 Method to save quasiparticle eigenvectors inside FullBandStructure(). More...
 
virtual void setEigenvectors (Point &point, Eigen::MatrixXcd &eigenvectors_)=0
 Method to save quasiparticle eigenvectors inside FullBandStructure(). More...
 
virtual void setVelocities (Point &point, Eigen::Tensor< std::complex< double >, 3 > &velocities_)=0
 Saves in the class the velocities computed at a particular point. More...
 
virtual std::vector< Eigen::Matrix3d > getRotationsStar (WavevectorIndex &ikIndex)=0
 Given a irreducible point index, find the list of rotations to reconstruct the equivalent points. More...
 
virtual std::vector< Eigen::Matrix3d > getRotationsStar (StateIndex &isIndex)=0
 Given an irreducible Bloch state (i.e. More...
 
virtual std::tuple< int, Eigen::Matrix3d > getRotationToIrreducible (const Eigen::Vector3d &x, const int &basis=Points::crystalCoordinates)=0
 Given a point in crystal or cartesian coordinates, returns the index of the irreducible point and the rotation such that rotation*irrPoint = redPoint. More...
 
virtual BteIndex stateToBte (StateIndex &isIndex)=0
 Utility method to convert an index over Bloch states in the band structure into a Bloch state index usable by VectorBTE. More...
 
virtual StateIndex bteToState (BteIndex &iBteIndex)=0
 Utility method to convert an index over Bloch states in a VectorBTE into the Bloch state index in the band structure. More...
 
virtual std::vector< int > irrStateIterator ()=0
 Iterator over the Bloch states in the band structure, over just the irreducible wavevectors, but isn't distributed over MPI processes. More...
 
virtual std::vector< int > parallelIrrStateIterator ()=0
 Iterator over the Bloch states in the band structure, distributed over MPI processes, running only over irreducible wavevectors. More...
 
virtual std::vector< int > irrPointsIterator ()=0
 Iterator over the irreducible points indices. More...
 
virtual std::vector< int > parallelIrrPointsIterator ()=0
 Iterator over the irreducible points indices. More...
 
virtual int getNumIrrStates ()=0
 Returns number of irr points for this band structure.
 
virtual int getPointIndex (const Eigen::Vector3d &crystalCoordinates, const bool &suppressError=false)=0
 Find the index of a point in the reducible list of points, given its coordinates in the crystal basis. More...
 
virtual std::vector< int > getReducibleStarFromIrreducible (const int &ik)=0
 Method to find the points equivalent to an irreducible point. More...
 
void outputComponentsToJSON (const std::string &outFileName="bandstructure.json")
 Outputs the bandstructure information to file, either sym reduced or not. More...
 
void printBandStructureStateInfo (const int &fullNumBands)
 A function to print information about how many states are in this bandstructure, and how things were reduced by filtering of states. More...
 

Detailed Description

the harmonic properties of a quasiparticle, as a function of wavevectors (Points).

Member Function Documentation

◆ bteToState()

virtual StateIndex BaseBandStructure::bteToState ( BteIndex iBteIndex)
pure virtual

Unlike stateToBte, this should always have a solution.

Parameters
iBteIndexindex of the Bloch state in the BTE
Returns
StateIndex: the index of the Bloch state in the band structure.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getEnergy()

virtual const double& BaseBandStructure::getEnergy ( StateIndex is)
pure virtual
Parameters
stateIndexan integer index in range [0,numStates[
Returns
energy: the value of the QP energy for that given Bloch index. Phonon energies are referred to zero, with negative energies being actually complex phonon frequencies. Electronic energies are not saved with any particular reference, and should be used together with the chemical potential computed by StatisticsSweep. By policy, it's in rydberg units.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getGroupVelocity()

virtual Eigen::Vector3d BaseBandStructure::getGroupVelocity ( StateIndex is)
pure virtual
Parameters
stateIndexan integer index in range [0,numStates[
Returns
velocity: a 3d vector with velocity. By policy, we save it in the cartesian basis and in atomic rydberg units.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getIndex() [1/2]

virtual std::tuple<WavevectorIndex, BandIndex> BaseBandStructure::getIndex ( const int &  is)
pure virtual
Parameters
stateIndexStateIndex integer from 0 to numStates - 1 = numBands*numPoints-1
Returns
WavevectorIndex: strong-typed index on wavevector
BandIndex: strong-typed index on bands

Implemented in FullBandStructure, and ActiveBandStructure.

◆ getIndex() [2/2]

virtual size_t BaseBandStructure::getIndex ( const WavevectorIndex ik,
const BandIndex ib 
)
pure virtual

It's used to view the various matrices such as energy as a 1D vector, and can be used in combination with get() methods.

Parameters
wavevectorIndexstrong-typed index on wavevector
Returns
stateIndex: integer from 0 to numStates-1=numBands*numPoints-1

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getMaxEnergy()

virtual double BaseBandStructure::getMaxEnergy ( )
pure virtual

Used when ph energy maximum is a cutoff for phel scattering.

Returns
maxEnergy: maximum energy value of bandstructure in Ry

Implemented in FullBandStructure, and ActiveBandStructure.

◆ getNumBands() [1/2]

virtual int BaseBandStructure::getNumBands ( )
pure virtual
Returns
numBands: the total number of bands present in the bandstructure. If the number of bands is not constant, calls an error.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getNumBands() [2/2]

virtual int BaseBandStructure::getNumBands ( WavevectorIndex ik)
pure virtual

If the band structure is active, and there are a different number of bands at each wavevector, this function returns the number of bands at that point. If not, this defaults to the behavior of getNumBands() and just returns the number of bands. This is necessary for parts of the code where we leave an option to swap in different child band structure types.

Implemented in FullBandStructure, and ActiveBandStructure.

◆ getNumPoints()

virtual int BaseBandStructure::getNumPoints ( const bool &  useFullGrid = false)
pure virtual
Parameters
useFullGriddefault = false. If true, returns the number of points of the full monkhorst-pack grid of wavevectors, otherwise, returns the number of wavevectors stored in the BandStructure.
Returns
numPoints: the total number of wavevectors of the bandStructure.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getNumStates()

virtual int BaseBandStructure::getNumStates ( )
pure virtual
Returns
numStates: the integer number of Bloch states.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getParticle()

virtual Particle BaseBandStructure::getParticle ( )
pure virtual
Returns
particle: a Particle object, describing e.g. whether this is a phonon or electron bandStructure

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getPoint()

virtual Point BaseBandStructure::getPoint ( const int &  pointIndex)
pure virtual

The wavevector index runs from 0 to numPoints-1

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getPointIndex()

virtual int BaseBandStructure::getPointIndex ( const Eigen::Vector3d &  crystalCoordinates,
const bool &  suppressError = false 
)
pure virtual
Parameters
crystalCoordinatescoordinates of the point in crystal basis
suppressErrordefault false. If false, will throw an error if the point is not found
Returns
ik: the index of the point

Implemented in FullBandStructure, and ActiveBandStructure.

◆ getPoints()

virtual Points BaseBandStructure::getPoints ( )
pure virtual
Returns
Points: the object representing the Brillouin zone wavevectors.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getReducibleStarFromIrreducible()

virtual std::vector<int> BaseBandStructure::getReducibleStarFromIrreducible ( const int &  ik)
pure virtual
Parameters
ikindex of the irreducible point, with ik running on the full list of reducible points.
Returns
vector<int>: the list of indices of the reducible points equivalent to point #ik.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getRotationsStar() [1/2]

virtual std::vector<Eigen::Matrix3d> BaseBandStructure::getRotationsStar ( StateIndex isIndex)
pure virtual

any band at an irreducible point), find the list of rotations to reconstruct the equivalent points.

Parameters
isIndexIndex of the irreducible Bloch State. This index is a number between 0 and numStates.
Returns
rotations: a vector with the rotations used to reconstruct the symmetry-equivalent Bloch states.

Implemented in FullBandStructure, and ActiveBandStructure.

◆ getRotationsStar() [2/2]

virtual std::vector<Eigen::Matrix3d> BaseBandStructure::getRotationsStar ( WavevectorIndex ikIndex)
pure virtual
Parameters
ikIndexIndex of the irreducible wavevector. This index is a number between 0 and N_k_reducible.
Returns
rotations: a vector with the rotations used to reconstruct the symmetry-equivalent Bloch states.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getRotationToIrreducible()

virtual std::tuple<int, Eigen::Matrix3d> BaseBandStructure::getRotationToIrreducible ( const Eigen::Vector3d &  x,
const int &  basis = Points::crystalCoordinates 
)
pure virtual
Parameters
xpoint coordinates
basiseither Points::crystalCoordinates or Points::cartesianCoordinates, this will treat x in the appropriate coordinate. Also the returned rotation will be in the corresponding basis.
Returns
<ik,rot>: a tuple with the index of the irreducible point and the rotation matrix connecting the irreducible and reducible point.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ getWavevector()

virtual Eigen::Vector3d BaseBandStructure::getWavevector ( StateIndex is)
pure virtual
Parameters
stateIndexan integer index in range [0,numStates[
Returns
wavevector: a 3d vector with the wavevector in cartesian coordinates in units of Bohr^-1.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ hasWindow()

virtual int BaseBandStructure::hasWindow ( )
pure virtual
Returns
windowMethod: one of the values of Window::filterMethod. 0 for no filter.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ irrPointsIterator()

virtual std::vector<int> BaseBandStructure::irrPointsIterator ( )
pure virtual

The iterator is serial, not parallelized with MPI.

Returns
k-indices: a std::vector<int> with the indices of the irreducible points.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ irrStateIterator()

virtual std::vector<int> BaseBandStructure::irrStateIterator ( )
pure virtual
Returns
State-indices: a vector<int> with the indices over Bloch states stored in the band structure

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ outputComponentsToJSON()

void BaseBandStructure::outputComponentsToJSON ( const std::string &  outFileName = "bandstructure.json")
Parameters
outFileName: optional output file name
symReduced: if the bandstructure info should be sym reduced or not
Here is the call graph for this function:

◆ parallelIrrPointsIterator()

virtual std::vector<int> BaseBandStructure::parallelIrrPointsIterator ( )
pure virtual

The iterator is parallelized over MPI processes.

Returns
k-indices: a std::vector<int> with the indices of the irreducible points.

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ parallelIrrStateIterator()

virtual std::vector<int> BaseBandStructure::parallelIrrStateIterator ( )
pure virtual
Returns
State-indices: a vector<int> with the indices over Bloch states stored in the band structure

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function:

◆ parallelStateIterator()

std::vector< size_t > BaseBandStructure::parallelStateIterator ( )
virtual

The values of the iterator are distributed in N blocks over N MPI ranks.

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

◆ printBandStructureStateInfo()

void BaseBandStructure::printBandStructureStateInfo ( const int &  fullNumBands)
Parameters
fullNumBandsThe maximum number of bands possible
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEigenvectors()

virtual void BaseBandStructure::setEigenvectors ( Point point,
Eigen::MatrixXcd &  eigenvectors_ 
)
pure virtual

Note that in this case, eigenvectors are passed as a matrix, which is the case e.g. for the Wannier interpolation, where the eigenvectors represent the unitary transformation matrix U for Wannier localization.

Parameters
pointa Point object with the coordinates of the wavevector, which should come from the same Point class stored in FullBandStructure
eigenvectorsa complex matrix of size (numBands,numBands)

Implemented in FullBandStructure, and ActiveBandStructure.

◆ setEnergies()

virtual void BaseBandStructure::setEnergies ( Point point,
Eigen::VectorXd &  energies_ 
)
pure virtual
Parameters
pointa vector of 3 crystal coordinates. The method will look for the wavevector index.
energiesa vector of size (numBands) with the quasiparticle energies

Implemented in FullBandStructure, and ActiveBandStructure.

◆ setVelocities()

virtual void BaseBandStructure::setVelocities ( Point point,
Eigen::Tensor< std::complex< double >, 3 > &  velocities_ 
)
pure virtual
Parameters
pointa Point object representing the wavevector where these velocities have been computed.
velocitiesa rank-3 tensor of size (numBands,numBands,3) containing the matrix elements of the velocity operator. Diagonal elements are the quasiparticle group velocities.

Implemented in FullBandStructure, and ActiveBandStructure.

◆ stateToBte()

virtual BteIndex BaseBandStructure::stateToBte ( StateIndex isIndex)
pure virtual

If a state is not mapped to the VectorBTE, throws an error.

Parameters
StateIndexthe index of the Bloch state in the band structure.
Returns
BteIndex: index of the Bloch state in the BTE

Implemented in FullBandStructure, and ActiveBandStructure.

Here is the caller graph for this function: