1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
/**********************************************************************
TRAN_Calc_CentGreen.c:
TRAN_Calc_CentGreen.c is a subroutine to calculate the Green's
function of the central part: G(w) = ( w SCC - HCC - SigmaL -SigmaR ) ^-1
Log of TRAN_Calc_CentGreen.c:
11/Dec/2005 Released by H.Kino
***********************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef nompi
#include "mimic_mpi.h"
#else
#include <mpi.h>
#endif
#include "tran_prototypes.h"
void TRAN_Calc_CentGreen(
/* input */
dcomplex w,
int nc,
dcomplex *sigmaL,
dcomplex *sigmaR,
dcomplex *HCC,
dcomplex *SCC,
/* output */
dcomplex *GC)
#define HCC_ref(i,j) HCC[nc*((j)-1)+(i)-1]
#define SCC_ref(i,j) SCC[nc*((j)-1)+(i)-1]
#define GC_ref(i,j) GC[nc*((j)-1)+(i)-1]
#define sigmaL_ref(i,j) sigmaL[nc*((j)-1)+(i)-1]
#define sigmaR_ref(i,j) sigmaR[nc*((j)-1)+(i)-1]
{
int i,j;
/* w SCC - HCC - SigmaL - SigmaR */
for (i=1; i<=nc; i++) {
for (j=1; j<=nc; j++) {
GC_ref(i,j).r = w.r*SCC_ref(i,j).r - w.i*SCC_ref(i,j).i - HCC_ref(i,j).r
- sigmaL_ref(i,j).r - sigmaR_ref(i,j).r;
GC_ref(i,j).i = w.r*SCC_ref(i,j).i + w.i*SCC_ref(i,j).r - HCC_ref(i,j).i
- sigmaL_ref(i,j).i - sigmaR_ref(i,j).i;
}
}
Lapack_LU_Zinverse(nc,GC);
}
|