19 #include <boost/python.hpp>
21 #include "liblibra_core.h"
23 using namespace boost::python;
25 using namespace liblibra;
26 using namespace liblibra::libutil;
27 using namespace liblibra::liblinalg;
28 using namespace liblibra::libmeigen;
56 vector< complex<double> > coeff;
59 MO(){ npw = 0; energy = 0.0; gweight = 0.0; fweight = 0.0; }
62 energy = 0.0; gweight = 0.0; fweight = 0.0;
63 coeff = vector<complex<double> >(npw,complex<double>(0.0,0.0));
69 ~
MO(){
if(coeff.size()>0){ coeff.clear(); } npw = 0; }
75 void operator+=(
MO ob);
76 void operator-=(
MO ob);
77 MO operator/(
double num);
78 MO operator/(complex<double> num);
87 friend MO operator*(
const double& f,
const MO& m1);
88 friend MO operator*(
const MO& m1,
const double &f);
89 friend MO operator*(
const float& f,
const MO& m1);
90 friend MO operator*(
const MO& m1,
const float &f);
91 friend MO operator*(
const complex<double>& f,
const MO& m1);
92 friend MO operator*(
const MO& m1,
const complex<double> &f);
93 friend MO operator*(
const complex<float>& f,
const MO& m1);
94 friend MO operator*(
const MO& m1,
const complex<float> &f);
96 friend complex<double> operator*(
const MO& m1,
const MO& m2);
111 K_point(){ nbands = 0; npw = 0; kx = ky = kz = 0; }
112 K_point(
int _nbnds){ nbands = _nbnds; npw = 0; kx = ky = kz = 0; mo = vector<MO>(nbands,
MO()); }
113 K_point(
int _nbnds,
int _npw){ nbands = _nbnds; npw = _npw; kx = ky = kz = 0; mo = vector<MO>(nbands,
MO(npw)); }
120 ~
K_point(){
if(mo.size()>0){ mo.clear(); } nbands = 0; npw = 0; }
125 void transform(CMATRIX&);
131 void aux_line2vec(
string line,vector<double>& a);
142 std::string cell_units;
143 std::string energy_units;
144 vector<double> a1,a2,a3;
145 vector<double> b1,b2,b3;
152 vector<K_point> kpts;
153 vector<vector<int> > grid;
158 wfc(){ nkpts = 0; nbands = 0; npw = 0; is_allocated = 0; }
159 wfc(
int _nkpts){ nkpts = _nkpts; nbands = 0; npw = 0; kpts = vector<K_point>(nkpts,
K_point()); is_allocated = 1; }
160 wfc(
int _nkpts,
int _nbnds){ nkpts = _nkpts; nbands = _nbnds; npw = 0; kpts = vector<K_point>(nkpts,
K_point(nbands)); is_allocated = 2; }
161 wfc(
int _nkpts,
int _nbnds,
int _npw){nkpts = _nkpts; nbands = _nbnds; npw = _npw; kpts = vector<K_point>(nkpts,
K_point(nbands,npw)); is_allocated = 3; }
162 wfc(
wfc& wfc1,
int min1,
int max1,
wfc& wfc2,
int min2,
int max2);
165 ~
wfc(){
if(kpts.size()>0){ kpts.clear(); }
if(grid.size()>0){ grid.clear();} nkpts = 0; nbands = 0; npw = 0; is_allocated = 0; }
172 void QE_read_binary_wfc(std::string filename,
int,
int,
int);
173 void QE_read_acsii_wfc(std::string filename);
174 void QE_read_acsii_grid(std::string filename);
175 void QE_read_acsii_index(std::string filename);
180 void transform(
int k,CMATRIX&);
181 void restore(
int k1,
int do_complete);
182 void set_latt_vectors(boost::python::list);
183 void set_reci_vectors(boost::python::list);
184 void compute_Hprime(
int minband,
int maxband,std::string filename);
189 void overlap(
wfc& wfc1,
int k1,
int minband,
int maxband,std::string filename);
190 void pw_energy(
wfc& wfc1,
int k,
int minband,
int maxband,std::string filename);
191 void nac(
wfc& wfc1,
wfc& wfc2,
int k1,
int k2,
int minband,
int maxband,
double dt,std::string filename);
192 void ham(
wfc& wfc1,
wfc& wfc2,
int k1,
int k2,
int minband,
int maxband,
double dt,std::string filename);