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

This class describes the construction of the electron scattering matrix. More...

#include <el_scattering_matrix.h>

Inheritance diagram for ElScatteringMatrix:
Collaboration diagram for ElScatteringMatrix:

Public Member Functions

 ElScatteringMatrix (Context &context_, StatisticsSweep &statisticsSweep_, BaseBandStructure &innerBandStructure_, BaseBandStructure &outerBandStructure_, PhononH0 &h0)
 Default constructor. More...
 
VectorBTE getSingleModeMRTimes ()
 Function to return the momentum relaxation times specifically.
 
- Public Member Functions inherited from BaseElScatteringMatrix
 BaseElScatteringMatrix (Context &context_, StatisticsSweep &statisticsSweep_, BaseBandStructure &innerBandStructure_, BaseBandStructure &outerBandStructure_)
 Constructor that just calls the constructor of scattering matrix.
 
- Public Member Functions inherited from ScatteringMatrix
 ScatteringMatrix (Context &context_, StatisticsSweep &statisticsSweep_, BaseBandStructure &innerBandStructure_, BaseBandStructure &outerBandStructure_)
 Scattering matrix constructor. More...
 
 ScatteringMatrix ()
 Default constructor.
 
void setup ()
 This method needs to be called right after the constructor. More...
 
VectorBTE diagonal ()
 Returns the diagonal matrix elements. More...
 
double & operator() (const int &row, const int &col)
 Get and set operator. More...
 
VectorBTE offDiagonalDot (VectorBTE &inPopulation)
 Computes the product A*f - diagonal(A)*f where A is the scattering matrix and f is the vector of quasiparticle populations.
 
std::vector< VectorBTEoffDiagonalDot (std::vector< VectorBTE > &inPopulations)
 
VectorBTE dot (VectorBTE &inPopulation)
 Computes the product A*f where A is the scattering matrix and f is the vector of quasiparticle populations.
 
std::vector< VectorBTEdot (std::vector< VectorBTE > &inPopulations)
 
VectorBTE getSingleModeTimes ()
 Call to obtain the single-particle relaxation times of the systems. More...
 
VectorBTE getLinewidths ()
 Converts symmetrized internal scattering matrix diagonal to linewidths and returns the result. More...
 
void setLinewidths (VectorBTE &linewidths)
 Call to set the single-particle linewidths. More...
 
VectorBTE getSingleModeTimes (const VectorBTE &anyInternalDiagonal)
 Call to obtain the single-particle relaxation times of the systems given any internal diagonal like object – (basically, the linewidths but potentially scaled by some symmetrization factor) More...
 
VectorBTE getLinewidths (const VectorBTE &anyInternalDiagonal)
 Call to obtain the single-particle linewidths. More...
 
void a2Omega ()
 Converts the scattering matrix from the form A to the symmetrised Omega. More...
 
void omega2A ()
 The inverse of a2Omega, converts the matrix Omega to A.
 
std::tuple< Eigen::VectorXd, ParallelMatrix< double > > diagonalize (int numEigenvalues=0)
 Diagonalize the scattering matrix. More...
 
int getSMatrixIndex (BteIndex &bteIndex, CartIndex &cartIndex)
 Function to combine a BTE index and a cartesian index into one index of the scattering matrix. More...
 
std::tuple< BteIndex, CartIndexgetSMatrixIndex (const int &iMat)
 Function to split a scattering matrix index (on rows/columns of S) into a BTE index and a cartesian index. More...
 
void symmetrize ()
 Reinforce the condition that the matrix is symmetric.
 
void relaxonsToJSON (const std::string &fileName, const Eigen::VectorXd &eigenvalues)
 Output relaxons scattering matrix quantities to file (particularly the tau values) Jenny's note: However, I have a feeling this should be elsewhere, as we're actually passing the eigenvalues back into this function. More...
 
std::vector< std::tuple< int, int > > getAllLocalStates ()
 Call the underlying PMatrix function to return the iterator of all elements of the matrix which are local. More...
 
void outputToHDF5 (const std::string &outFileName)
 Outputs the matrix to an hdf5 file. More...
 

Protected Member Functions

void builder (std::shared_ptr< VectorBTE > linewidth, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations) override
 Function with the detailed calculation of the scattering matrix. More...
 
- Protected Member Functions inherited from ScatteringMatrix
std::vector< std::tuple< std::vector< int >, int > > getIteratorWavevectorPairs (const bool &rowMajor=false)
 Returns a vector of pairs of wavevector indices to iterate over during the construction of the scattering matrix. More...
 
void degeneracyAveragingLinewidths (std::shared_ptr< VectorBTE > linewidth)
 Performs an average of the linewidths over degenerate states. More...
 
Eigen::MatrixXd precomputeOccupations (BaseBandStructure &bandStructure)
 Function to precompute particle populations before scattering rates are calculated. More...
 
std::vector< int > getExcludeIndices (BaseBandStructure &bandStructure)
 Method which for a phonon bandstructure returns the indices to be discarded in a phonon calculation due to very low phonon frequencies. More...
 
void setMatrixCase (std::shared_ptr< VectorBTE > linewidth, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations)
 
void addRateToMatrix (const Context &context, double linewidthRate, double matrixRate, int iCalc, int is1, int is2Irr, int iBte1, int iBte2, const Particle &p1, const Particle &p2, const Eigen::Matrix3d &rotation, std::shared_ptr< VectorBTE > linewidth, const std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations)
 Method to add scattering rate to matrix and linewidth containers. More...
 
