Multiplication \( v_0 = H v_1 \) at the first step for TPQ mode ( \( v_1 \) is the random or inputted vector).
49 int mythread, rand_i, iret;
54 for (rand_i = 0; rand_i <
NumAve; rand_i++) {
55 #pragma omp parallel default(none) private(i, mythread, u_long_i, dsfmt) \ 56 shared(I, v0, v1, nthreads, myrank, rand_i, X, stdoutMPI) \ 60 for (i = 1; i <= i_max; i++) {
68 mythread = omp_get_thread_num();
73 dsfmt_init_gen_rand(&dsfmt, u_long_i);
79 for (i = 1; i <= i_max; i++)
80 v1[i][rand_i] = 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5) + 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5)*
I;
84 for (i = 1; i <= i_max; i++)
85 v1[i][rand_i] = 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5);
93 #pragma omp parallel for default(none) private(i) \ 94 shared(v1, i_max, rand_i) reduction(+:dnorm) 95 for (i = 1; i <= i_max; i++)
96 dnorm += real(conj(
v1[i][rand_i])*
v1[i][rand_i]);
100 #pragma omp parallel for default(none) private(i) shared(v1,rand_i) firstprivate(i_max, dnorm) 101 for (i = 1; i <= i_max; i++)
v1[i][rand_i] =
v1[i][rand_i] / dnorm;
112 if (iret != 0)
return -1;
117 if (iret != 0)
return -1;
119 #pragma omp parallel for default(none) private(i,rand_i) shared(v0,v1,i_max,NumAve) 120 for (i = 1; i <= i_max; i++)
121 for (rand_i = 0; rand_i <
NumAve; rand_i++)
v0[i][rand_i] =
v1[i][rand_i];
129 for (rand_i = 0; rand_i <
NumAve; rand_i++) {
130 #pragma omp parallel for default(none) private(i) shared(v0, v1, list_1,rand_i) \ 131 firstprivate(i_max, Ns, LargeValue, myrank) 132 for (i = 1; i <= i_max; i++) {
137 #pragma omp parallel for default(none) private(i) shared(v0,rand_i) \ 138 firstprivate(i_max) reduction(+:dnorm) 139 for (i = 1; i <= i_max; i++)
140 dnorm += real(conj(
v0[i][rand_i])*
v0[i][rand_i]);
144 #pragma omp parallel for default(none) private(i) shared(v0,rand_i) firstprivate(i_max, dnorm) 145 for (i = 1; i <= i_max; i++)
v0[i][rand_i] =
v0[i][rand_i] / dnorm;
struct DefineList Def
Definision of system (Hamiltonian) etc.
int expec_cisajscktaltdc(struct BindStruct *X, int nstate, std::complex< double > **Xvec, std::complex< double > **vec)
Parent function to calculate two-body green's functions.
int expec_energy_flct(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Parent function to calculate expected values of energy and physical quantities.
std::complex< double > ** v0
std::complex< double > I(0.0, 1.0)
std::complex< double > ** v1
int NsiteMPI
Total number of sites, differ from DefineList::Nsite.
int TimeKeeperWithRandAndStep(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType, const int irand, const int istep)
Functions for writing a time log.
int nthreads
Number of Threads, defined in InitializeMPI()
int myrank
Process ID, defined in InitializeMPI()
int expec_cisajs(struct BindStruct *X, int nstate, std::complex< double > **Xvec, std::complex< double > **vec)
function of calculation for one body green's function
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
int istep
Index of TPQ step ???
double SumMPI_d(double norm)
MPI wrapper function to obtain sum of Double across processes.
long int initial_iv
Seed of random number for initial guesss of wavefunctions.
int iInitialVecType
Switch for type of inital vectors. 0:complex type, 1: real type. default value is set as 0 in readdef...
struct CheckList Check
Size of the Hilbert space.
long int idim_max
The dimension of the Hilbert space of this process.
void StartTimer(int n)
function for initializing elapse time [start]