Multiplication \( v_0 = H v_1 \) at the first step for TPQ mode ( \( v_1 \) is the random or inputted vector).
More...
#include "FirstMultiply.h"
#include "expec_energy_flct.h"
#include "common/setmemory.h"
#include "wrapperMPI.h"
#include "CalcTime.h"
Go to the source code of this file.
|
int | FirstMultiply (int rand_i, struct BindStruct *X) |
| Multiplication \( v_0 = H v_1 \) at the first step for TPQ mode ( \( v_1 \) is the random or inputted vector). More...
|
|
Multiplication \( v_0 = H v_1 \) at the first step for TPQ mode ( \( v_1 \) is the random or inputted vector).
- Author
- Takahiro Misawa (The University of Tokyo)
-
Kazuyoshi Yoshimi (The University of Tokyo)
- Version
- 0.1
Definition in file FirstMultiply.c.
◆ FirstMultiply()
int FirstMultiply |
( |
int |
rand_i, |
|
|
struct BindStruct * |
X |
|
) |
| |
Multiplication \( v_0 = H v_1 \) at the first step for TPQ mode ( \( v_1 \) is the random or inputted vector).
- Parameters
-
rand_i | [in] A rundom number seed for giving the initial vector \( v_1 \). |
X | [in] Struct to get information of the vector \( v_1 \) for the first step calculation. |
- Return values
-
-1 | fail the multiplication \( v_0 = H v_1 \). |
0 | succeed the multiplication \( v_0 = H v_1 \). |
- Version
- 0.1
- Author
- Takahiro Misawa (The University of Tokyo)
-
Kazuyoshi Yoshimi (The University of Tokyo)
Definition at line 40 of file FirstMultiply.c.
Referenced by CalcByTPQ().
45 long unsigned int u_long_i;
52 #pragma omp parallel default(none) private(i, mythread, u_long_i, dsfmt) \ 53 shared(v0, v1, nthreads, myrank, rand_i, X, stdoutMPI, cLogCheckInitComplex, cLogCheckInitReal) \ 57 for (i = 1; i <= i_max; i++) {
66 mythread = omp_get_thread_num();
71 dsfmt_init_gen_rand(&dsfmt, u_long_i);
77 for (i = 1; i <= i_max; i++)
78 v1[i] = 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5) + 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5)*I;
82 for (i = 1; i <= i_max; i++)
83 v1[i] = 2.0*(dsfmt_genrand_close_open(&dsfmt) - 0.5);
92 #pragma omp parallel for default(none) private(i) shared(v1, i_max) reduction(+: dnorm) 93 for(i=1;i<=i_max;i++){
94 dnorm += conj(
v1[i])*
v1[i];
99 #pragma omp parallel for default(none) private(i) shared(v0,v1) firstprivate(i_max, dnorm) 100 for(i=1;i<=i_max;i++){
113 #pragma omp parallel for default(none) private(i) shared(v0, v1, list_1) firstprivate(i_max, Ns, LargeValue, myrank) 114 for(i = 1; i <= i_max; i++){
119 #pragma omp parallel for default(none) private(i) shared(v0) firstprivate(i_max) reduction(+: dnorm) 120 for(i=1;i<=i_max;i++){
121 dnorm += conj(
v0[i])*
v0[i];
126 #pragma omp parallel for default(none) private(i) shared(v0) firstprivate(i_max, dnorm) 127 for(i=1;i<=i_max;i++){
struct DefineList Def
Definision of system (Hamiltonian) etc.
void StartTimer(int n)
function for initializing elapse time [start]
double complex SumMPI_dc(double complex norm)
MPI wrapper function to obtain sum of Double complex across processes.
unsigned long int idim_max
The dimension of the Hilbert space of this process.
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
int nthreads
Number of Threads, defined in InitializeMPI()
unsigned int NsiteMPI
Total number of sites, differ from DefineList::Nsite.
const char * cFileNameTimeKeep
long int initial_iv
Seed of random number for initial guesss of wavefunctions.
int myrank
Process ID, defined in InitializeMPI()
int expec_energy_flct(struct BindStruct *X)
Parent function to calculate expected values of energy and physical quantities.
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.
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.