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

Virtual base class for Harmonic Hamiltonian. More...

#include <harmonic.h>

Inheritance diagram for HarmonicHamiltonian:

Public Member Functions

virtual int getNumBands ()=0
 Returns the total number of phonon branches / electron bands that are available in the interpolator. More...
 
virtual Particle getParticle ()=0
 Returns the Particle object to distinguish between electrons and phonons. More...
 
virtual std::tuple< Eigen::VectorXd, Eigen::MatrixXcd > diagonalize (Point &point)=0
 Diagonalize the Harmonic Hamiltonian at an arbitrary wavevector. More...
 
virtual std::tuple< Eigen::VectorXd, Eigen::MatrixXcd > diagonalizeFromCoordinates (Eigen::Vector3d &k)=0
 Diagonalize the Harmonic Hamiltonian at an arbitrary wavevector. More...
 
virtual Eigen::Tensor< std::complex< double >, 3 > diagonalizeVelocity (Point &point)=0
 Computes the velocity operator (if possible, otherwise just its diagonal matrix elements i.e. More...
 
virtual Eigen::Tensor< std::complex< double >, 3 > diagonalizeVelocityFromCoordinates (Eigen::Vector3d &coordinates)=0
 
virtual FullBandStructure populate (Points &fullPoints, const bool &withVelocities, const bool &withEigenvectors, const bool isDistributed=false)=0
 Method for the construction of the band structure on a grid of of wavevectors of the Brillouin zone. More...
 
virtual std::tuple< DoubleView2D, StridedComplexView3D, ComplexView4D > kokkosBatchedDiagonalizeWithVelocities (const DoubleView2D &cartesianCoordinates)=0
 
void kokkosBatchedTreatDegenerateVelocities (const DoubleView2D &cartesianCoordinates, const DoubleView2D &resultEnergies, ComplexView4D &resultVelocities, const double &threshold)
 
virtual StridedComplexView3D kokkosBatchedBuildBlochHamiltonian (const DoubleView2D &cartesianCoordinates)=0
 
virtual std::tuple< DoubleView2D, StridedComplexView3D > kokkosBatchedDiagonalizeFromCoordinates (const DoubleView2D &cartesianCoordinates, const bool withMassScaling=true)=0
 
virtual int estimateBatchSize (const bool &withVelocity)
 Estimate how many k-points we can compute on the GPU in one batch. More...
 

Detailed Description

The subclasses of this base class are the objects responsible for storing the DFT harmonic properties computed on a coarse grid, and containing the methods necessary for interpolating (diagonalizing) such harmonic hamiltonian on a fine grid.

Member Function Documentation

◆ diagonalize()

virtual std::tuple<Eigen::VectorXd, Eigen::MatrixXcd> HarmonicHamiltonian::diagonalize ( Point point)
pure virtual
Parameters
pointthe Point object describing the wavevector.
Returns
eigenvalues: the values of quasiparticle energies, a double vector of size numBands.
eigenvectors: a complex matrix of size (numBands,numBands) with the eigenvectors, ordered in columns, computed at the input wavevector.

Implemented in PhononH0, ElectronH0Wannier, and ElectronH0Fourier.

◆ diagonalizeFromCoordinates()

virtual std::tuple<Eigen::VectorXd, Eigen::MatrixXcd> HarmonicHamiltonian::diagonalizeFromCoordinates ( Eigen::Vector3d &  k)
pure virtual

Same as diagonalize(), but the wavevector coordinates are explicitly passed in input.

Parameters
pointthe wavevector in cartesian coordinates.
Returns
eigenvalues: the values of quasiparticle energies, a double vector of size numBands.
eigenvectors: a complex matrix of size (numBands,numBands) with the eigenvectors, ordered in columns, computed at the input wavevector.

Implemented in ElectronH0Fourier, PhononH0, and ElectronH0Wannier.

Here is the caller graph for this function:

◆ diagonalizeVelocity()

virtual Eigen::Tensor<std::complex<double>, 3> HarmonicHamiltonian::diagonalizeVelocity ( Point point)
pure virtual

the group velocity) of the quasiparticle at the input wavevector. v = \partial energy / \partial k.

Parameters
pointPoint object with the input wavevector.
Returns
velocity: a tensor of size(numBands,numBands,3) with the matrix elements of the operator at the given wavevector. (third index is the cartesian direction).

Implemented in PhononH0, ElectronH0Wannier, and ElectronH0Fourier.

Here is the caller graph for this function:

◆ estimateBatchSize()

virtual int HarmonicHamiltonian::estimateBatchSize ( const bool &  withVelocity)
inlinevirtual
Parameters
withVelocityset to true if computing also the velocity operator, which requires more memory
Returns
numBatches: an estimate on how many k-point we can compute in one call of the kokkosBatched functions.

Reimplemented in PhononH0, and ElectronH0Wannier.

Here is the caller graph for this function:

◆ getNumBands()

virtual int HarmonicHamiltonian::getNumBands ( )
pure virtual
Returns
numBands: integer number of bands.

Implemented in PhononH0, ElectronH0Wannier, and ElectronH0Fourier.

Here is the caller graph for this function:

◆ getParticle()

virtual Particle HarmonicHamiltonian::getParticle ( )
pure virtual
Returns
particle: a Particle object

Implemented in PhononH0, ElectronH0Wannier, and ElectronH0Fourier.

Here is the caller graph for this function:

◆ kokkosBatchedTreatDegenerateVelocities()

void HarmonicHamiltonian::kokkosBatchedTreatDegenerateVelocities ( const DoubleView2D &  cartesianCoordinates,
const DoubleView2D &  resultEnergies,
ComplexView4D &  resultVelocities,
const double &  threshold 
)

The next part is a bit convoluted because it's tricky to do in parallel We want to build N matrices of size iDegxiDeg containing the velocity degenerate blocks. To this aim, we need two functions funcK, funcB. Such that funcK(iMat), funcB(iMat) return the iK and ib index locating the start of the block that will be diagonalized by the iMat-th matrix

We take advantage of an exclusive scan. Say we have a vector 0 0 0 1 0 0 0 0 1; which spans the bloch states, and 1 locates the beginning of a block of size iDeg that we want to diagonalize. The indices locating the "1", i.e. [3, 8], are given by an exclusive scan: 0 0 0 0 1 1 1 1 1 2 So, scan(ik,ib) = iMat. And from this, I can do the inverse mapping.

Here is the caller graph for this function:

◆ populate()

virtual FullBandStructure HarmonicHamiltonian::populate ( Points fullPoints,
const bool &  withVelocities,
const bool &  withEigenvectors,
const bool  isDistributed = false 
)
pure virtual

In particular, we save the information for all the bands available to the harmonic hamiltonian.

Parameters
fullPointsa Points object class over which we will compute the band structure (e.g. FullPoints, or PathPoints)
withVelocitiesbool. If set to true, we store the velocity operator.
withEigenvectorsbool. If set to true, we store the eigenvectors
Returns
fullBandStructure: a FullBandStructure object that stores at least the quasiparticle energies and, optionally, velocities and eigenvectors.

Implemented in PhononH0, ElectronH0Wannier, and ElectronH0Fourier.

Here is the caller graph for this function: