Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
interaction_3ph.h
1 #ifndef PH_INTERACTION_H
2 #define PH_INTERACTION_H
3 
4 #include <chrono>
5 #include <cmath>
6 #include <complex>
7 #include <iomanip>
8 
9 #include "common_kokkos.h"
10 #include "constants.h"
11 #include "crystal.h"
12 #include "eigen.h"
13 #include "points.h"
14 #include "utilities.h"
15 
48 private:
49  Crystal &crystal_;
50 
51  // variables to be saved on the GPU
52  DoubleView5D D3_k;
53  ComplexView4D D3PlusCached_k, D3MinsCached_k;
54  DoubleView2D cellPositions2_k, cellPositions3_k;
55  DoubleView3D weights2_k, weights3_k;
56 
57  // dimensions
58  int nr2, nr3, numAtoms, numBands;
59 
65  double getDeviceMemoryUsage();
66 
67 public:
68 
92  Interaction3Ph(Crystal &crystal, Eigen::Tensor<double, 5> &D3,
93  Eigen::MatrixXd &cellPositions2,
94  Eigen::MatrixXd &cellPositions3,
95  Eigen::Tensor<double,3> &weights2,
96  Eigen::Tensor<double,3> &weights3);
97 
100  Interaction3Ph(const Interaction3Ph &that);
101 
105 
108  ~Interaction3Ph();
109 
128  std::tuple<std::vector<Eigen::Tensor<double, 3>>,
129  std::vector<Eigen::Tensor<double, 3>>>
130  getCouplingsSquared(const std::vector<Eigen::Vector3d> &q1s_e,
131  const Eigen::Vector3d &q2_e,
132  const std::vector<Eigen::MatrixXcd> &ev1s_e,
133  const Eigen::MatrixXcd &ev2_e,
134  const std::vector<Eigen::MatrixXcd> &ev3Pluss_e,
135  const std::vector<Eigen::MatrixXcd> &ev3Minss_e,
136  const std::vector<int> &nb1s_e, const int nb2,
137  const std::vector<int> &nb3Pluss_e,
138  std::vector<int> &nb3Minss_e);
139 
144  void cacheD3(const Eigen::Vector3d &q2_e);
145 
152  int estimateNumBatches(const int &nq1, const int &nb2);
153 };
154 
155 #endif
Object to store the information on the crystal unit cell, such as atomic positions,...
Definition: crystal.h:18
Class to calculate the probability rate for one 3-phonon scattering event.
Definition: interaction_3ph.h:47
~Interaction3Ph()
Destructor.
Definition: interaction_3ph.cpp:88
int estimateNumBatches(const int &nq1, const int &nb2)
Estimate the number of batches that the list of q1 wavevectors must be split into,...
Definition: interaction_3ph.cpp:407
void cacheD3(const Eigen::Vector3d &q2_e)
Computes a partial Fourier transform over the q2/R2 variables.
Definition: interaction_3ph.cpp:100
Interaction3Ph & operator=(const Interaction3Ph &that)
Assignment operator.
Definition: interaction_3ph.cpp:77
std::tuple< std::vector< Eigen::Tensor< double, 3 > >, std::vector< Eigen::Tensor< double, 3 > > > getCouplingsSquared(const std::vector< Eigen::Vector3d > &q1s_e, const Eigen::Vector3d &q2_e, const std::vector< Eigen::MatrixXcd > &ev1s_e, const Eigen::MatrixXcd &ev2_e, const std::vector< Eigen::MatrixXcd > &ev3Pluss_e, const std::vector< Eigen::MatrixXcd > &ev3Minss_e, const std::vector< int > &nb1s_e, const int nb2, const std::vector< int > &nb3Pluss_e, std::vector< int > &nb3Minss_e)
Computes the |V3|^2 matrix elements for a bunch of q1 wavevectors at fixed q2 wavevector.
Definition: interaction_3ph.cpp:179
Interaction3Ph(Crystal &crystal, Eigen::Tensor< double, 5 > &D3, Eigen::MatrixXd &cellPositions2, Eigen::MatrixXd &cellPositions3, Eigen::Tensor< double, 3 > &weights2, Eigen::Tensor< double, 3 > &weights3)
Default constructor.
Definition: interaction_3ph.cpp:5