1 #ifndef BAND_STRUCTURE_H
2 #define BAND_STRUCTURE_H
4 #include "exceptions.h"
50 virtual int getFullNumBands() = 0;
89 virtual std::tuple<WavevectorIndex, BandIndex>
getIndex(
const int &is) = 0;
129 virtual Eigen::Tensor<std::complex<double>, 3> getVelocities(
133 virtual Eigen::Tensor<std::complex<double>, 3> getPhEigenvectors(
162 Eigen::MatrixXcd &eigenvectors_) = 0;
172 Point &point, Eigen::Tensor<std::complex<double>, 3> &velocities_) = 0;
206 const Eigen::Vector3d &x,
207 const int &basis = Points::crystalCoordinates) = 0;
272 const bool &suppressError=
false) = 0;
332 bool withEigenvectors,
Points &points_,
333 bool isDistributed_ =
false);
373 int getNumPoints(
const bool &useFullGrid =
false)
override;
379 int getFullNumBands()
override;
391 bool getHasEigenvectors();
408 std::tuple<WavevectorIndex, BandIndex>
getIndex(
const int &is)
override;
590 Eigen::Tensor<std::complex<double>, 3> &velocities_)
override;
598 void setEnergies(Eigen::Vector3d &point, Eigen::VectorXd &energies_);
640 const Eigen::Vector3d &x,
641 const int &basis = Points::crystalCoordinates)
override;
706 const bool &suppressError=
false)
override;
725 bool isDistributed =
false;
727 bool hasEigenvectors =
false;
728 bool hasVelocities =
false;
738 size_t numPoints = 0;
739 int numLocalPoints = 0;
Class container of the quasiparticle band structure, i.e.
Definition: active_bandstructure.h:22
Base class for describing objects containing the band structure, i.e.
Definition: bandstructure.h:15
virtual std::tuple< WavevectorIndex, BandIndex > getIndex(const int &is)=0
Given a Bloch state index, finds the corresponding wavevector and band index.
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...
virtual const double & getEnergy(StateIndex &is)=0
Returns the energy of a quasiparticle from its Bloch index Used for accessing the band structure in t...
virtual std::vector< Eigen::Matrix3d > getRotationsStar(WavevectorIndex &ikIndex)=0
Given a irreducible point index, find the list of rotations to reconstruct the equivalent points.
virtual Eigen::Vector3d getWavevector(StateIndex &is)=0
Returns the wavevector of a quasiparticle from its Bloch index Used for accessing the band structure ...
virtual std::vector< int > parallelIrrStateIterator()=0
Iterator over the Bloch states in the band structure, distributed over MPI processes,...
virtual Particle getParticle()=0
Get the Particle object associated with this class.
virtual double getMaxEnergy()=0
Return the maximum energy of a bandstructure.
virtual void setVelocities(Point &point, Eigen::Tensor< std::complex< double >, 3 > &velocities_)=0
Saves in the class the velocities computed at a particular point.
virtual int hasWindow()=0
Checks whether the bandStructure has been built discarding some Bloch states from those available.
virtual std::vector< int > parallelIrrPointsIterator()=0
Iterator over the irreducible points indices.
virtual Eigen::Vector3d getGroupVelocity(StateIndex &is)=0
Returns the velocity of a quasiparticle from its Bloch index Used for accessing the band structure in...
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...
virtual std::vector< size_t > parallelStateIterator()
Returns an iterator to be used for loops over the Bloch state index.
Definition: bandstructure.cpp:13
virtual Points getPoints()=0
Returns the wavevectors on which the band structure is computed.
virtual BteIndex stateToBte(StateIndex &isIndex)=0
Utility method to convert an index over Bloch states in the band structure into a Bloch state index u...
virtual bool getIsDistributed()=0
Returns the boolean determining if this band structure is distributed or not.
virtual std::vector< Eigen::Matrix3d > getRotationsStar(StateIndex &isIndex)=0
Given an irreducible Bloch state (i.e.
virtual Point getPoint(const int &pointIndex)=0
Returns a wavevector, given a wavevector index.
virtual int getNumBands()=0
Returns the number of bands.
virtual int getNumPoints(const bool &useFullGrid=false)=0
Returns the total number of k/q-points.
virtual int getNumIrrStates()=0
Returns number of irr points for this band structure.
virtual void setEnergies(Point &point, Eigen::VectorXd &energies_)=0
Method to save quasiparticle eigenvectors inside FullBandStructure().
void outputComponentsToJSON(const std::string &outFileName="bandstructure.json")
Outputs the bandstructure information to file, either sym reduced or not.
Definition: bandstructure.cpp:20
virtual std::vector< int > irrPointsIterator()=0
Iterator over the irreducible points indices.
virtual std::vector< int > getReducibleStarFromIrreducible(const int &ik)=0
Method to find the points equivalent to an irreducible point.
virtual int getNumBands(WavevectorIndex &ik)=0
Returns the number of bands.
virtual std::vector< int > irrStateIterator()=0
Iterator over the Bloch states in the band structure, over just the irreducible wavevectors,...
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...
virtual void setEigenvectors(Point &point, Eigen::MatrixXcd &eigenvectors_)=0
Method to save quasiparticle eigenvectors inside FullBandStructure().
virtual int getNumStates()=0
Returns the total number of Bloch states.
void printBandStructureStateInfo(const int &fullNumBands)
A function to print information about how many states are in this bandstructure, and how things were ...
Definition: bandstructure.cpp:135
virtual size_t getIndex(const WavevectorIndex &ik, const BandIndex &ib)=0
Builds a Bloch state index, which combines both wavevector index and band index.
virtual ~BaseBandStructure()=default
Base destructor for bandstructure class, silences warnings.
FullBandStructure is the class that stores the energies, velocities and eigenvectors of a quasipartic...
Definition: bandstructure.h:318
void setEnergies(Point &point, Eigen::VectorXd &energies_) override
Method to save quasiparticle energies inside FullBandStructure().
Definition: bandstructure.cpp:521
Eigen::Vector3d getWavevector(StateIndex &is) override
Returns the energy of a quasiparticle from its Bloch index.
Definition: bandstructure.cpp:497
StateIndex bteToState(BteIndex &iBteIndex) override
Utility method to convert an index over Bloch states in a VectorBTE into the Bloch state index in the...
Definition: bandstructure.cpp:633
int getNumBands() override
Returns the number of bands.
Definition: bandstructure.cpp:292
void setEigenvectors(Point &point, Eigen::MatrixXcd &eigenvectors_) override
Method to save quasiparticle eigenvectors inside FullBandStructure().
Definition: bandstructure.cpp:561
std::vector< int > irrStateIterator() override
Iterator over the Bloch states in the band structure, over just the irreducible wavevectors,...
Definition: bandstructure.cpp:647
int getNumBands(WavevectorIndex &ik) override
Returns the number of bands, to provide flexibility in cases where full or activeBandStructure could ...
std::vector< std::tuple< WavevectorIndex, BandIndex > > getLocalEnergyStateIndices()
Returns the indices of all n,k indices on this process, or in an undistributed case,...
Definition: bandstructure.cpp:340
FullBandStructure & operator=(const FullBandStructure &that)
Copy assignment operator.
Definition: bandstructure.cpp:180
std::vector< int > parallelIrrStateIterator() override
Iterator over the Bloch states in the band structure, distributed over MPI processes,...
Definition: bandstructure.cpp:661
Eigen::MatrixXd getGroupVelocities(WavevectorIndex &ik) override
Returns the group velocity of a quasiparticle for all bands at a specified wavevector index.
Definition: bandstructure.cpp:428
double getMaxEnergy() override
Return the maximum energy of a bandstructure.
Definition: bandstructure.cpp:407
const double & getEnergy(StateIndex &is) override
Returns the energy of a quasiparticle from its Bloch index.
Definition: bandstructure.cpp:385
std::vector< int > irrPointsIterator() override
Iterator over the irreducible points indices.
Definition: bandstructure.cpp:672
void setVelocities(Point &point, Eigen::Tensor< std::complex< double >, 3 > &velocities_) override
Saves in the class the velocities computed at a particular point.
Definition: bandstructure.cpp:532
std::vector< int > getLocalWavevectorIndices()
Returns the indices of all wavevector indices on this process, or in an undistributed case,...
Definition: bandstructure.cpp:326
Eigen::Tensor< std::complex< double >, 3 > getVelocities(WavevectorIndex &ik) override
Returns the velocity operator (including off-diagonal matrix elements) of the quasiparticles at the s...
Definition: bandstructure.cpp:443
Particle getParticle() override
Get the Particle object associated with this class.
Definition: bandstructure.cpp:276
int getNumIrrStates() override
Returns the number of irreducible points for this band structure.
Definition: bandstructure.cpp:680
std::vector< Eigen::Matrix3d > getRotationsStar(WavevectorIndex &ikIndex) override
Given a irreducible point index, find the list of rotations to reconstruct the equivalent points.
Definition: bandstructure.cpp:599
Eigen::Vector3d getGroupVelocity(StateIndex &is) override
Returns the group velocity of a quasiparticle from its Bloch index.
Definition: bandstructure.cpp:412
Points getPoints() override
Returns the wavevectors on which the band structure is computed.
Definition: bandstructure.cpp:278
Eigen::VectorXd getEnergies(WavevectorIndex &ik) override
Returns the energies of all quasiparticle computed at a specified wavevector.
Definition: bandstructure.cpp:396
std::vector< int > getReducibleStarFromIrreducible(const int &ik) override
Method to find the points equivalent to an irreducible point.
Definition: bandstructure.cpp:693
Eigen::VectorXd getBandEnergies(int &bandIndex)
Returns all electronic energies for all wavevectors at fixed band index Used by the Fourier interpola...
Definition: bandstructure.cpp:586
int getNumPoints(const bool &useFullGrid=false) override
Returns the total number of k/q-points.
Definition: bandstructure.cpp:284
Eigen::MatrixXcd getEigenvectors(WavevectorIndex &ik) override
Obtain the eigenvectors of the quasiparticles at a specified wavevector.
Definition: bandstructure.cpp:461
int getPointIndex(const Eigen::Vector3d &crystalCoordinates, const bool &suppressError=false) override
Find the index of a point in the reducible list of points, given its coordinates in the crystal basis...
Definition: bandstructure.cpp:684
Point getPoint(const int &pointIndex) override
Returns a wavevector, given a wavevector index.
Definition: bandstructure.cpp:280
std::vector< int > getLocalBandIndices() const
Returns the indices of all state indices on this process, or in an undistributed case,...
Definition: bandstructure.cpp:367
std::tuple< int, Eigen::Matrix3d > getRotationToIrreducible(const Eigen::Vector3d &x, const int &basis=Points::crystalCoordinates) override
Given a point in crystal or cartesian coordinates, returns the index of the irreducible point and the...
Definition: bandstructure.cpp:611
Eigen::Tensor< std::complex< double >, 3 > getPhEigenvectors(WavevectorIndex &ik) override
Obtain the eigenvectors of the quasiparticles at a specified wavevector.
Definition: bandstructure.cpp:479
size_t getIndex(const WavevectorIndex &ik, const BandIndex &ib) override
Builds a Bloch state index, which runs on both wavevector index and band index.
Definition: bandstructure.cpp:304
BteIndex stateToBte(StateIndex &isIndex) override
Utility method to convert an index over Bloch states in the band structure into a Bloch state index u...
Definition: bandstructure.cpp:616
void symmetrize()
Symmetrizes the full band structure energies.
int hasWindow() override
Checks whether the bandStructure has been built discarding some Bloch states from those available.
Definition: bandstructure.cpp:298
std::vector< int > parallelIrrPointsIterator() override
Iterator over the irreducible points indices.
Definition: bandstructure.cpp:676
int getNumStates() override
Returns the total number of Bloch states, equal to numPoints*numBands.
Definition: bandstructure.cpp:323
bool getIsDistributed() override
Returns the boolean determining if this band structure is distributed or not.
Definition: bandstructure.cpp:300
Class for implementing strong typing.
Definition: utilities.h:51
Determines whether we are dealing with phonons or electrons.
Definition: particle.h:17
Class used to pass a single wavevector.
Definition: points.h:18
Base class for storing wavevectors in the Brillouin zone.
Definition: points.h:73