|
| | 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< VectorBTE > | offDiagonalDot (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< VectorBTE > | dot (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, CartIndex > | getSMatrixIndex (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...
|
| |
|
| virtual void | builder (std::shared_ptr< VectorBTE > linewidth, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations)=0 |
| | Method that actually computes the scattering matrix. More...
|
| |
| 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...
|
| |
Note: this is an abstract class, which can only work if builder() is defined
| std::vector< std::tuple< std::vector< int >, int > > ScatteringMatrix::getIteratorWavevectorPairs |
( |
const bool & |
rowMajor = false | ) |
|
|
protected |
- Parameters
-
| rowMajor | set to true if the loop is in the form for iq1 { for iq2 {...}}. False for the opposite (default). |
- Returns
- vector<tuple<iq1,iq2>>: a tuple of wavevector indices to loop over in the construction of the scattering matrix.
Implementation: note that ph and el scattering are implemented differently. In detail, ph is computed as (for iq2) {(for iq1)}. instead el is computed as (for ik1) {(for ik2)}. where index1 is computed over irreducible points and iq2 over reducible points. Therefore, we have to distinguish the two cases (they're inverted). Also, we distinguish the case of matrix in memory or not. For scattering matrix in memory, we parallelize over the matrix elements owned by an MPI process. Otherwise, we trivially parallelize over the outer loop on points.
Note that the definition of linewidths is slightly different between electrons and phonons. For phonons, linewidths satisfy the relation Gamma * Tau = hBar (in atomic units, Gamma * Tau = 1). This Tau is the same Tau that enters the Boltzmann equation, and Gamma/Tau are related to the scattering operator as A_{ii} = n_i(n_i+1) / tau_i = n_i(n_i+1) * Gamma_i
For electrons, we are using a modified definition A_{ii} = f_i(1-f_i) / tau_i = Gamma_i where Gamma_i is the imaginary part of the self-energy, and Tau is the transport relaxation time that enters the transport equations, and satisfy the relation Gamma_i * Tau_i = f_i * (1-f_i)
Regardless, this function just returns Gamma
- Parameters
-
| anyInteralDiagonal | : vector bte or pointer to vector BTE |
- Returns
- linewidths: a VectorBTE object storing the linewidths
If no symmetries are used, the output is equal to the BteIndex.
- Parameters
-
| bteIndex | BteIndex for a Bloch state entering the BTE |
| cartIndex | CartIndex for a cartesian direction |
- Returns
- sMatrixIndex: and index identifying the scattering matrix row/col.
Note: when symmetries are used, the scattering matrix has indices (i,j) where i,j = (BteIndex,CartIndex) combined together, where CartIndex is an index on cartesian directions, and BteIndex an index on the Bloch states entering the Boltzmann equation.
| std::tuple< BteIndex, CartIndex > ScatteringMatrix::getSMatrixIndex |
( |
const int & |
iMat | ) |
|
If no symmetries are used, the output is equal to the BteIndex and CartIndex is set to 0. It is suggested to skip this function if symmetries are NOT used.
- Parameters
-
| bteIndex | BteIndex for a Bloch state entering the BTE |
| cartIndex | CartIndex for a cartesian direction |
- Returns
- sMatrixIndex: and index identifying the scattering matrix row/col.
Note: when symmetries are used, the scattering matrix has indices (i,j) where i,j = (BteIndex,CartIndex) combined together, where CartIndex is an index on cartesian directions, and BteIndex an index on the Bloch states entering the Boltzmann equation.