-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdstuff.h
101 lines (101 loc) · 6.81 KB
/
cmdstuff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "inter.h"
#include "Constant.h"
// temp
double HOrho(double xc,double pc,double beta,double m,double w);
double HOrho_E(double xc,double pc,double beta,double m,double w);
// end temp
double potentialplot(double x,double a,double b,double c);
//buck potential
double Vbuck(double r);
matrix xharmonic(int size);
matrix xharmonic_S(int size);
matrix xharmonic_A(int size);
matrix x2harmonic(int size);
matrix x2harmonic_S(int size);
matrix x2harmonic_A(int size);
matrix x3harmonic(int size);
matrix x3harmonic_S(int size);
matrix x3harmonic_A(int size);
matrix x4harmonic(int size);
matrix x4harmonic_S(int size);
matrix x4harmonic_A(int size);
matrix pharmonic(int size);
matrix pharmonic_S(int size);
matrix pharmonic_A(int size);
matrix p2harmonic(int size);
matrix p2harmonic_S(int size);
matrix p2harmonic_A(int size);
matrix p4harmonic(int size);
matrix p4harmonic_S(int size);
matrix p4harmonic_A(int size);
diagmat harmonicoscillator(int size);
diagmat harmonicoscillator_S(int size);
diagmat harmonicoscillator_A(int size);
matrix heaviside(vector X,int size,int leftflag);
matrix point_x(vector X,int size,int index_x);
cvector QDOdiag(cmatrix Proj,cmatrix A,cvector Ep,cdiagmat expbetaEp,cmatrix L,cmatrix R,double beta,int size);
cmatrix QDO(cmatrix Proj,cmatrix A,cvector Ep,cdiagmat expbetaEp,cmatrix L,cmatrix R,double beta,int size);
cvector QDOtimediag(cmatrix Proj,cmatrix A,cvector Ep,cdiagmat expbetaEp,cmatrix L,cmatrix R,diagmat E,matrix eigenvecs,matrix trnspeigenvecs,matrix zeromat,double beta,double t,int size);
cmatrix QDOtime(cmatrix Proj,cmatrix A,cvector Ep,cdiagmat expbetaEp,cmatrix L,cmatrix R,diagmat E,matrix eigenvecs,matrix trnspeigenvecs,matrix zeromat,double beta,double t,int size);
cmatrix timeoperator(vector E,matrix P,matrix trnspsP,cmatrix A,matrix zeromat,double t,int size);
cmatrix FourierQDO(cvector Ep,cdiagmat expbetaEp,cmatrix L,cmatrix R,cmatrix Proj,double beta,int size);
matrix orderbasis(int size);
matrix invorderbasis(int size);
void outputmatrix(matrix A,int size1,int size2);
void outputvector(vector A, int size);
matrix zeromatrix(int size1,int size2);
cmatrix czeromatrix(int size1,int size2);
matrix identitymatrix(int size);
matrix symprojmatrix(int size,int halfsize);
matrix antisymprojmatrix(int size,int halfsize);
cmatrix pickelement(cmatrix A,int k,int kp,int size);
void putelement(cmatrix& A,cmatrix partA,int k,int kp,int size);
cdiagmat diagelement(cmatrix A,cmatrix B,int size);
matrix totmat(int size,int halfsize,matrix A1,matrix A2,matrix A3,matrix A4);
cmatrix adjoint(cmatrix A,int rowsize,int colsize);
cmatrix conjugate(cmatrix A,int rowsize,int colsize);
cdiagmat conjugate(cdiagmat A,int size);
cvector conjugate(cvector A,int size);
double delta(int i,int ip);
complex partialtrace(cmatrix A,int size,int flag);
double partialtrace(matrix A,int size,int flag);
complex computetrace(cmatrix A,int start,int finish);
double computetrace(matrix A,int start,int finish);
complex computetrace(cdiagmat A,int start,int finish);
double computetrace(diagmat A,int start,int finish);
complex computesum(cvector A,int start,int finish);
double computesum(vector A,int start,int finish);
cmatrix expomatrix(cmatrix A,cvector& D,cdiagmat& expD,cmatrix& L,cmatrix& R,double f,int size,int flag);
matrix expomatrix(matrix& A,vector& D,diagmat& expD,matrix& invA,double f,int size,int flag);
cdiagmat expomatrix(cdiagmat A,double f,int size);
diagmat expomatrix(diagmat A,double f,int size);
cdiagmat expovec(cvector A,double f,int size);
diagmat expovec(vector A,double f,int size);
complex exptrace(cmatrix A,double f,int start,int finish,int size,int flag);
double exptrace(matrix A,double f,int start,int finish,int size,int flag);
complex exptrace(cdiagmat A,double f,int start,int finish,int size);
double exptrace(diagmat A,double f,int start,int finish,int size);
complex expsum(cvector A,double f,int start,int finish,int size);
double expsum(vector A,double f,int start,int finish,int size);
cvector singleFT(cvector A,double kmax,double xmax,int nk);
cmatrix doubleFT_forward(cmatrix A,double kmax,double kpmax,double xmax,double pmax,int nk,int nkp,int nx,int np);
cmatrix doubleFT_inverse(cmatrix A,double kmax,double kpmax,double xmax,double pmax,int nk,int nkp,int nx,int np);
complex doubleFTpoint_forward(cmatrix A,double kmax,double kpmax,double xvalue,double pvalue,int nk,int nkp);
complex doubleFTpoint_inverse(cmatrix A,double kmax,double kpmax,double xvalue,double pvalue,int nk,int nkp);
void specialFT_centroid(int nk,int nkp,int ngridxc,int ngridpc,double dk,double dkp,vector kvalue,vector kpvalue,matrix frho,matrix frho_E,matrix ff,matrix ff_E,matrix ff_old_E,matrix fh,matrix fh_E,matrix fv,matrix fv_E,vector grho,vector grho_E,vector hrho,vector hrho_E,vector& gridxc,vector& gridpc,matrix& rhoc,matrix& rhoc_E,matrix& fc,matrix& fc_E,matrix& fc_old_E,matrix& hc,matrix& hc_E,matrix& vc,matrix& vc_E,vector& rhocg,vector& rhocg_E,vector& rhoch,vector& rhoch_E);
void writematrix(matrix& A,int nx,int ny,int flag);
void euler(double m,double dt,double force,double& newx,double& newp);
void rungekutta(double m,double dt,Interp2d f,double& newx,double& newp);
void corrfn0_DK(vector& corr,vector& corr_S,vector& corr_A,double Z,double Z_S,double Z_A,vector E,matrix A,double beta,int size,int ntimesteps,double starttime,double dt);
void corrfn0_SK(vector& corr,vector& corr_S,vector& corr_A,double Z,double Z_S,double Z_A,vector E,matrix A,double beta,int size,int ntimesteps,double starttime,double dt);
void corrfn0_real(vector& corr,vector& corr_S,vector& corr_A,double Z,double Z_S,double Z_A,vector E,matrix A,double beta,int size,int ntimesteps,double starttime,double dt);
void corrfn0_imag(vector& corr,vector& corr_S,vector& corr_A,double Z,double Z_S,double Z_A,vector E,matrix A,double beta,int size,int ntimesteps,double starttime,double dt);
vector forwardFT(vector w,int nw,vector ct,vector t,int nt,double factor);
vector fwFT(vector w,int nw,vector ctR,vector ctI,vector t,int nt,double factor);
vector RbackwardFT(vector t,int nt,vector cw,vector w,int nw,double factor);
vector IbackwardFT(vector t,int nt,vector cw,vector w,int nw,double factor);
vector fcw(vector w,int nw,vector cw,double beta);
void FTcorrfn0(vector& FTcorr,vector& FTcorr_S,vector& FTcorr_A,double Z,double Z_S,double Z_A,vector E,matrix A,double beta,int size,int nw,vector w,double alpha);
double gaussianfn(double x,double mu,double alpha);
void divdynCMD(int nxcdyn,int kpindex,int ntimesteps,int accgrid,int acctrajtime,double pcdyndiv,double dt,double threshold,double m,double corr_factor,double Z,vector xcdyn,Interp2d rho,Interp2d f,double& Zdyndiv,vector& corr_xc,vector& corr_pc,vector& corr_xc2);
void fulldynCMD(int nxcdyn,int npcdyn,int ntimesteps,int accgrid,int acctrajtime,double dt,double threshold,double m,double corr_factor,double Z,vector xcdyn,vector pcdyn,Interp2d rho,Interp2d f,double& Zdyn,vector& corr_xc,vector& corr_pc,vector& corr_xc2);