void enforceDetailedBalance ()
 A function to fix the linewidths to agree with the off diagonal elements, to enforce finding the special eigenvectors.
 
void replaceMatrixLinewidths ()
 Replace the linewidths of the scatterng matrix with the supplied VectorBTE values.
 
std::tuple< BaseBandStructure *, BaseBandStructure * > getStateBandStructures (const BteIndex &iBte1, const BteIndex &iBte2)
 Returns a tuple of final and initial particles for a give state. More...
 
std::tuple< int, int > coupledToBandStructureIndices (const int &iBte1, const int &iBte2, const Particle &p1, const Particle &p2)
 If we have a coupled scattering matrix, we need to shift the matrix element indices back to those associated with ph and el bandstructures before accessing their quantities. More...
 
template<size_t n>
void addUNRates (int iCalc, int iBte, double rate, const std::array< Point, n > &crysPoints, auto momentumConsExpr)
 Generic function to add UN times to their containers. More...
 

Protected Attributes

InteractionElPhWancouplingElPhWan
 
PhononH0phononH0
 
- Protected Attributes inherited from BaseElScatteringMatrix
std::shared_ptr< VectorBTElinewidthMR
 
- Protected Attributes inherited from ScatteringMatrix
Contextcontext
 
StatisticsSweepstatisticsSweep
 
BaseBandStructureinnerBandStructure
 
BaseBandStructureouterBandStructure
 
enum MatrixCase matrixCase
 
bool constantRTA = false
 
bool highMemory = true
 
bool outputUNTimes = false
 
double boundaryLength
 
bool doBoundary
 
bool isMatrixOmega = false
 
bool isCoupled = false
 
std::function< std::tuple< long, long >long, long, const Particle &, const Particle &)> shiftToCoupledIndices
 
std::shared_ptr< VectorBTEinternalDiagonal
 
std::shared_ptr< VectorBTEinternalDiagonalUmklapp
 
std::shared_ptr< VectorBTEinternalDiagonalNormal
 
ParallelMatrix< double > theMatrix
 
int numStates
 
int numCalculations
 
int dimensionality_
 
int numElStates = 0
 
std::vector< int > excludeIndices
 

Friends

void addElPhScattering (BaseElScatteringMatrix &matrix, Context &context, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations, std::vector< std::tuple< std::vector< int >, int >> kPairIterator, Eigen::MatrixXd &innerFermi, BaseBandStructure &innerBandStructure, BaseBandStructure &outerBandStructure, PhononH0 &phononH0, InteractionElPhWan &couplingElPhWan, std::shared_ptr< VectorBTE > linewidth)
 
void addDragTerm (BaseElScatteringMatrix &matrix, Context &context, std::vector< std::tuple< std::vector< int >, int >> kqPairIterator, const int &dragTermType, ElectronH0Wannier *electronH0, InteractionElPhWan &couplingElPhWan, BaseBandStructure &innerBandStructure, BaseBandStructure &outerBandStructure, std::shared_ptr< VectorBTE > linewidth)
 
void addChargedImpurityScattering (BaseElScatteringMatrix &matrix, Context &context, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations, std::vector< std::tuple< std::vector< int >, int >> kPairIterator, BaseBandStructure &innerBandStructure, BaseBandStructure &outerBandStructure, std::shared_ptr< VectorBTE > linewidth)
 
void add_eeDMFT (BaseElScatteringMatrix &matrix, const Context &context, BaseBandStructure &outerBandStructure, std::shared_ptr< VectorBTE > linewidth)
 

Additional Inherited Members

- Static Public Member Functions inherited from ScatteringMatrix
static void symmetrizeCoupling (Eigen::Tensor< double, 3 > &coupling, const Eigen::VectorXd &energies1, const Eigen::VectorXd &energies2, const Eigen::VectorXd &energies3)
 Average the coupling for degenerate states. More...
 

Detailed Description

The most important part is the assembly of the electron-phonon scattering. We also include boundary scattering effects.

Constructor & Destructor Documentation

◆ ElScatteringMatrix()

ElScatteringMatrix::ElScatteringMatrix ( Context context_,
StatisticsSweep statisticsSweep_,
BaseBandStructure innerBandStructure_,
BaseBandStructure outerBandStructure_,
PhononH0 h0 
)
Parameters
context_object with user parameters for this calculation
statisticsSweep_object with values for temperature and chemical potential
innerBandStructure_this is the band structure used for the integration of lifetimes/scattering rates
outerBandStructure_this is the band structure used to define on which points to compute the lifetimes/scattering rates. For transport properties outer=inner, but may differ e.g. when computing lifetimes on a path
h0phonon hamiltonian used to compute phonon energies and eigenvectors.

Member Function Documentation

◆ builder()

void ElScatteringMatrix::builder ( std::shared_ptr< VectorBTE linewidth,
std::vector< VectorBTE > &  inPopulations,
std::vector< VectorBTE > &  outPopulations 
)
overrideprotectedvirtual

Note: this function is computing the symmetrized scattering matrix $\tilde{\Omega}$. As a result, only use this with the appropriately symmetrized BTE

Parameters
linewidth
inPopulations
outPopulations

Implements ScatteringMatrix.

Here is the call graph for this function: