18 #include "diagonalcalc.hpp" 19 #include "Multiply.hpp" 20 #include "wrapperMPI.hpp" 55 #pragma omp parallel for default(none) private(i,rand_i) \ 56 shared(v0, v1,NumAve) firstprivate(i_max, Ns, LargeValue) 57 for (i = 1; i <= i_max; i++) {
58 for (rand_i = 0; rand_i <
NumAve; rand_i++) {
63 #pragma omp parallel for default(none) private(i,rand_i) \ 64 shared(v0,NumAve,global_norm) firstprivate(i_max) 65 for (i = 1; i <= i_max; i++)
66 for (rand_i = 0; rand_i <
NumAve; rand_i++)
82 std::complex<double> **v2
88 std::complex<double> tmp1 = 1.0;
89 std::complex<double> tmp2 = 0.0;
95 if (dt < pow(10.0, -14)) {
96 #pragma omp parallel for default(none) private(i) \ 97 shared(I,v0, v1, v2) firstprivate(i_max, dt, tmp2) 98 for (i = 1; i <= i_max; i++) {
102 v2[i][0] = 0.0 +
I * 0.0;
108 #pragma omp parallel for default(none) private(i) \ 109 shared(v0, v1, v2,I) firstprivate(i_max, dt, tmp1, tmp2) 110 for (i = 1; i <= i_max; i++) {
112 v0[i][0] =
v1[i][0] + tmp1 * tmp2;
114 v2[i][0] = 0.0 +
I * 0.0;
117 tmp1 *= -
I * dt / (std::complex<double>)coef;
121 #pragma omp parallel for default(none) private(i) shared(I, v0, v1, v2) \ 122 firstprivate(i_max, tmp1, myrank) 123 for (i = 1; i <= i_max; i++) {
124 v0[i][0] += tmp1 * v2[i][0];
126 v2[i][0] = 0.0 +
I * 0.0;
131 #pragma omp parallel for default(none) reduction(+: dnorm) private(i) shared(v0) \ 132 firstprivate(i_max, dt) 133 for (i = 1; i <= i_max; i++) {
134 dnorm += real(conj(
v0[i][0])*
v0[i][0]);
139 #pragma omp parallel for default(none) private(i) shared(v0) firstprivate(i_max, dnorm) 140 for (i = 1; i <= i_max; i++) {
141 v0[i][0] =
v0[i][0] / dnorm;
struct DefineList Def
Definision of system (Hamiltonian) etc.
int Multiply(struct BindStruct *X)
Function of calculating the i-th step norm as and update the i+1-th wave vector as for TPQ calculat...
std::complex< double > ** v0
std::complex< double > I(0.0, 1.0)
int mltply(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Parent function of multiplying the wavefunction by the Hamiltonian. . First, the calculation of diago...
void NormMPI_dv(long int ndim, int nstate, std::complex< double > **_v1, double *dnorm)
Compute norm of process-distributed vector .
std::complex< double > ** v1
int MultiplyForTEM(struct BindStruct *X, std::complex< double > **v2)
Function of multiplying Hamiltonian for Time Evolution.
int NsiteMPI
Total number of sites, differ from DefineList::Nsite.
double SumMPI_d(double norm)
MPI wrapper function to obtain sum of Double across processes.
struct CheckList Check
Size of the Hilbert space.
long int idim_max
The dimension of the Hilbert space of this process.