17 #include "expec_energy_flct.h" 18 #include "expec_totalspin.h" 19 #include "expec_cisajs.h" 20 #include "expec_cisajscktaltdc.h" 21 #include "wrapperMPI.h" 23 #include "matrixscalapack.h" 51 unsigned long int neig
54 long unsigned int i, j, i_max;
57 double complex *vec_tmp;
58 int ictxt, ierr, rank;
61 i_max =
X->Check.idim_max;
62 for (i = 0; i < neig; i++) {
65 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
66 vec_tmp = malloc(i_max*
sizeof(
double complex));
67 GetEigenVector(i, i_max, Z_vec, descZ_vec, vec_tmp);
69 for (j = 0; j < i_max; j++) {
70 v0[j + 1] = vec_tmp[j];
74 }
else for (j = 0; j < i_max; j++) {
78 for (j = 0; j < i_max; j++) {
82 X->Phys.eigen_num = i;
84 fprintf(stderr,
"Error: calc expec_energy.\n");
88 fprintf(stderr,
"Error: calc OneBodyG.\n");
92 fprintf(stderr,
"Error: calc TwoBodyG.\n");
97 if (
X->Def.iCalcType == FullDiag) {
98 fprintf(stderr,
"In scalapack fulldiag, total spin is not calculated !\n");
103 if (
X->Def.iCalcType == FullDiag) {
105 fprintf(stderr,
"Error: calc TotalSpin.\n");
111 if (
X->Def.iCalcType == FullDiag) {
113 fprintf(stderr,
"Error: calc TotalSpin.\n");
119 if (
X->Def.iCalcModel == Spin ||
X->Def.iCalcModel == SpinGC) {
120 tmp_N =
X->Def.NsiteMPI;
122 tmp_N =
X->Phys.num_up +
X->Phys.num_down;
125 if (
X->Def.iCalcType == FullDiag){
128 fprintf(
stdoutMPI,
"i=%5ld Energy=%10lf N=%10lf Sz=%10lf Doublon=%10lf \n", i,
X->Phys.energy, tmp_N,
129 X->Phys.Sz,
X->Phys.doublon);
132 fprintf(
stdoutMPI,
"i=%5ld Energy=%10lf N=%10lf Sz=%10lf S2=%10lf Doublon=%10lf \n", i,
X->Phys.energy, tmp_N,
133 X->Phys.Sz,
X->Phys.s2,
X->Phys.doublon);
136 fprintf(
stdoutMPI,
"i=%5ld Energy=%10lf N=%10lf Sz=%10lf S2=%10lf Doublon=%10lf \n", i,
X->Phys.energy, tmp_N,
137 X->Phys.Sz,
X->Phys.s2,
X->Phys.doublon);
141 else if (
X->Def.iCalcType == CG)
142 fprintf(
stdoutMPI,
"i=%5ld Energy=%10lf N=%10lf Sz=%10lf Doublon=%10lf \n", i,
X->Phys.energy, tmp_N,
143 X->Phys.Sz,
X->Phys.doublon);
144 X->Phys.all_energy[i] =
X->Phys.energy;
145 X->Phys.all_doublon[i] =
X->Phys.doublon;
146 X->Phys.all_sz[i] =
X->Phys.Sz;
147 X->Phys.all_s2[i] =
X->Phys.s2;
148 X->Phys.all_num_up[i] =
X->Phys.num_up;
149 X->Phys.all_num_down[i] =
X->Phys.num_down;
void exitMPI(int errorcode)
MPI Abortation wrapper.
int expec_cisajscktaltdc(struct BindStruct *X, double complex *vec)
Parent function to calculate two-body green's functions.
int expec_totalspin(struct BindStruct *X, double complex *vec)
Parent function of calculation of total spin.
void phys(struct BindStruct *X, unsigned long int neig)
A main function to calculate physical quantities by full diagonalization method.
int expec_cisajs(struct BindStruct *X, double complex *vec)
function of calculation for one body green's function
int expec_energy_flct(struct BindStruct *X)
Parent function to calculate expected values of energy and physical quantities.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()