File for giving multiplying functions to the wave vectors for TPQ and TE method.
More...
#include "Common.h"
#include "diagonalcalc.h"
#include "Multiply.h"
#include "wrapperMPI.h"
#include "mltply.h"
Go to the source code of this file.
|
int | Multiply (struct BindStruct *X) |
| Function of calculating the i-th step norm as
\[ N^{(i)} = |L v_1^{(i)}-v_0^{(i)}/N_s | \]
and update the i+1-th wave vector as
\[ v_0^{(i+1)} = \frac{L v_1^{(i)}-v_0^{(i)}/N_s}{N^{(i)}} \]
for TPQ calculation. More...
|
|
int | MultiplyForTEM (struct BindStruct *X) |
| Function of multiplying Hamiltonian for Time Evolution. More...
|
|
File for giving multiplying functions to the wave vectors for TPQ and TE method.
- Author
- Takahiro Misawa (The University of Tokyo)
-
Kazuyoshi Yoshimi (The University of Tokyo)
-
Kota Ido (The University of Tokyo)
Definition in file Multiply.c.
◆ Multiply()
Function of calculating the i-th step norm as
\[ N^{(i)} = |L v_1^{(i)}-v_0^{(i)}/N_s | \]
and update the i+1-th wave vector as
\[ v_0^{(i+1)} = \frac{L v_1^{(i)}-v_0^{(i)}/N_s}{N^{(i)}} \]
for TPQ calculation.
- Parameters
-
X | [in] data list for calculation (idim_max and NsiteMPI) |
- Return values
-
0 | normally finished |
-1 | unnormally finished |
- Author
- Takahiro Misawa (The University of Tokyo)
-
Kazuyoshi Yoshimi (The University of Tokyo)
Definition at line 43 of file Multiply.c.
References global_norm, LargeValue, SumMPI_dc(), v0, v1, and X.
Referenced by CalcByTPQ().
51 i_max=
X->Check.idim_max;
52 Ns = 1.0*
X->Def.NsiteMPI;
55 #pragma omp parallel for default(none) reduction(+: dnorm) private(i) shared(v0, v1) firstprivate(i_max, Ns, LargeValue) 56 for(i = 1; i <= i_max; i++){
58 dnorm += conj(
v0[i])*
v0[i];
63 #pragma omp parallel for default(none) private(i) shared(v0) firstprivate(i_max, dnorm) 64 for(i=1;i<=i_max;i++){
double complex SumMPI_dc(double complex norm)
MPI wrapper function to obtain sum of Double complex across processes.
◆ MultiplyForTEM()
Function of multiplying Hamiltonian for Time Evolution.
Make \( |v_0 \rangle = |\psi(t+dt) \rangle \) from \( |v_1 \rangle = | \psi(t) \rangle \) and \( |v_0 \rangle = H |\psi(t) \rangle \).
- Parameters
-
X | [in] data list for calculation (idim_max and TimeSlice) |
- Return values
-
0 | normally finished |
-1 | unnormally finished |
Definition at line 80 of file Multiply.c.
References global_norm, mltply(), SumMPI_dc(), v0, v1, v2, and X.
Referenced by CalcByTEM().
87 double complex dnorm=0.0;
88 double complex tmp1 = 1.0;
89 double complex tmp2=0.0;
90 double dt=
X->Def.Param.TimeSlice;
93 i_max=
X->Check.idim_max;
95 if(dt <pow(10.0, -14)){
96 #pragma omp parallel for default(none) reduction(+: dnorm) private(i) shared(v0, v1, v2) firstprivate(i_max, dt, tmp2) 97 for(i = 1; i <= i_max; i++){
107 #pragma omp parallel for default(none) reduction(+: dnorm) private(i) shared(v0, v1, v2) firstprivate(i_max, dt, tmp1, tmp2) 108 for (i = 1; i <= i_max; i++) {
110 v0[i] =
v1[i] + tmp1 * tmp2;
112 v2[i] = 0.0 + I * 0.0;
114 for (coef = 2; coef <=
X->Def.Param.ExpandCoef; coef++) {
115 tmp1 *= -I * dt / (
double complex) coef;
119 #pragma omp parallel for default(none) private(i) shared(v0, v1, v2) firstprivate(i_max, tmp1, myrank) 120 for (i = 1; i <= i_max; i++) {
121 v0[i] += tmp1 *
v2[i];
123 v2[i] = 0.0 + I * 0.0;
128 #pragma omp parallel for default(none) reduction(+: dnorm) private(i) shared(v0) firstprivate(i_max, dt) 129 for(i = 1; i <= i_max; i++){
130 dnorm += conj(
v0[i])*
v0[i];
135 #pragma omp parallel for default(none) private(i) shared(v0) firstprivate(i_max, dnorm) 136 for(i=1;i<=i_max;i++){
int mltply(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Parent function of multiplying the wavefunction by the Hamiltonian. . First, the calculation of diago...
double complex SumMPI_dc(double complex norm)
MPI wrapper function to obtain sum of Double complex across processes.