JDFTx  1.2.0
ElectronScattering.h
1 /*-------------------------------------------------------------------
2 Copyright 2015 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_ELECTRONIC_ELECTRONSCATTERING_H
21 #define JDFTX_ELECTRONIC_ELECTRONSCATTERING_H
22 
23 #include <electronic/common.h>
24 #include <electronic/Basis.h>
25 #include <electronic/ColumnBundle.h>
26 #include <core/LatticeUtils.h>
27 #include <vector>
28 
30 {
31  double eta;
32  double Ecut;
33  double fCut;
34  double omegaMax;
35 
37  void dump(const Everything& e);
38 
39 private:
40  const Everything* e;
41  int nBands, nSpinor;
42  double Emin, Emax;
43  std::vector<ColumnBundle> C; //wavefunctions, made available on all processes
44  std::vector<diagMatrix> E, F; //energies and fillings, available on all processes
45  std::shared_ptr<const Supercell> supercell; //contains transformations between full and reduced k-mesh
46  std::shared_ptr<const PeriodicLookup< vector3<> > > plook; //O(1) lookup for finding k-points in mesh
47  std::vector<QuantumNumber> qmesh; //reduced momentum-transfer mesh
48  std::vector<Basis> basisChi; //polarizability bases for qmesh
49  Basis basis; //common wavefunction basis
50  std::map< vector3<int>, std::shared_ptr<class ColumnBundleTransform> > transform; //k-mesh transformations
51  std::map< vector3<int>, QuantumNumber > qnumMesh; //equivalent of eInfo.qnums for entire k-mesh
52 
53  struct Event
54  { int i, j; //band indices
55  double fWeight; //relevant fillings combination ( (fi - fj)/2 or (1-fi-fj) for chiMode = true or false )
56  double Eji; //Ej - Ei
57  };
58 
59  struct CEDA
60  { diagMatrix Fsum, FEsum;
61  std::vector<diagMatrix> FNLsum;
62  std::vector<diagMatrix> oNum, oDen;
63 
64  CEDA(int nBands, int nbasis);
65  void collect(const ElectronScattering& es, int iq, const diagMatrix& chiKS0, diagMatrix& num, diagMatrix& den);
66  };
67  friend struct CEDA;
68 
69  std::vector<Event> getEvents(
70  bool chiMode,
71  size_t ik,
72  size_t iq,
73  size_t& jk,
74  matrix& nij,
75  CEDA* ceda = 0
76  ) const;
77 
78  ColumnBundle getWfns(size_t ik, const vector3<>& k) const; //get wavefunctions at an arbitrary point in k-mesh
79  matrix coulombMatrix(size_t iq) const; //retrieve the Coulomb operator for a specific momentum transfer
80 };
81 
82 #endif //JDFTX_ELECTRONIC_ELECTRONSCATTERING_H
double fCut
threshold for considering states fully occupied / unoccupied (default: 1e-6)
Definition: ElectronScattering.h:33
General complex matrix.
Definition: matrix.h:58
Real diagonal matrix.
Definition: matrix.h:31
Definition: ElecInfo.h:35
Definition: ElectronScattering.h:29
Definition: Basis.h:29
void dump(const Everything &e)
compute and dump Im(Sigma_ee) for each eigenstate
double eta
frequency resolution and half the imaginary part ascribed to probe frequency (set to eInfo...
Definition: ElectronScattering.h:31
double Ecut
energy cut-off for dielectric matrices (set to cntrl.Ecut if unspecified)
Definition: ElectronScattering.h:32
Definition: Everything.h:41
Definition: ColumnBundle.h:30
double omegaMax
maximum energy transfer to account for and hence maximum frequency in dielectric grid (if zero...
Definition: ElectronScattering.h:34