1#ifndef GREEN_PROPAGATOR
2#define GREEN_PROPAGATOR
4#ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
5#include "SuperQuadrator.h"
12#include "IntervalIterator.h"
13#include "ComplexInterpolGSL.h"
15#ifdef GREENPROPAGATOR_USE_HDF5
16#include "HDF5Interface.h"
19#include <unsupported/Eigen/FFT>
20#include "gsl_integration.h"
21#include "ooura_integration.h"
32 if (GI==
DIRECT) {s <<
"DIRECT";}
33 else if (GI==
INTERP) {s <<
"INTERP";}
34 else if (GI==
OOURA ) {s <<
"OOURA" ;}
45 static double gauss (
double tval) {
return exp(-pow(2.*tval/
tmax,2));};
46 static double lorentz (
double tval) {
return exp(-4.*tval/
tmax);};
51VectorXcd
FT_interpol (
const VectorXd &tvals,
const VectorXcd &fvals,
bool USE_QAWO,
double wmin,
double wmax,
int wpoints)
53 VectorXcd res(wpoints);
55 IntervalIterator w(wmin,wmax,wpoints);
56 for (w=w.begin(); w!=w.end(); ++w)
59 ComplexInterpol Interp(tvals);
61 for (
int it=0; it<tvals.rows(); ++it)
63 double tval = tvals(it);
64 complex<double> Gval = (USE_QAWO)? fvals(it) : exp(+1.i*wval*tval) * fvals(it);
65 Interp.insert(it,Gval);
71 gsl_function_pp FpRe([=](
double t)->
double{
return Interp.quick_evaluateRe(t);});
72 gsl_function_pp FpIm([=](
double t)->
double{
return Interp.quick_evaluateIm(t);});
73 gsl_function * FRe =
static_cast<gsl_function*
>(&FpRe);
74 gsl_function * FIm =
static_cast<gsl_function*
>(&FpIm);
76 res(w.index()) = fouriergrate(*FRe, *FIm, tvals(0),tvals(tvals.rows()-1), 1e-5,1e-5, wval);
80 res(w.index()) = Interp.integrate();
82 Interp.kill_splines();
107 #ifdef GREENPROPAGATOR_USE_HDF5
108 HDF5Interface target(label+
".log.h5",WRITE);
109 target.save_matrix(
Entropy,
"Entropy",
"");
110 target.save_matrix(
DeltaS,
"DeltaS",
"");
111 target.save_matrix(
VarE,
"VarE",
"");
112 target.save_matrix(
TwoSite,
"TwoSite",
"");
113 target.save_matrix(
dimK2avg,
"dimK2avg",
"");
114 target.save_matrix(
dimK1avg,
"dimK1avg",
"");
115 target.save_matrix(
dimK0avg,
"dimK0avg",
"");
116 target.save_matrix(
dur_tstep,
"dur_tstep",
"");
117 target.save_matrix(
taxis,
"taxis",
"");
126template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
146 double tmax_input,
int Nt_input,
148 double wmin_input=-10.,
double wmax_input=10.,
int Nw_input=501,
151 :
label(label_input),
tmax(tmax_input),
Nt(Nt_input),
153 wmin(wmin_input),
wmax(wmax_input),
Nw(Nw_input),
157 #ifndef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
185 #ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
215 GreenPropagator (
string label_input,
int Lcell_input,
int Ncells_input,
int Ns_input,
double tmax_input,
const vector<vector<MatrixXcd>> &Gtx_input,
221 for (
int i=0; i<
Lcell; ++i)
222 for (
int j=0; j<
Lcell; ++j)
224 GtxCell[i][j] = Gtx_input[i][j];
227 #ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
241 for (
int i=0; i<
Lcell; ++i)
242 for (
int n=0; n<
Ncells; ++n)
321 GreenPropagator (
string label_input,
int Lcell_input,
int Ncells_input,
int Ns_input,
double tmax_input,
const vector<string> &files,
326 #ifdef GREENPROPAGATOR_USE_HDF5
327 for (
const auto &file:files)
328 for (
int i=0; i<
Lcell; ++i)
329 for (
int j=0; j<
Lcell; ++j)
331 MatrixXd MtmpRe, MtmpIm;
332 HDF5Interface Reader(file+
".h5",READ);
333 string Gstring = (i<10 and j<10)?make_string(
"G",i,j):make_string(
"G",i,
"_",j);
334 Reader.load_matrix(MtmpRe,
"txRe",Gstring);
335 Reader.load_matrix(MtmpIm,
"txIm",Gstring);
340 GtxCell[i][j] = MtmpRe+1.i*MtmpIm;
344 GtxCell[i][j] += MtmpRe+1.i*MtmpIm;
349 #ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
363 for (
int i=0; i<
Lcell; ++i)
364 for (
int n=0; n<
Ncells; ++n)
397 void compute_cell (
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiBra,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiKet,
398 double Eg,
bool TIME_FORWARDS =
true,
bool COUNTERPROPAGATE =
true,
int x0=0);
413 void recalc_FTw (
double wmin_new,
double wmax_new,
int Nw_new=501);
415 void recalc_FTwCell (
double wmin_new,
double wmax_new,
int Nw_new=501,
bool TRANSPOSE=
false);
425 string measure_name_input=
"M",
string measure_subfolder_input=
".")
435 void save (
bool IGNORE_TX =
false)
const;
467 ArrayXcd
FTloc_tw (
const VectorXcd &
Gloct,
const ArrayXd &wvals);
474 string xinfo()
const;
475 string qinfo()
const;
476 string tinfo()
const;
477 string winfo()
const;
484 double mu = std::nan(
"0");
522 #ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
523 SuperQuadrator<GAUSS_LEGENDRE> TimeIntegrator;
549 void calc_Green (
const int &tindex,
const complex<double> &phase,
550 const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
const Mps<Symmetry,complex<double>> &Psi);
552 void calc_GreenCell (
const int &tindex,
const complex<double> &phase,
553 const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
const vector<
Mps<Symmetry,complex<double>>> &Psi,
int x0=0);
555 void calc_GreenCell (
const int &tindex,
const complex<double> &phase,
556 const std::array<vector<
Mps<Symmetry,complex<double>>>,2> &Psi);
559 const Mps<Symmetry,complex<double>> &Phi,
const Mps<Symmetry,complex<double>> &Psi);
564 void make_xarrays (
int Lhetero_input,
int Lcell_input,
int Ncells_input,
int Ns=1,
bool PRINT=
false);
571 void counterpropagate_cell (
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiBra,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiKet,
double Eg,
bool TIME_FORWARDS=
true);
595 void save_log (
int i,
int tindex,
double tval,
const Mps<Symmetry,complex<double>> &Psi,
596 const TDVPPropagator<Hamiltonian,Symmetry,MpoScalar,TimeScalar,
Mps<Symmetry,complex<double>>> &TDVP,
598 const vector<bool> &TWO_SITE);
940template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
942compute_cell (
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiBra,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiKet,
double Eg,
bool TIME_FORWARDS,
bool COUNTERPROPAGATE,
int x0)
946 if (!OxPhiKet[0].Boundaries.IS_TRIVIAL())
948 Lcell = OxPhiKet.size();
949 Lhetero = H.length();
950 Ncells = Lhetero/Lcell;
954 Lhetero = H.length();
955 Ncells = Lhetero/Lcell;
957 lout <<
"Lcell=" << Lcell <<
", Lhetero=" << Lhetero <<
", Ncells=" << Ncells <<
", Ns=" << Ns << endl;
959 assert(Lhetero%Lcell == 0);
962 make_xarrays(Lhetero,Lcell,Ncells,Ns);
964 GtxCell.resize(Lcell);
965 for (
int i=0; i<Lcell; ++i)
967 GtxCell[i].resize(Lcell);
969 for (
int i=0; i<Lcell; ++i)
970 for (
int j=0; j<Lcell; ++j)
972 GtxCell[i][j].resize(Nt,Ncells);
973 GtxCell[i][j].setZero();
976 GloctCell.resize(Lcell);
977 for (
int i=0; i<Lcell; ++i)
979 GloctCell[i].resize(Nt);
980 GloctCell[i].setZero();
983 if (OxPhiKet[0].Boundaries.IS_TRIVIAL() or COUNTERPROPAGATE ==
false)
987 lout << termcolor::blue << label <<
": using usual propagation algorithm, best with Lcell=" << Lcell <<
" threads" << termcolor::reset << endl;
989 lout << termcolor::blue <<
"current OMP threads=" << omp_get_max_threads() << termcolor::reset << endl;
992 propagate_cell(x0, H, OxPhiKet, Eg, TIME_FORWARDS);
998 lout << termcolor::blue << label <<
": using counterpropagation algorithm, best with 2*Lcell=" << 2*Lcell <<
" threads" << termcolor::reset << endl;
1000 lout << termcolor::blue <<
"current OMP threads=" << omp_get_max_threads() << termcolor::reset << endl;
1003 counterpropagate_cell(H, OxPhiBra, OxPhiKet, Eg, TIME_FORWARDS);
1009 FTcellww_xq((TIME_FORWARDS)?
false:
true);
1012template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1014propagate_cell (
int x0,
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
double Eg,
bool TIME_FORWARDS)
1016 double tsign = (TIME_FORWARDS==
true)? -1.:+1.;
1018 vector<Mps<Symmetry,complex<double>>> Psi(Lcell);
1019 for (
int i=0; i<Lcell; ++i)
1021 Psi[i] = OxPhi[x0+i];
1022 Psi[i].eps_truncWeight = tol_compr;
1023 Psi[i].max_Nsv = max(Psi[i].calc_Mmax(),lim_Nsv);
1026 vector<TDVPPropagator<Hamiltonian,Symmetry,MpoScalar,TimeScalar,Mps<Symmetry,complex<double>>>> TDVP(Lcell);
1027 for (
int i=0; i<Lcell; ++i)
1032 vector<EntropyObserver<Mps<Symmetry,complex<double>>>> Sobs(Lcell);
1033 vector<vector<bool>> TWO_SITE(Lcell);
1034 for (
int i=0; i<Lcell; ++i)
1038 TWO_SITE[i] = Sobs[i].
TWO_SITE(0, Psi[i], 1.);
1042 IntervalIterator t(0.,tmax,Nt);
1048 for (
int i=0; i<Lcell; ++i)
1050 measure_wavepacket(Psi[i],0,i);
1054 if (GREENINT_CHOICE !=
DIRECT)
1056 Stopwatch<> StepTimer;
1057 calc_GreenCell(0, -1.i*exp(-1.i*tsign*Eg*tval), OxPhi, Psi, x0);
1060 lout << StepTimer.info(
"G(t,x) calculation") << endl;
1065 Stopwatch<> TpropTimer;
1066 for (t=t.begin(); t!=t.end(); ++t)
1068 Stopwatch<> StepTimer;
1071 #pragma omp parallel for
1072 for (
int i=0; i<Lcell; ++i)
1074 if (tsteps(t.index()) != 0.)
1077 TDVP[i].t_step_adaptive(H, Psi[i], 1.i*tsign*tsteps(t.index()), TWO_SITE[i], 1,tol_Lanczos);
1090 tval = tsteps.head(t.index()+1).sum();
1095 lout << TDVP[0].info() << endl;
1096 lout << Psi[0].info() << endl;
1097 lout << termcolor::blue <<
"propagated to: t=" << tval <<
", stepsize=" << tsteps(t.index()) <<
", step#" << t.index()+1 <<
"/" << Nt << termcolor::reset << endl;
1102 calc_GreenCell(t.index(), -1.i*exp(-1.i*tsign*Eg*tval), OxPhi, Psi, x0);
1105 if (Measure.size() != 0)
1107 #pragma omp parallel for
1108 for (
int i=0; i<Lcell; ++i)
1110 if ((t.index()-1)%measure_interval == 0 and t.index() > 1) measure_wavepacket(Psi[i],tval,i);
1116 #pragma omp parallel for
1117 for (
int i=0; i<Lcell; ++i)
1119 auto PsiTmp = Psi[i]; PsiTmp.entropy_skim();
1120 double r = (t.index()==0)? 1.:tsteps(t.index()-1)/tsteps(t.index());
1121 TWO_SITE[i] = Sobs[i].TWO_SITE(t.index(), PsiTmp, r);
1124 save_log(i,t.index(),tval,PsiTmp,TDVP[i],Sobs[i],TWO_SITE[i]);
1130 lout << TpropTimer.info(
"total running time",
false) << endl;
1136 if (Measure.size() != 0)
1138 #pragma omp parallel for
1139 for (
int i=0; i<Lcell; ++i)
1141 measure_wavepacket(Psi[i],tval,i);
1146template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1148compute_one (
int j0_input,
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
double Eg,
bool TIME_FORWARDS)
1151 assert(OxPhi[0].Boundaries.IS_TRIVIAL());
1154 Lcell = OxPhi.size();
1155 Lhetero = H.length();
1156 assert(OxPhi.size() == H.length());
1159 make_xarrays(Lhetero,Lcell,Ncells,Ns);
1161 Gtx.resize(Nt,Lhetero);
1167 propagate_one(j0, H, OxPhi, Eg, TIME_FORWARDS);
1169 FTxx_tw(Gtx, Gwx, G0x, Glocw);
1172template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1174propagate_one (
int j0,
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
double Eg,
bool TIME_FORWARDS)
1176 double tsign = (TIME_FORWARDS==
true)? -1.:+1.;
1187 vector<bool> TWO_SITE;
1190 TWO_SITE = Sobs.TWO_SITE(0, Psi, 1.);
1193 IntervalIterator t(0.,tmax,Nt);
1199 measure_wavepacket(Psi,0,0);
1202 if (GREENINT_CHOICE !=
DIRECT)
1204 Stopwatch<> StepTimer;
1205 calc_Green(0, -1.i*exp(-1.i*tsign*Eg*tval), OxPhi, Psi);
1208 lout << StepTimer.info(
"G(t,x) calculation") << endl;
1213 Stopwatch<> TpropTimer;
1214 for (t=t.begin(); t!=t.end(); ++t)
1216 Stopwatch<> StepTimer;
1219 if (tsteps(t.index()) != 0.)
1222 TDVP.
t_step_adaptive(H, Psi, 1.i*tsign*tsteps(t.index()), TWO_SITE, 1,tol_Lanczos);
1231 lout << termcolor::yellow <<
"Setting Psi.max_Nsv to " << Psi.
max_Nsv << termcolor::reset << endl;
1234 tval = tsteps.head(t.index()+1).sum();
1239 lout << TDVP.
info() << endl;
1240 lout << Psi.
info() << endl;
1241 lout << termcolor::blue <<
"propagated to: t=" << tval <<
", stepsize=" << tsteps(t.index()) <<
", step#" << t.index()+1 <<
"/" << Nt << termcolor::reset << endl;
1246 calc_Green(t.index(), -1.i*exp(-1.i*tsign*Eg*tval), OxPhi, Psi);
1249 if (Measure.size() != 0)
1251 if ((t.index()-1)%measure_interval == 0 and t.index() > 1) measure_wavepacket(Psi,tval,0);
1257 double r = (t.index()==0)? 1.:tsteps(t.index()-1)/tsteps(t.index());
1258 TWO_SITE = Sobs.TWO_SITE(t.index(), PsiTmp, r);
1261 save_log(0,t.index(),tval,PsiTmp,TDVP,Sobs,TWO_SITE);
1266 lout << TpropTimer.info(
"total running time",
false) << endl;
1272 if (Measure.size() != 0)
1274 measure_wavepacket(Psi,tval,0);
1278template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1280counterpropagate_cell (
const Hamiltonian &H,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiBra,
const vector<
Mps<Symmetry,complex<double>>> &OxPhiKet,
double Eg,
bool TIME_FORWARDS)
1282 double tsign = (TIME_FORWARDS==
true)? -1.:+1.;
1283 std::array<double,2> zfac;
1287 std::array<vector<Mps<Symmetry,complex<double>>>,2> Psi;
1288 for (
int z=0; z<2; ++z)
1290 Psi[z].resize(Lcell);
1291 for (
int i=0; i<Lcell; ++i)
1293 Psi[z][i] = (z==0)? OxPhiKet[i] : OxPhiBra[i];
1294 Psi[z][i].eps_truncWeight = tol_compr;
1295 Psi[z][i].max_Nsv = max(Psi[z][i].calc_Mmax(),lim_Nsv);
1299 std::array<vector<TDVPPropagator<Hamiltonian,Symmetry,MpoScalar,TimeScalar,Mps<Symmetry,complex<double>>>>,2> TDVP;
1300 for (
int z=0; z<2; ++z)
1302 TDVP[z].resize(Lcell);
1303 for (
int i=0; i<Lcell; ++i)
1308 std::array<vector<EntropyObserver<Mps<Symmetry,complex<double>>>>,2> Sobs;
1309 std::array<vector<vector<bool>>,2> TWO_SITE;
1310 for (
int z=0; z<2; ++z)
1312 Sobs[z].resize(Lcell);
1313 TWO_SITE[z].resize(Lcell);
1315 for (
int i=0; i<Lcell; ++i)
1319 TWO_SITE[z][i] = Sobs[z][i].
TWO_SITE(0, Psi[z][i]);
1324 IntervalIterator t(0.,tmax,Nt);
1330 if (Measure.size() != 0)
1332 for (
int i=0; i<Lcell; ++i)
1334 measure_wavepacket(Psi[0][i],0,i);
1339 if (GREENINT_CHOICE !=
DIRECT)
1341 Stopwatch<> StepTimer;
1343 calc_GreenCell(0, -1.i*exp(-1.i*tsign*Eg*tval), Psi);
1346 lout << StepTimer.info(
"G(t,x) calculation") << endl;
1351 Stopwatch<> TpropTimer;
1352 for (t=t.begin(); t!=t.end(); ++t)
1354 Stopwatch<> StepTimer;
1357 #pragma omp parallel for collapse(2)
1358 for (
int z=0; z<2; ++z)
1359 for (
int i=0; i<Lcell; ++i)
1361 if (tsteps(t.index()) != 0.)
1364 TDVP[z][i].t_step_adaptive(H, Psi[z][i], 0.5*1.i*zfac[z]*tsign*tsteps(t.index()), TWO_SITE[z][i], 1,tol_Lanczos);
1371 std::streamsize ss = std::cout.precision();
1372 lout <<
"δE=" << setprecision(4) << TDVP[z][i].get_deltaE().transpose() << setprecision(ss) << endl;
1386 tval = tsteps.head(t.index()+1).sum();
1391 lout << TDVP[0][0].info() << endl;
1392 lout << Psi[0][0].info() << endl;
1393 lout << termcolor::blue
1394 <<
"propagated to: t=0.5*" << tval <<
"=" << 0.5*tval
1395 <<
", stepsize=0.5*" << tsteps(t.index()) <<
"=" << 0.5*tsteps(t.index())
1396 <<
", step#" << t.index()+1 <<
"/" << Nt
1397 << termcolor::reset << endl;
1404 calc_GreenCell(t.index(), -1.i*exp(-1.i*tsign*Eg*tval), Psi);
1408 if (Measure.size() != 0)
1410 #pragma omp parallel for
1411 for (
int i=0; i<Lcell; ++i)
1413 if ((t.index()-1)%measure_interval == 0 and t.index() > 1)
1415 measure_wavepacket(Psi[0][i],0.5*tval,i);
1422 #pragma omp parallel for collapse(2)
1423 for (
int z=0; z<2; ++z)
1424 for (
int i=0; i<Lcell; ++i)
1426 auto PsiTmp = Psi[z][i]; PsiTmp.entropy_skim();
1427 double r = (t.index()==0)? 1.:tsteps(t.index()-1)/tsteps(t.index());
1430 TWO_SITE[z][i] = Sobs[z][i].TWO_SITE(t.index(), PsiTmp, r);
1434 if (z==0) save_log(i,t.index(),0.5*tval,PsiTmp,TDVP[z][i],Sobs[z][i],TWO_SITE[z][i]);
1440 lout << TpropTimer.info(
"total running time",
false) << endl;
1446 if (Measure.size() != 0)
1448 #pragma omp parallel for
1449 for (
int i=0; i<Lcell; ++i)
1451 measure_wavepacket(Psi[0][i],0.5*tval,i);
1456template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1459 vector<
Mps<Symmetry,complex<double>>> &OxPhi0,
bool TIME_FORWARDS)
1462 assert(H.volume()/H.length()==1 or H.volume()/H.length()==2);
1464 Lcell = OxPhi0.size();
1465 dLphys = (H.volume()/H.length()==2)? 1:2;
1466 Lhetero = (dLphys==1)? H.length():H.length()/2;
1467 Ncells = Lhetero/Lcell;
1470 assert(Lhetero%Lcell == 0);
1473 make_xarrays(Lhetero,Lcell,Ncells,Ns);
1475 GtxCell.resize(Lcell);
1476 for (
int i=0; i<Lcell; ++i)
1478 GtxCell[i].resize(Lcell);
1480 for (
int i=0; i<Lcell; ++i)
1481 for (
int j=0; j<Lcell; ++j)
1483 GtxCell[i][j].resize(Nt,Ncells);
1484 GtxCell[i][j].setZero();
1487 GloctCell.resize(Lcell);
1488 for (
int i=0; i<Lcell; ++i)
1490 GloctCell[i].resize(Nt);
1491 GloctCell[i].setZero();
1494 propagate_thermal_cell(H, Odag, Phi, OxPhi0, TIME_FORWARDS);
1499 FTcellww_xq((TIME_FORWARDS)?
false:
true);
1502template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1505 vector<
Mps<Symmetry,complex<double>>> &OxPhi0,
bool TIME_FORWARDS)
1507 double tsign = (TIME_FORWARDS==
true)? -1.:+1.;
1509 vector<Mps<Symmetry,complex<double>>> Psi(Lcell+1);
1510 for (
int i=0; i<Lcell+1; ++i)
1512 Psi[i] = (i==Lcell)? Phi : OxPhi0[i];
1513 Psi[i].eps_truncWeight = tol_compr;
1514 Psi[i].max_Nsv = max(Psi[i].calc_Mmax(),lim_Nsv);
1517 vector<TDVPPropagator<Hamiltonian,Symmetry,MpoScalar,TimeScalar,Mps<Symmetry,complex<double>>>> TDVP(Lcell+1);
1518 for (
int i=0; i<Lcell+1; ++i)
1527 vector<EntropyObserver<Mps<Symmetry,complex<double>>>> Sobs(Lcell+1);
1528 vector<vector<bool>> TWO_SITE(Lcell+1);
1529 for (
int i=0; i<Lcell+1; ++i)
1533 TWO_SITE[i] = Sobs[i].
TWO_SITE(0, Psi[i], 1.);
1537 IntervalIterator t(0.,tmax,Nt);
1543 for (
int i=0; i<Lcell; ++i)
1545 measure_wavepacket(Psi[i],0,i);
1549 if (GREENINT_CHOICE !=
DIRECT)
1551 Stopwatch<> StepTimer;
1552 calc_GreenCell_thermal(0, Odag, Psi);
1555 lout << StepTimer.info(
"G(t,x) calculation") << endl;
1560 Stopwatch<> TpropTimer;
1561 for (t=t.begin(); t!=t.end(); ++t)
1563 Stopwatch<> StepTimer;
1566 #pragma omp parallel for
1567 for (
int i=0; i<Lcell+1; ++i)
1570 if (tsteps(t.index()) != 0.)
1572 TDVP[i].t_step_adaptive(H, Psi[i], 1.i*tsign*tsteps(t.index()), TWO_SITE[i], 1,tol_Lanczos);
1585 tval = tsteps.head(t.index()+1).sum();
1590 lout <<
"KET: " << TDVP[0].info() << endl;
1591 lout <<
"KET: " << Psi[0].info() << endl;
1592 lout <<
"BRA: " << TDVP[Lcell].info() << endl;
1593 lout <<
"BRA: " << Psi[Lcell].info() << endl;
1594 lout << termcolor::blue
1595 <<
"propagated to: t=" << tval <<
", stepsize=" << tsteps(t.index()) <<
", step#" << t.index()+1 <<
"/" << Nt
1596 << termcolor::reset << endl;
1601 calc_GreenCell_thermal(t.index(), Odag, Psi);
1604 if (Measure.size() != 0)
1606 #pragma omp parallel for
1607 for (
int i=0; i<Lcell; ++i)
1609 if ((t.index()-1)%measure_interval == 0 and t.index() > 1) measure_wavepacket(Psi[i],tval,i);
1615 #pragma omp parallel for
1616 for (
int i=0; i<Lcell+1; ++i)
1618 auto PsiTmp = Psi[i]; PsiTmp.entropy_skim();
1619 double r = (t.index()==0)? 1.:tsteps(t.index()-1)/tsteps(t.index());
1620 TWO_SITE[i] = Sobs[i].TWO_SITE(t.index(), PsiTmp, r);
1622 lout << StepTimer.info(
"entropy calculation") << endl;
1624 save_log(i,t.index(),tval,PsiTmp,TDVP[i],Sobs[i],TWO_SITE[i]);
1630 lout << TpropTimer.info(
"total running time",
false) << endl;
1636 if (Measure.size() != 0)
1638 #pragma omp parallel for
1639 for (
int i=0; i<Lcell; ++i)
1641 measure_wavepacket(Psi[i],tval,i);
1678template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1680calc_Green (
const int &tindex,
const complex<double> &phase,
const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
const Mps<Symmetry,complex<double>> &Psi)
1683 if (OxPhiFull.size() > 0)
1687 #pragma omp parallel for
1688 for (
size_t l=0; l<Lhetero; ++l)
1690 Gtx(tindex,l) = phase *
dot(OxPhiFull[l], Psi);
1696 #pragma omp parallel for
1697 for (
size_t l=0; l<Lhetero; ++l)
1699 auto dotres =
dot_green(OxPhiFull[l], Psi);
1700 for (
size_t iQ=0; iQ<GtxQmulti.size(); ++iQ)
1702 GtxQmulti[iQ](tindex,l) = phase * dotres[iQ];
1710 #pragma omp parallel for
1711 for (
size_t l=0; l<Lhetero; ++l)
1713 Gtx(tindex,l) = phase *
dot_hetero(OxPhi[icell[l]], Psi, dcell[l]);
1717 for (
size_t l=0; l<Lhetero; ++l)
1723 Gloct(tindex) = Gtx(tindex,l);
1727 for (
size_t iQ=0; iQ<GtxQmulti.size(); ++iQ)
1729 GloctQmulti[iQ](tindex) = GtxQmulti[iQ](tindex,l);
1743template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1746 const complex<double> &phase,
1747 const vector<
Mps<Symmetry,complex<double>>> &OxPhi,
1748 const vector<
Mps<Symmetry,complex<double>>> &Psi,
1753 if (OxPhiFull.size() > 0)
1755 #pragma omp parallel for collapse(3)
1756 for (
size_t n=0; n<Ncells; ++n)
1757 for (
size_t i=0; i<Lcell; ++i)
1758 for (
size_t j=0; j<Lcell; ++j)
1760 GtxCell[i][j](tindex,n) = phase *
dot(OxPhiFull[n*Lcell+i], Psi[j]);
1771 #pragma omp parallel for collapse(3)
1772 for (
size_t i=0; i<Lcell; ++i)
1773 for (
size_t j=0; j<Lcell; ++j)
1774 for (
size_t n=0; n<Ncells; ++n)
1776 GtxCell[i][j](tindex,n) = phase *
dot_hetero(OxPhi[i], Psi[j], dcell[n*Lcell]);
1787 for (
size_t i=0; i<Lcell; ++i)
1788 for (
size_t n=0; n<Ncells; ++n)
1790 if (dcell[n*Lcell] == 0)
1792 GloctCell[i](tindex) = GtxCell[i][i](tindex,n);
1798template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1801 const complex<double> &phase,
1802 const std::array<vector<
Mps<Symmetry,complex<double>>>,2> &Psi)
1806 for (
size_t i=0; i<Lcell; ++i)
1807 for (
size_t j=0; j<Lcell; ++j)
1808 for (
size_t n=0; n<Ncells; ++n)
1810 GtxCell[i][j](tindex,n) = phase *
dot_hetero(Psi[1][i], Psi[0][j], dcell[n*Lcell]);
1817 for (
size_t i=0; i<Lcell; ++i)
1818 for (
size_t n=0; n<Ncells; ++n)
1820 if (dcell[n*Lcell] == 0)
1822 GloctCell[i](tindex) = GtxCell[i][i](tindex,n);
1827template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1831 for (
size_t i=0; i<Lcell+1; ++i) assert(Psi[i].Boundaries.IS_TRIVIAL());
1833 #pragma omp parallel for collapse(3)
1834 for (
size_t n=0; n<Ncells; ++n)
1835 for (
size_t i=0; i<Lcell; ++i)
1836 for (
size_t j=0; j<Lcell; ++j)
1842 GtxCell[i][j](tindex,n) = -1.i *
avg(Psi[Lcell], Odag[n*Lcell+i], Psi[j]);
1850 for (
size_t i=0; i<Lcell; ++i)
1851 for (
size_t n=0; n<Ncells; ++n)
1853 if (dcell[n*Lcell] == 0)
1855 GloctCell[i](tindex) = GtxCell[i][i](tindex,n);
1860template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1864 if (Measure.size() != 0)
1867 double norm = Psi.squaredNorm();
1868 ArrayXd res(Measure.size());
1870 #pragma omp parallel for
1871 for (
size_t l=0; l<Measure.size(); ++l)
1875 if (Psi.Boundaries.IS_TRIVIAL())
1893 Measurement[icell].conservativeResize(Measurement[icell].rows()+1, Measure.size());
1894 Measurement[icell].row(Measurement[icell].rows()-1) = res;
1898template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1900make_xarrays (
int Lhetero_input,
int Lcell_input,
int Ncells_input,
int Ns,
bool PRINT)
1902 xinds.resize(Lhetero_input);
1903 xvals.resize(Lhetero_input);
1905 iota(begin(xinds),end(xinds),0);
1907 int x0 = Lhetero_input/2;
1910 for (
int ix=0; ix<xinds.size(); ++ix)
1912 xvals[ix] =
static_cast<double>(xinds[ix]-x0);
1915 for (
int d=0; d<Ncells_input; ++d)
1916 for (
int i=0; i<Lcell_input; ++i)
1922 for (
int d=0; d<Ncells_input*Ns; ++d)
1923 for (
int i=0; i<Lcell_input/Ns; ++i)
1925 dcellFT.push_back(d);
1928 for (
int i=0; i<Lhetero_input; ++i)
1930 dcell[i] -= x0/Lcell_input;
1931 dcellFT[i] -= x0/Lcell_input*Ns;
1935 for (
int i=0; i<Lhetero; ++i)
1937 lout <<
"i=" << xinds[i] <<
", x=" << xvals[i] <<
", icell=" << icell[i] <<
", dcell=" << dcell[i] <<
", dcellFT=" << dcellFT[i] << endl;
1941template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1957template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1959save_log (
int i,
int tindex,
double tval,
const Mps<Symmetry,complex<double>> &Psi,
const TDVPPropagator<Hamiltonian,Symmetry,MpoScalar,TimeScalar,
Mps<Symmetry,complex<double>>> &TDVP,
const EntropyObserver<
Mps<Symmetry,complex<double>>> &Sobs,
const vector<bool> &TWO_SITE)
1963 log.Entropy.row(tindex) = Psi.entropy();
1964 log.VarE.row(tindex) = TDVP.get_deltaE();
1965 for (
int l=0; l<TWO_SITE.size(); ++l) log.TwoSite(tindex,l) = int(TWO_SITE[l]);
1966 log.DeltaS = Sobs.get_DeltaSb();
1967 log.taxis(tindex,0) = tval;
1968 log.dur_tstep(tindex,0) = TDVP.get_t_tot();
1970 log.dimK2avg(tindex,0) = 0;
1971 for (
int i=0; i<TDVP.get_dimK2_log().size(); ++i)
1973 log.dimK2avg(tindex,0) += double(TDVP.get_dimK2_log()[i])/TDVP.get_dimK2_log().size();
1976 log.dimK1avg(tindex,0) = 0;
1977 for (
int i=0; i<TDVP.get_dimK1_log().size(); ++i)
1979 log.dimK1avg(tindex,0) += double(TDVP.get_dimK1_log()[i])/TDVP.get_dimK1_log().size();
1982 log.dimK0avg(tindex,0) = 0;
1983 for (
int i=0; i<TDVP.get_dimK0_log().size(); ++i)
1985 log.dimK0avg(tindex,0) += double(TDVP.get_dimK0_log()[i])/TDVP.get_dimK0_log().size();
1988 log.save(make_string(label,
"_i=",i,
"_",xt_info()));
1992template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
1998 #ifdef GREENPROPAGATOR_USE_GAUSSIAN_QUADRATURE
1999 if (GREENINT_CHOICE ==
DIRECT)
2002 tvals = TimeIntegrator.get_abscissa();
2003 weights = TimeIntegrator.get_weights();
2004 tsteps = TimeIntegrator.get_steps();
2015 double erf2 = 0.995322265018952734162069256367252928610891797040060076738;
2016 double integral = 0.25*sqrt(M_PI)*erf2*tmax;
2017 double diff = abs(weights.sum()-integral);
2018 #pragma omp critical
2020 if (
diff < 1e-5) cout << termcolor::green;
2021 else if (diff < 1e-1 and diff >= 1e-5) cout << termcolor::yellow;
2022 else cout << termcolor::red;
2023 lout << setprecision(14)
2024 <<
"integration weight test: ∫w(t)dt=" << weights.sum()
2025 <<
", analytical=" << integral
2026 <<
", diff=" << abs(weights.sum()-integral)
2028 cout << termcolor::reset;
2036 double dt = tmax/Nt;
2040 for (
int i=0; i<Nt; ++i) tvals(i) = i*dt;
2042 weights.resize(Nt); weights = 1.;
2043 tsteps.resize(Nt); tsteps = dt; tsteps(0) = 0;
2048 #pragma omp critical
2050 lout << Watch.info(
"integration weights") << endl;
2096template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2100 IntervalIterator q(qmin,qmax,Nq);
2101 ArrayXd qvals = q.get_abscissa();
2105 GtqCell.resize(Lcell);
2106 for (
int i=0; i<Lcell; ++i) GtqCell[i].resize(Lcell);
2108 Stopwatch<> FourierWatch;
2110 for (
int i=0; i<Lcell; ++i)
2111 for (
int j=0; j<Lcell; ++j)
2113 GtqCell[i][j].resize(Nt,Nq); GtqCell[i][j].setZero();
2115 for (
int iq=0; iq<Nq; ++iq)
2116 for (
int n=0; n<Ncells; ++n)
2121 GtqCell[i][j].col(iq) += GtxCell[i][j].col(n) * exp(+1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(j-i)/Ls));
2125 GtqCell[i][j].col(iq) += GtxCell[i][j].col(n) * exp(-1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(i-j)/Ls));
2132 lout << FourierWatch.info(label+
" FT intercell x→q (const t)") << endl;
2180template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2184 IntervalIterator q(qmin,qmax,Nq);
2185 ArrayXd qvals = q.get_abscissa();
2190 for (
int i=0; i<Ls; ++i) GwqCell[i].resize(Ls);
2193 for (
int i=0; i<Ls; ++i) G0qCell[i].resize(Ls);
2195 Stopwatch<> FourierWatch;
2197 for (
int i=0; i<Ls; ++i)
2198 for (
int j=0; j<Ls; ++j)
2200 GwqCell[i][j].resize(Nw,Nq); GwqCell[i][j].setZero();
2201 G0qCell[i][j].resize(Nq); G0qCell[i][j].setZero();
2204 for (
int i=0; i<Lcell; ++i)
2205 for (
int j=0; j<Lcell; ++j)
2208 for (
int n=0; n<Ncells; ++n)
2211 for (
int iq=0; iq<Nq; ++iq)
2215 GwqCell[(n*Lcell+i)%Ls][(n*Lcell+j)%Ls].col(iq) += GwxCell[j][i].col(n) * exp(+1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(j-i)/Ls));
2216 G0qCell[(n*Lcell+i)%Ls][(n*Lcell+j)%Ls](iq) += G0xCell[j][i] (n) * exp(+1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(j-i)/Ls));
2220 GwqCell[(n*Lcell+i)%Ls][(n*Lcell+j)%Ls].col(iq) += GwxCell[i][j].col(n) * exp(-1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(i-j)/Ls));
2221 G0qCell[(n*Lcell+i)%Ls][(n*Lcell+j)%Ls](iq) += G0xCell[i][j] (n) * exp(-1.i*qvals(iq)*
double(dcellFT[n*Lcell]+(i-j)/Ls));
2229 lout << FourierWatch.info(label+
" FT intercell x→q (const ω)") << endl;
2233template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2235FT_tw (
const MatrixXcd &Gtq, MatrixXcd &Gwq, VectorXcd &G0q, VectorXcd &Glocw)
2237 IntervalIterator w(wmin,wmax,Nw);
2238 ArrayXd wvals = w.get_abscissa();
2239 Gwq.resize(Nw,Nq); Gwq.setZero();
2240 G0q.resize(Nq); G0q.setZero();
2242 Stopwatch<> FourierWatch;
2244 if (GREENINT_CHOICE ==
DIRECT)
2246 for (
int iw=0; iw<wvals.rows(); ++iw)
2248 double wval = wvals(iw);
2250 for (
int it=0; it<tvals.rows(); ++it)
2252 double tval = tvals(it);
2254 Gwq.row(iw) += weights(it) * exp(+1.i*wval*tval) * Gtq.row(it);
2258 else if (GREENINT_CHOICE ==
INTERP)
2277 #pragma omp parallel for
2278 for (
int iq=0; iq<Nq; ++iq)
2280 VectorXcd fvals = Gtq.col(iq);
2282 Gwq.col(iq) =
::FT_interpol(tvals,fvals,USE_QAWO,wmin,wmax,Nw);
2285 else if (GREENINT_CHOICE ==
OOURA)
2287 #pragma omp parallel for
2288 for (
int iq=0; iq<Nq; ++iq)
2290 VectorXcd fvals = Gtq.col(iq);
2292 Gwq.col(iq) = Ooura::FT(tvals,fvals,h_ooura,wmin,wmax,Nw);
2296 if (GREENINT_CHOICE ==
DIRECT)
2298 for (
int it=0; it<tvals.rows(); ++it)
2300 double tval = tvals(it);
2302 G0q += weights(it) * Gtq.row(it);
2305 else if (GREENINT_CHOICE ==
INTERP or GREENINT_CHOICE ==
OOURA)
2307 for (
int iq=0; iq<Nq; ++iq)
2309 ComplexInterpol Gtq_interp(tvals);
2310 for (
int it=0; it<tvals.rows(); ++it)
2312 double tval = tvals(it);
2314 Gtq_interp.insert(it,Gval);
2316 G0q(iq) += Gtq_interp.integrate();
2317 Gtq_interp.kill_splines();
2323 lout << FourierWatch.info(label+
" FT t→ω (const q)");
2324 if (GREENINT_CHOICE ==
INTERP) lout << boolalpha <<
", USE_QAWO=" << USE_QAWO;
2329 Glocw = FTloc_tw(Gloct,wvals);
2332template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2334FTxx_tw (
const MatrixXcd &Gtx, MatrixXcd &Gwx, VectorXcd &G0x, VectorXcd &Glocw)
2336 IntervalIterator w(wmin,wmax,Nw);
2337 ArrayXd wvals = w.get_abscissa();
2338 int Nx = Gtx.cols();
2339 Gwx.resize(Nw,Nx); Gwx.setZero();
2340 G0x.resize(Nx); G0x.setZero();
2342 Stopwatch<> FourierWatch;
2344 if (GREENINT_CHOICE ==
DIRECT)
2346 for (
int iw=0; iw<wvals.rows(); ++iw)
2348 double wval = wvals(iw);
2350 for (
int it=0; it<tvals.rows(); ++it)
2352 double tval = tvals(it);
2354 Gwx.row(iw) += weights(it) * exp(+1.i*wval*tval) * Gtx.row(it);
2358 else if (GREENINT_CHOICE ==
INTERP)
2360 #pragma omp parallel for
2361 for (
int ix=0; ix<Nx; ++ix)
2363 VectorXcd fvals = Gtx.col(ix);
2365 Gwx.col(ix) =
::FT_interpol(tvals,fvals,USE_QAWO,wmin,wmax,Nw);
2368 else if (GREENINT_CHOICE ==
OOURA)
2370 #pragma omp parallel for
2371 for (
int ix=0; ix<Nx; ++ix)
2373 VectorXcd fvals = Gtx.col(ix);
2375 Gwx.col(ix) = Ooura::FT(tvals,fvals,h_ooura,wmin,wmax,Nw);
2379 if (GREENINT_CHOICE ==
DIRECT)
2381 for (
int it=0; it<tvals.rows(); ++it)
2383 double tval = tvals(it);
2385 G0x += weights(it) * Gtx.row(it);
2388 else if (GREENINT_CHOICE ==
INTERP or GREENINT_CHOICE ==
OOURA)
2390 for (
int ix=0; ix<Nx; ++ix)
2392 ComplexInterpol Gtx_interp(tvals);
2393 for (
int it=0; it<tvals.rows(); ++it)
2395 double tval = tvals(it);
2397 Gtx_interp.insert(it,Gval);
2399 G0x(ix) += Gtx_interp.integrate();
2400 Gtx_interp.kill_splines();
2406 lout << FourierWatch.info(label+
" FT t→ω (const x)");
2407 if (GREENINT_CHOICE ==
INTERP) lout << boolalpha <<
", USE_QAWO=" << USE_QAWO;
2412 Glocw = FTloc_tw(Gloct,wvals);
2441template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2445 IntervalIterator w(wmin,wmax,Nw);
2446 ArrayXd wvals = w.get_abscissa();
2448 GwqCell.resize(Lcell);
for (
int i=0; i<Lcell; ++i) GwqCell[i].resize(Lcell);
2449 G0qCell.resize(Lcell);
for (
int i=0; i<Lcell; ++i) G0qCell[i].resize(Lcell);
2450 GlocwCell.resize(Lcell);
2452 Stopwatch<> FourierWatch;
2454 for (
int i=0; i<Lcell; ++i)
2455 for (
int j=0; j<Lcell; ++j)
2457 GwqCell[i][j].resize(Nw,Nq); GwqCell[i][j].setZero();
2459 if (GREENINT_CHOICE ==
DIRECT)
2461 for (
int iw=0; iw<wvals.rows(); ++iw)
2463 double wval = wvals(iw);
2465 for (
int it=0; it<tvals.rows(); ++it)
2467 double tval = tvals(it);
2469 GwqCell[i][j].row(iw) += weights(it) * exp(+1.i*wval*tval) * GtqCell[i][j].row(it);
2473 else if (GREENINT_CHOICE ==
INTERP)
2475 #pragma omp parallel for
2476 for (
int iq=0; iq<Nq; ++iq)
2478 VectorXcd fvals = GtqCell[i][j].col(iq);
2480 GwqCell[i][j].col(iq) =
::FT_interpol(tvals,fvals,USE_QAWO,wmin,wmax,Nw);
2483 else if (GREENINT_CHOICE ==
OOURA)
2485 #pragma omp parallel for
2486 for (
int iq=0; iq<Nq; ++iq)
2488 VectorXcd fvals = GtqCell[i][j].col(iq);
2490 GwqCell[i][j].col(iq) = Ooura::FT(tvals,fvals,h_ooura,wmin,wmax,Nw);
2494 G0qCell[i][j].resize(Nq); G0qCell[i][j].setZero();
2496 if (GREENINT_CHOICE ==
DIRECT)
2498 for (
int it=0; it<tvals.rows(); ++it)
2500 double tval = tvals(it);
2502 G0qCell[i][j] += weights(it) * GtqCell[i][j].row(it);
2505 else if (GREENINT_CHOICE ==
INTERP or GREENINT_CHOICE ==
OOURA)
2507 for (
int iq=0; iq<Nq; ++iq)
2509 ComplexInterpol Gtq_interp(tvals);
2510 for (
int it=0; it<tvals.rows(); ++it)
2512 double tval = tvals(it);
2514 Gtq_interp.insert(it,Gval);
2516 G0qCell[i][j](iq) += Gtq_interp.integrate();
2517 Gtq_interp.kill_splines();
2524 GlocwCell[i] = FTloc_tw(GloctCell[i],wvals);
2530 lout << FourierWatch.info(make_string(label+
" FT intercell t→ω (const q), ωmin=",wmin,
", ωmax=",wmax,
", Nω=",Nw));
2531 if (GREENINT_CHOICE ==
INTERP) lout << boolalpha <<
", USE_QAWO=" << USE_QAWO;
2536template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2540 IntervalIterator w(wmin,wmax,Nw);
2541 ArrayXd wvals = w.get_abscissa();
2543 GwxCell.resize(Lcell);
for (
int i=0; i<Lcell; ++i) GwxCell[i].resize(Lcell);
2544 G0xCell.resize(Lcell);
for (
int i=0; i<Lcell; ++i) G0xCell[i].resize(Lcell);
2545 GlocwCell.resize(Lcell);
2546 int Nx = GtxCell[0][0].cols();
2548 Stopwatch<> FourierWatch;
2550 for (
int i=0; i<Lcell; ++i)
2551 for (
int j=0; j<Lcell; ++j)
2553 GwxCell[i][j].resize(Nw,Nx); GwxCell[i][j].setZero();
2555 if (GREENINT_CHOICE ==
DIRECT)
2557 for (
int iw=0; iw<wvals.rows(); ++iw)
2559 double wval = wvals(iw);
2561 for (
int it=0; it<tvals.rows(); ++it)
2563 double tval = tvals(it);
2565 GwxCell[i][j].row(iw) += weights(it) * exp(+1.i*wval*tval) * GtxCell[i][j].row(it);
2569 else if (GREENINT_CHOICE ==
INTERP)
2571 #pragma omp parallel for
2572 for (
int ix=0; ix<Nx; ++ix)
2574 VectorXcd fvals = GtxCell[i][j].col(ix);
2576 GwxCell[i][j].col(ix) =
::FT_interpol(tvals,fvals,USE_QAWO,wmin,wmax,Nw);
2579 else if (GREENINT_CHOICE ==
OOURA)
2581 #pragma omp parallel for
2582 for (
int ix=0; ix<Nx; ++ix)
2584 VectorXcd fvals = GtxCell[i][j].col(ix);
2586 GwxCell[i][j].col(ix) = Ooura::FT(tvals,fvals,h_ooura,wmin,wmax,Nw);
2590 G0xCell[i][j].resize(Nx); G0xCell[i][j].setZero();
2592 if (GREENINT_CHOICE ==
DIRECT)
2594 for (
int it=0; it<tvals.rows(); ++it)
2596 double tval = tvals(it);
2598 G0xCell[i][j] += weights(it) * GtxCell[i][j].row(it);
2601 else if (GREENINT_CHOICE ==
INTERP or GREENINT_CHOICE ==
OOURA)
2603 for (
int ix=0; ix<Nx; ++ix)
2605 ComplexInterpol Gtx_interp(tvals);
2606 for (
int it=0; it<tvals.rows(); ++it)
2608 double tval = tvals(it);
2610 Gtx_interp.insert(it,Gval);
2612 G0xCell[i][j](ix) += Gtx_interp.integrate();
2613 Gtx_interp.kill_splines();
2620 GlocwCell[i] = FTloc_tw(GloctCell[i],wvals);
2626 lout << FourierWatch.info(make_string(label+
" FT intercell t→ω (const x), ωmin=",wmin,
", ωmax=",wmax,
", Nω=",Nw));
2627 if (GREENINT_CHOICE ==
INTERP) lout << boolalpha <<
", USE_QAWO=" << USE_QAWO;
2632template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2634FTloc_tw (
const VectorXcd &Gloct_in,
const ArrayXd &wvals)
2636 ArrayXcd Glocw_out(wvals.rows()); Glocw_out.setZero();
2638 Stopwatch<> FourierWatch;
2641 if (GREENINT_CHOICE ==
DIRECT)
2643 for (
int iw=0; iw<wvals.rows(); ++iw)
2645 double wval = wvals(iw);
2647 for (
int it=0; it<tvals.rows(); ++it)
2649 double tval = tvals(it);
2651 Glocw_out(iw) += weights(it) * exp(+1.i*wval*tval) * Gloct_in(it);
2655 else if (GREENINT_CHOICE ==
INTERP)
2657 VectorXcd fvals = Gloct_in;
2659 Glocw_out =
::FT_interpol(tvals, fvals, USE_QAWO, wvals(0), wvals(wvals.rows()-1), wvals.rows());
2661 else if (GREENINT_CHOICE ==
OOURA)
2663 VectorXcd fvals = Gloct_in;
2665 Glocw_out = Ooura::FT(tvals, fvals, h_ooura, wvals(0), wvals(wvals.rows()-1), wvals.rows());
2727template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2729recalc_FTw (
double wmin_new,
double wmax_new,
int Nw_new)
2740 FTxx_tw(Gtx,Gwx,G0x,Glocw);
2757template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2759recalc_FTwCell (
double wmin_new,
double wmax_new,
int Nw_new,
bool TRANSPOSE)
2768 FTcellww_xq(TRANSPOSE);
2785template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2802 IntervalIterator w(wmin,wmax,GlocwCell[0].rows());
2803 VectorXd QDOS = -M_1_PI * GlocwCell[0].imag();
2804 for (
int b=1; b<Lcell/Ns; ++b)
2806 QDOS += -M_1_PI * GlocwCell[b].imag();
2810 Interpol<GSL> QDOSinterpol(w.get_abscissa());
2811 QDOSinterpol = QDOS;
2814 if ((abs(mu-wmin)<::mynumeric_limits<double>::epsilon()))
2818 else if ((abs(mu-wmax)<::mynumeric_limits<double>::epsilon()))
2820 res = Hamiltonian::spinfac * QDOSinterpol.integrate();
2824 res = Hamiltonian::spinfac * QDOSinterpol.integrate(mu);
2829template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2834 ss <<
"INT=" << GREENINT_CHOICE;
2839template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2846 ss <<
"L=" << Lcell <<
"x" << Ncells;
2850 ss <<
"L=" << Lhetero <<
"_j0=" << j0;
2852 if (dLphys==2) ss <<
"_dLphys=" << dLphys;
2856template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2861 int qmin_pi, qmax_pi;
2862 if (Q_RANGE_CHOICE==
MPI_PPI) {qmin_pi=-1; qmax_pi=1;}
2863 else if (Q_RANGE_CHOICE==
ZERO_2PI) {qmin_pi=0; qmax_pi=2;}
2864 ss <<
"qmin=" << qmin_pi <<
"_qmax=" << qmax_pi;
2868template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2873 ss <<
"tmax=" << tmax;
2877template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2882 ss <<
"wmin=" << wmin <<
"_wmax=" << wmax;
2883 if (j0 == -1) ss <<
"_Ns=" << Ns;
2888template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2892 return xinfo() +
"_" + tinfo();
2895template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2899 return xinfo() +
"_" + tinfo() +
"_" + INTinfo() +
"_" + qinfo() +
"_" + winfo();
2902template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2906 return xinfo() +
"_" + tinfo() +
"_" + qinfo();
2909template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2915 #pragma omp critical
2917 lout <<
"tmax=" << tmax
2918 <<
", tpoints=" << Nt
2919 <<
", max(tstep)=" << tsteps.maxCoeff()
2920 <<
", tol_compr=" << tol_compr
2921 <<
", tol_Lanczos=" << tol_Lanczos
2922 <<
", tol_DeltaS=" << tol_DeltaS
2923 <<
", INT=" << GREENINT_CHOICE;
2925 lout << endl << termcolor::colorize << termcolor::bold
2926 <<
"———————————————————————————————————"
2927 <<
" GreenPropagator "
2929 <<
" ———————————————————————————————————"
2930 << termcolor::reset << endl << endl;
2935template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
2937save (
bool IGNORE_TX)
const
2939 #pragma omp critical
2943 IntervalIterator w(wmin,wmax,Nw);
2944 ArrayXd wvals = w.get_abscissa();
2948 #ifdef GREENPROPAGATOR_USE_HDF5
2949 lout <<
"tx-file: " << label+
"_"+xt_info()+
".h5" << endl;
2950 HDF5Interface target_tx(label+
"_"+xt_info()+
".h5",WRITE);
2951 target_tx.create_group(
"G");
2954 for (
int iQ=0; iQ<NQ; ++iQ)
2956 stringstream ss; ss <<
".Q" << iQ;
2957 target_tx.create_group(
"G"); target_tx.create_group(
"G"+ss.str());
2961 target_tx.create_group(
"tinfo");
2962 target_tx.save_vector(VectorXd(tvals),
"tvals",
"tinfo");
2963 target_tx.save_vector(VectorXd(weights),
"weights",
"tinfo");
2964 target_tx.save_vector(VectorXd(tsteps),
"tsteps",
"tinfo");
2965 target_tx.save_scalar(tmax,
"tmax",
"tinfo");
2969 if (GtxCell.size() > 0)
2971 for (
int i=0; i<Lcell; ++i)
2972 for (
int j=0; j<Lcell; ++j)
2974 string Gstring = (i<10 and j<10)? make_string(
"G",i,j) : make_string(
"G",i,
"_",j);
2975 #ifdef GREENPROPAGATOR_USE_HDF5
2976 if (PRINT) lout << label <<
" saving " << Gstring <<
"[txRe], " << Gstring <<
"[txIm] " << endl;
2977 target_tx.create_group(Gstring);
2978 target_tx.save_matrix(MatrixXd(GtxCell[i][j].real()),
"txRe",Gstring);
2979 target_tx.save_matrix(MatrixXd(GtxCell[i][j].imag()),
"txIm",Gstring);
2981 saveMatrix(GtxCell[i][j].real(), make_string(label,
"_G=txRe_i=",i,
"_j=",j,
"_",xt_info(),
".dat"), PRINT);
2982 saveMatrix(GtxCell[i][j].imag(), make_string(label,
"_G=txIm_i=",i,
"_j=",j,
"_",xt_info(),
".dat"), PRINT);
2987 if (GloctCell.size() > 0)
2989 for (
int i=0; i<Lcell; ++i)
2991 string Gstring = make_string(
"G",i);
2992 #ifdef GREENPROPAGATOR_USE_HDF5
2993 target_tx.create_group(Gstring);
2994 target_tx.save_vector(VectorXd(GloctCell[i].real()),
"t0Re",Gstring);
2995 target_tx.save_vector(VectorXd(GloctCell[i].imag()),
"t0Im",Gstring);
2997 save_xy(tvals, GloctCell[i].real(), GloctCell[i].imag(), make_string(label,
"_G=t0_i=",i,
"_",xt_info(),
".dat"), PRINT);
3004 #ifdef GREENPROPAGATOR_USE_HDF5
3005 if (PRINT) lout << label <<
" saving G[txRe], G[txIm]" << endl;
3006 target_tx.save_matrix(MatrixXd(Gtx.real()),
"txRe",
"G");
3007 target_tx.save_matrix(MatrixXd(Gtx.imag()),
"txIm",
"G");
3009 saveMatrix(Gtx.real(), label+
"_G=txRe_"+xt_info()+
".dat", PRINT);
3010 saveMatrix(Gtx.imag(), label+
"_G=txIm_"+xt_info()+
".dat", PRINT);
3014 #ifdef GREENPROPAGATOR_USE_HDF5
3019 #ifdef GREENPROPAGATOR_USE_HDF5
3020 lout <<
"ωq-file: " << label+
"_"+xtINTqw_info()+
".h5" << endl;
3021 HDF5Interface target_wq(label+
"_"+xtINTqw_info()+
".h5",WRITE);
3022 target_wq.create_group(
"G");
3025 for (
int iQ=0; iQ<NQ; ++iQ)
3027 stringstream ss; ss <<
".Q" << iQ;
3028 target_wq.create_group(
"G"); target_wq.create_group(
"G"+ss.str());
3031 target_wq.create_group(
"tinfo");
3032 target_wq.save_vector(VectorXd(tvals),
"t",
"");
3037 #ifdef GREENPROPAGATOR_USE_HDF5
3038 if (PRINT) lout << label <<
" saving G[ωxRe], G[ωxIm]" << endl;
3039 target_wq.save_matrix(MatrixXd(Gwx.real()),
"ωxRe",
"G");
3040 target_wq.save_matrix(MatrixXd(Gwx.imag()),
"ωxIm",
"G");
3043 if (PRINT) lout << label <<
" saving G[0xRe], G[0xIm]" << endl;
3044 target_wq.save_matrix(MatrixXd(G0x.real()),
"0xRe",
"G");
3045 target_wq.save_matrix(MatrixXd(G0x.imag()),
"0xIm",
"G");
3048 saveMatrix(Gwx.real(), label+
"_G=ωxRe_"+xtINTqw_info()+
".dat", PRINT);
3049 saveMatrix(Gwx.imag(), label+
"_G=ωxIm_"+xtINTqw_info()+
".dat", PRINT);
3052 saveMatrix(G0x.real(), make_string(label,
"_G=0xRe_",xtINTqw_info(),
".dat"), PRINT);
3053 saveMatrix(G0x.imag(), make_string(label,
"_G=0xIm_",xtINTqw_info(),
".dat"), PRINT);
3060 #ifdef GREENPROPAGATOR_USE_HDF5
3061 if (PRINT) lout << label <<
" saving G[ωqRe], G[ωqIm]" << endl;
3062 target_wq.save_matrix(MatrixXd(Gwq.real()),
"ωqRe",
"G");
3063 target_wq.save_matrix(MatrixXd(Gwq.imag()),
"ωqIm",
"G");
3066 if (PRINT) lout << label <<
" saving G[0qRe], G[0qIm]" << endl;
3067 target_wq.save_matrix(MatrixXd(G0q.real()),
"0qRe",
"G");
3068 target_wq.save_matrix(MatrixXd(G0q.imag()),
"0qIm",
"G");
3071 saveMatrix(Gwq.real(), label+
"_G=ωqRe_"+xtINTqw_info()+
".dat", PRINT);
3072 saveMatrix(Gwq.imag(), label+
"_G=ωqIm_"+xtINTqw_info()+
".dat", PRINT);
3075 saveMatrix(G0q.real(), make_string(label,
"_G=0qRe_",xtINTqw_info(),
".dat"), PRINT);
3076 saveMatrix(G0q.imag(), make_string(label,
"_G=0qIm_",xtINTqw_info(),
".dat"), PRINT);
3144 if (GwqCell.size() > 0)
3146 for (
int i=0; i<Lcell/Ns; ++i)
3147 for (
int j=0; j<Lcell/Ns; ++j)
3149 string Gstring = (i<10 and j<10)?make_string(
"G",i,j):make_string(
"G",i,
"_",j);
3150 #ifdef GREENPROPAGATOR_USE_HDF5
3151 if (PRINT) lout << label <<
" saving " << Gstring <<
"[ωqRe], " << Gstring <<
"[ωqIm] " << endl;
3152 target_wq.create_group(Gstring);
3153 target_wq.save_matrix(MatrixXd(GwqCell[i][j].real()),
"ωqRe",Gstring);
3154 target_wq.save_matrix(MatrixXd(GwqCell[i][j].imag()),
"ωqIm",Gstring);
3155 if (G0qCell.size() > 0)
3157 if (PRINT) lout << label <<
" saving " << Gstring <<
"[0qRe], " << Gstring <<
"[0qIm]" << endl;
3158 target_wq.save_vector(VectorXd(G0qCell[i][j].real()),
"0qRe",Gstring);
3159 target_wq.save_vector(VectorXd(G0qCell[i][j].imag()),
"0qIm",Gstring);
3162 saveMatrix(GwqCell[i][j].real(), make_string(label,
"_G=ωqRe_i=",i,
"_j=",j,
"_",xtINTqw_info(),
".dat"), PRINT);
3163 saveMatrix(GwqCell[i][j].imag(), make_string(label,
"_G=ωqIm_i=",i,
"_j=",j,
"_",xtINTqw_info(),
".dat"), PRINT);
3164 if (G0qCell.size() > 0)
3166 saveMatrix(G0qCell[i][j].real(), make_string(label,
"_G=0qRe_i=",i,
"_j=",j,
"_",xtINTqw_info(),
".dat"), PRINT);
3167 saveMatrix(G0qCell[i][j].imag(), make_string(label,
"_G=0qIm_i=",i,
"_j=",j,
"_",xtINTqw_info(),
".dat"), PRINT);
3173 if (GlocwCell.size() > 0)
3175 for (
int i=0; i<Lcell/Ns; ++i)
3177 string Gstring = make_string(
"G",i);
3178 #ifdef GREENPROPAGATOR_USE_HDF5
3179 if (PRINT) lout << label <<
" saving " << Gstring <<
"[QDOS], " << Gstring <<
"[t0Re], " << Gstring <<
"[t0Im]" << endl;
3180 if (PRINT) lout << label <<
" saving " << Gstring <<
"[QDOS], " << Gstring <<
"[t0Re], " << Gstring <<
"[t0Im]" << endl;
3181 target_wq.create_group(Gstring);
3182 target_wq.save_vector(VectorXd(-M_1_PI*GlocwCell[i].imag()),
"QDOS",Gstring);
3184 save_xy(wvals, -M_1_PI*GlocwCell[i].imag(), make_string(label,
"_G=QDOS_i=",i,
"_",xtINTqw_info(),
".dat"), PRINT);
3189 if (ncell.size() > 0)
3191 if (PRINT) lout << label <<
" saving ncell" << endl;
3192 #ifdef GREENPROPAGATOR_USE_HDF5
3193 target_wq.save_vector(VectorXd(ncell),
"ncell");
3195 saveMatrix(MatrixXd(ncell),
"ncell", PRINT);
3199 if (!std::isnan(mu))
3201 if (PRINT) lout << label <<
" saving μ=" << mu << endl;
3202 #ifdef GREENPROPAGATOR_USE_HDF5
3203 target_wq.save_scalar(mu,
"μ");
3209 #ifdef GREENPROPAGATOR_USE_HDF5
3213 if (Measure.size() != 0)
3215 #ifdef GREENPROPAGATOR_USE_HDF5
3216 HDF5Interface target_measurment(make_string(measure_subfolder,
"/",label+
"_"+xt_info(),
"_Op=",measure_name,
".h5"),WRITE);
3217 for (
int i=0; i<Lcell/Ns; ++i)
3219 target_measurment.save_matrix(Measurement[i],make_string(
"i=",i));
3221 target_measurment.create_group(
"tinfo");
3222 target_measurment.save_vector(VectorXd(tvals),
"tvals",
"tinfo");
3223 target_measurment.save_vector(VectorXd(weights),
"weights",
"tinfo");
3224 target_measurment.save_vector(VectorXd(tsteps),
"tsteps",
"tinfo");
3225 target_measurment.close();
3231template<
typename Hamiltonian,
typename Symmetry,
typename MpoScalar,
typename TimeScalar>
3235 #pragma omp critical
3239 IntervalIterator w(wmin,wmax,Nw);
3240 ArrayXd wvals = w.get_abscissa();
3242 lout <<
"tq-file: " << label+
"_"+xtq_info()+
".h5" << endl;
3243 HDF5Interface target_tq(label+
"_"+xtq_info()+
".h5",WRITE);
3244 target_tq.create_group(
"G");
3246 if (GtqCell.size() > 0)
3248 for (
int i=0; i<Lcell; ++i)
3249 for (
int j=0; j<Lcell; ++j)
3251 string Gstring = (i<10 and j<10)?make_string(
"G",i,j):make_string(
"G",i,
"_",j);
3252 #ifdef GREENPROPAGATOR_USE_HDF5
3253 if (PRINT) lout << label <<
" saving " << Gstring <<
"[tqRe], " << Gstring <<
"[tqIm] " << endl;
3254 target_tq.create_group(Gstring);
3255 target_tq.save_matrix(MatrixXd(GtqCell[i][j].real()),
"tqRe",Gstring);
3256 target_tq.save_matrix(MatrixXd(GtqCell[i][j].imag()),
"tqIm",Gstring);
3258 saveMatrix(GtqCell[i][j].real(), make_string(label,
"_G=tqRe_i=",i,
"_j=",j,
"_",xtq_info(),
".dat"), PRINT);
3259 saveMatrix(GtqCell[i][j].imag(), make_string(label,
"_G=tqIm_i=",i,
"_j=",j,
"_",xtq_info(),
".dat"), PRINT);
Scalar dot(const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket)
Array< Scalar, Dynamic, 1 > dot_green(const Mps< Symmetry, Scalar > &V1, const Mps< Symmetry, Scalar > &V2)
Scalar avg_hetero(const Mps< Symmetry, Scalar > &Vbra, const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vket, bool USE_BOUNDARY=false, size_t usePower=1ul, const qarray< Symmetry::Nq > &Qmid=Symmetry::qvacuum())
Scalar dot_hetero(const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket, int Ncellshift=0)
Scalar avg(const Mps< Symmetry, Scalar > &Vbra, const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vket, size_t power_of_O=1ul, DMRG::DIRECTION::OPTION DIR=DMRG::DIRECTION::RIGHT, DMRG::VERBOSITY::OPTION CHOSEN_VERBOSITY=DMRG::VERBOSITY::SILENT)
Mpo< Symmetry, Scalar > diff(const Mpo< Symmetry, Scalar > &H1, const Mpo< Symmetry, Scalar > &H2, DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT)
double norm(const PivotMatrix0< Symmetry, Scalar, MpoScalar > &H)
VectorXcd FT_interpol(const VectorXd &tvals, const VectorXcd &fvals, bool USE_QAWO, double wmin, double wmax, int wpoints)
std::ostream & operator<<(std::ostream &s, GREEN_INTEGRATION GI)
vector< bool > TWO_SITE(int it, const MpsType &Psi, double r=1., vector< size_t > true_overrides={}, vector< size_t > false_overrides={})
vector< vector< MatrixXcd > > GwqCell
void calc_GreenCell(const int &tindex, const complex< double > &phase, const vector< Mps< Symmetry, complex< double > > > &OxPhi, const vector< Mps< Symmetry, complex< double > > > &Psi, int x0=0)
vector< VectorXcd > GlocwCell
void compute_one(int j0, const Hamiltonian &H, const vector< Mps< Symmetry, complex< double > > > &OxPhi, double Eg, bool TIME_FORWARDS=true)
vector< VectorXcd > GlocwQmulti
vector< MatrixXcd > GwqQmulti
vector< Mpo< Symmetry, MpoScalar > > Measure
vector< MatrixXcd > GtxQmulti
void set_measurement(const vector< Mpo< Symmetry, MpoScalar > > &Measure_input, int Lcell, int measure_interval_input=10, string measure_name_input="M", string measure_subfolder_input=".")
vector< VectorXcd > get_GlocwCell() const
void set_tol_DeltaS(double x)
GreenPropagator(string label_input, double tmax_input, int Nt_input, int Ns_input=1, double wmin_input=-10., double wmax_input=10., int Nw_input=501, Q_RANGE Q_RANGE_CHOICE_input=MPI_PPI, int Nq_input=501, GREEN_INTEGRATION GREENINT=OOURA)
void set_h_ooura(double x)
double integrate_Glocw_cell(double mu, int Nint=1000)
void set_tol_compr(double x)
GREEN_INTEGRATION GREENINT_CHOICE
void make_xarrays(int Lhetero_input, int Lcell_input, int Ncells_input, int Ns=1, bool PRINT=false)
GreenPropagator(string label_input, int Lcell_input, int Ncells_input, int Ns_input, double tmax_input, const vector< vector< MatrixXcd > > &Gtx_input, Q_RANGE Q_RANGE_CHOICE_input=MPI_PPI, int Nq_input=501, GREEN_INTEGRATION GREENINT=OOURA)
void propagate_thermal_cell(const Hamiltonian &H, const vector< Mpo< Symmetry, MpoScalar > > &Ox, Mps< Symmetry, complex< double > > Phi, vector< Mps< Symmetry, complex< double > > > &OxPhi0, bool TIME_FORWARDS)
void set_OxPhiFull(const vector< Mps< Symmetry, complex< double > > > &OxPhiFull_input)
GreenPropagator(string label_input, int Lcell_input, double tmax_input, const MatrixXcd &Gtx_input, GREEN_INTEGRATION GREENINT=OOURA)
MatrixXcd get_Gtx() const
vector< MatrixXd > Measurement
vector< vector< VectorXcd > > G0qCell
void save_log(int i, int tindex, double tval, const Mps< Symmetry, complex< double > > &Psi, const TDVPPropagator< Hamiltonian, Symmetry, MpoScalar, TimeScalar, Mps< Symmetry, complex< double > > > &TDVP, const EntropyObserver< Mps< Symmetry, complex< double > > > &Sobs, const vector< bool > &TWO_SITE)
vector< VectorXcd > GloctCell
vector< vector< VectorXcd > > G0xCell
vector< MatrixXcd > GtqQmulti
void set_Oshift(vector< MpoScalar > Oshift_input)
vector< VectorXcd > G0qQmulti
void save_GtqCell() const
vector< VectorXcd > GloctQmulti
void set_log(string logfolder_input="./")
void FTcell_xq(bool TRANSPOSE=false)
vector< vector< MatrixXcd > > get_GwqCell() const
void set_qlims(Q_RANGE CHOICE)
void print_starttext() const
void set_Lcell(int Lcell_input)
void calc_Green(const int &tindex, const complex< double > &phase, const vector< Mps< Symmetry, complex< double > > > &OxPhi, const Mps< Symmetry, complex< double > > &Psi)
void compute_cell(const Hamiltonian &H, const vector< Mps< Symmetry, complex< double > > > &OxPhiBra, const vector< Mps< Symmetry, complex< double > > > &OxPhiKet, double Eg, bool TIME_FORWARDS=true, bool COUNTERPROPAGATE=true, int x0=0)
void set_Qmulti(int NQ_input)
void FTxx_tw(const MatrixXcd &Gtx, MatrixXcd &Gwx, VectorXcd &G0x, VectorXcd &Glocw)
GreenPropagator(string label_input, int Lcell_input, int Ncells_input, int Ns_input, double tmax_input, const vector< string > &files, Q_RANGE Q_RANGE_CHOICE_input=MPI_PPI, int Nq_input=501, GREEN_INTEGRATION GREENINT=OOURA)
void propagate_cell(int x0, const Hamiltonian &H, const vector< Mps< Symmetry, complex< double > > > &OxPhi, double Eg, bool TIME_FORWARDS=true)
void FT_tw(const MatrixXcd &Gtq, MatrixXcd &Gwq, VectorXcd &G0q, VectorXcd &Glocw)
void recalc_FTw(double wmin_new, double wmax_new, int Nw_new=501)
void FTcellww_xq(bool TRANSPOSE=false)
void save(bool IGNORE_TX=false) const
void propagate_one(int j0, const Hamiltonian &H, const vector< Mps< Symmetry, complex< double > > > &OxPhi, double Eg, bool TIME_FORWARDS=true)
vector< vector< MatrixXcd > > GwxCell
ArrayXcd FTloc_tw(const VectorXcd &Gloct, const ArrayXd &wvals)
vector< Mps< Symmetry, complex< double > > > OxPhiFull
vector< vector< MatrixXcd > > GtqCell
void calc_GreenCell_thermal(const int &tindex, const vector< Mpo< Symmetry, MpoScalar > > &Ox, const vector< Mps< Symmetry, complex< double > > > &Psi)
void compute_thermal_cell(const Hamiltonian &H, const vector< Mpo< Symmetry, MpoScalar > > &Odag, const Mps< Symmetry, complex< double > > &Phi, vector< Mps< Symmetry, complex< double > > > &OxPhi0, bool TIME_FORWARDS)
void measure_wavepacket(const Mps< Symmetry, complex< double > > &Psi, double tval, int i=0)
void calc_Green_thermal(const int &tindex, const vector< Mpo< Symmetry, MpoScalar > > &Ox, const Mps< Symmetry, complex< double > > &Phi, const Mps< Symmetry, complex< double > > &Psi)
void set_verbosity(DMRG::VERBOSITY::OPTION VERBOSITY)
vector< vector< MatrixXcd > > get_GtxCell() const
vector< MpoScalar > Oshift
string xtINTqw_info() const
vector< vector< MatrixXcd > > GtxCell
DMRG::VERBOSITY::OPTION CHOSEN_VERBOSITY
void counterpropagate_cell(const Hamiltonian &H, const vector< Mps< Symmetry, complex< double > > > &OxPhiBra, const vector< Mps< Symmetry, complex< double > > > &OxPhiKet, double Eg, bool TIME_FORWARDS=true)
void set_lim_Nsv(size_t x)
void recalc_FTwCell(double wmin_new, double wmax_new, int Nw_new=501, bool TRANSPOSE=false)
ArrayXd get_truncWeight() const
void t_step_adaptive(const Hamiltonian &H, VectorType &Vinout, TimeScalar dt, const vector< bool > &TWO_STEP_AT, int N_stages=1, double tol_Lanczos=1e-8)
static double damping(double tval)
static double gauss(double tval)
static double lorentz(double tval)
GreenPropagatorLog(int Nt, int L, string logfolder_input)
void save(string label) const