Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
coupled_scattering_matrix.h
1 #ifndef COUPLED_SCATTERING_MATRIX_H
2 #define COUPLED_SCATTERING_MATRIX_H
3 
4 #include "electron_h0_wannier.h"
5 #include "phonon_h0.h"
6 #include "base_el_scattering_matrix.h"
7 #include "base_ph_scattering_matrix.h"
8 #include "coupled_vector_bte.h"
9 
21  virtual public BasePhScatteringMatrix {
22 
23  public:
24 
25 // TODO update all these comments
26 
46  CoupledScatteringMatrix(Context &context_, StatisticsSweep &statisticsSweep_,
47  BaseBandStructure &innerBandStructure_,
48  BaseBandStructure &outerBandStructure_,
49  ElectronH0Wannier *electronH0_ = nullptr,
50  PhononH0 *phononH0_ = nullptr);
51 
52  // TODO we will need to override the simple scattering matrix version of this function
53  // as this one will need to behave differently than the others.
54  // we may want to output each kind of linewidths, etc, for testing?
58  //void outputToJSON(const std::string &outFileName);
59 
60  // TODO check on the functions that symmetrize this matrix's components
61 
63  BaseBandStructure* getElBandStructure();
64 
65  protected:
66 
67  ElectronH0Wannier *electronH0;
68  PhononH0 *phononH0;
69 
70  //int numElStates;
71  int numPhStates;
72 
77  void phononOnlyA2Omega();
78 
79 // TODO can we remove entirely this linewidth thing? it's inconvenient
80  // implementation of the scattering matrix
81  void builder(std::shared_ptr<VectorBTE> linewidth,
82  std::vector<VectorBTE> &inPopulations,
83  std::vector<VectorBTE> &outPopulations);
84 
90  int bteStateToWavevector(BteIndex& iMat, BaseBandStructure& bandStructure);
91 
102  std::vector<std::vector<std::tuple<std::vector<int>, int>>>
103  getIteratorWavevectorPairs(const bool &rowMajor = 0);
104 
107  //void reweightQuadrants();
108 
109  // friend functions for adding scattering rates
110  // see respective header files for more details
111  friend void addPhPhScattering(BasePhScatteringMatrix &matrix, Context &context,
112  std::vector<VectorBTE> &inPopulations,
113  std::vector<VectorBTE> &outPopulations,
114  std::vector<std::tuple<std::vector<int>, int>> qPairIterator,
115  Eigen::MatrixXd &innerBose, Eigen::MatrixXd &outerBose,
116  BaseBandStructure &innerBandStructure,
117  BaseBandStructure &outerBandStructure,
118  PhononH0* phononH0,
119  Interaction3Ph &coupling3Ph,
120  VectorBTE *linewidth);
121 
122  friend void addIsotopeScattering(BasePhScatteringMatrix &matrix, Context &context,
123  std::vector<VectorBTE> &inPopulations,
124  std::vector<VectorBTE> &outPopulations,
125  std::vector<std::tuple<std::vector<int>, int>> qPairIterator,
126  Eigen::MatrixXd &innerBose, Eigen::MatrixXd &outerBose,
127  BaseBandStructure &innerBandStructure,
128  BaseBandStructure &outerBandStructure,
129  VectorBTE *linewidth);
130 
131  friend void addPhElScattering(BasePhScatteringMatrix &matrix, Context &context,
132  std::vector<VectorBTE> &inPopulations,
133  std::vector<VectorBTE> &outPopulations,
134  BaseBandStructure &phBandStructure,
135  BaseBandStructure &elBandStructure,
136  StatisticsSweep& statisticsSweep,
137  InteractionElPhWan &couplingElPhWan,
138  std::shared_ptr<VectorBTE> linewidth);
139 
140  friend void addElPhScattering(BaseElScatteringMatrix &matrix, Context &context,
141  std::vector<VectorBTE> &inPopulations,
142  std::vector<VectorBTE> &outPopulations,
143  std::vector<std::tuple<std::vector<int>, int>> kPairIterator,
144  Eigen::MatrixXd &innerFermi, Eigen::MatrixXd &outerBose,
145  BaseBandStructure &innerBandStructure,
146  BaseBandStructure &outerBandStructure,
147  PhononH0 &phononH0,
148  InteractionElPhWan &couplingElPhWan,
149  VectorBTE *linewidth);
150 
151  friend void addChargedImpurityScattering(BaseElScatteringMatrix &matrix, Context &context,
152  std::vector<VectorBTE> &inPopulations,
153  std::vector<VectorBTE> &outPopulations,
154  std::vector<std::tuple<std::vector<int>, int>> kPairIterator,
155  BaseBandStructure &innerBandStructure,
156  BaseBandStructure &outerBandStructure,
157  std::shared_ptr<VectorBTE> linewidth);
158 
159  friend void addDragTerm(CoupledScatteringMatrix &matrix, Context &context,
160  std::vector<std::tuple<std::vector<int>, int>> kqPairIterator,
161  const int& dragTermType,
162  InteractionElPhWan &couplingElPhWan,
163  BaseBandStructure &innerBandStructure,
164  BaseBandStructure &outerBandStructure);
165 
166  friend void phononElectronAcousticSumRule(CoupledScatteringMatrix &matrix,
167  Context& context,
168  BaseBandStructure& elBandStructure,
169  BaseBandStructure& phBandStructure);
170 };
171 
172 #endif
Base class for describing objects containing the band structure, i.e.
Definition: bandstructure.h:15
class representing the electron scattering matrix.
Definition: base_el_scattering_matrix.h:14
class representing the phonon scattering matrix.
Definition: base_ph_scattering_matrix.h:16
Class containing the user input variables.
Definition: context.h:15
class representing the combined scattering matrix.
Definition: coupled_scattering_matrix.h:21
void builder(std::shared_ptr< VectorBTE > linewidth, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations)
Method that actually computes the scattering matrix.
Definition: coupled_scattering_matrix.cpp:98
friend void addPhPhScattering(BasePhScatteringMatrix &matrix, Context &context, std::vector< VectorBTE > &inPopulations, std::vector< VectorBTE > &outPopulations, std::vector< std::tuple< std::vector< int >, int >> qPairIterator, Eigen::MatrixXd &innerBose, Eigen::MatrixXd &outerBose, BaseBandStructure &innerBandStructure, BaseBandStructure &outerBandStructure, PhononH0 *phononH0, Interaction3Ph &coupling3Ph, VectorBTE *linewidth)
Function to reweight the different quadrants of the matrix coupled matrix to account for spin dengene...
CoupledScatteringMatrix(Context &context_, StatisticsSweep &statisticsSweep_, BaseBandStructure &innerBandStructure_, BaseBandStructure &outerBandStructure_, ElectronH0Wannier *electronH0_=nullptr, PhononH0 *phononH0_=nullptr)
Default constructor.
Definition: coupled_scattering_matrix.cpp:16
void phononOnlyA2Omega()
convert the phonon part of the coupled scattering matrix to Omega format.
Definition: coupled_scattering_matrix.cpp:394
BaseBandStructure * getPhBandStructure()
Outputs the quantity to a json file.
Definition: coupled_scattering_matrix.cpp:671
int bteStateToWavevector(BteIndex &iMat, BaseBandStructure &bandStructure)
A function to get the wavevector index given the index of an element of theMatrix.
Definition: coupled_scattering_matrix.cpp:462
std::vector< std::vector< std::tuple< std::vector< int >, int > > > getIteratorWavevectorPairs(const bool &rowMajor=0)
A function to generate the wavevector index pairs for which scattering rates are computed.
Definition: coupled_scattering_matrix.cpp:508
Class for diagonalizing electronic energies with the Wannier interpolation The object is built passin...
Definition: electron_h0_wannier.h:17
Class to calculate the probability rate for one 3-phonon scattering event.
Definition: interaction_3ph.h:47
Class to handle the coupling between electron and phonons.
Definition: interaction_elph.h:30
Class for implementing strong typing.
Definition: utilities.h:51
class that computes phonon energies, velocities and eigenvectors.
Definition: phonon_h0.h:21
Object for controlling the loop over temperatures and chemical potentials.
Definition: statistics_sweep.h:26
Class used to store the "vector" of out-of-equilibrium populations.
Definition: vector_bte.h:16