File: tran_prototypes.h

package info (click to toggle)
openmx 3.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 325,856 kB
  • ctags: 3,575
  • sloc: ansic: 152,655; f90: 2,080; python: 876; makefile: 675; sh: 25; perl: 18
file content (750 lines) | stat: -rw-r--r-- 18,789 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
#include "f77func.h"
#ifdef blaswrap
#define zgemm_ f2c_zgemm
#define zcopy_ f2c_zcopy
#endif
      
#ifndef ___dcomplex_definition___
typedef struct { double r,i; } dcomplex;
#define ___dcomplex_definition___ 
#endif

#define z_mul_inline(x,y,z) { z.r= x.r*y.r-x.i*y.i;  z.i = x.r * y.i + x.i*y.r; }
#define z_exp_inline(x,z) {double _t; _t=exp(x.r);  z.r = _t*cos(x.i); z.i = _t*sin(x.i); }

#ifndef __sqr_definition___
#define sqr(x)   ( (x)*(x) )
#define __sqr_definition___
#endif


#ifndef Host_ID
#define Host_ID 0
#endif


#ifndef YOUSO10
#define YOUSO10 100
#endif

#ifndef Shift_K_Point
#define Shift_K_Point    1.0e-6      /* disturbance for stabilization of eigenvalue routine */
#endif


int Lapack_LU_Zinverse(int , dcomplex *);



/*** TRAN_PROTOTYPES ***/

/* TRAN_Allocate.c  */
void TRAN_Allocate_Atoms(
    int atomnum    
);

/* TRAN_Allocate.c  */
void TRAN_Deallocate_Atoms( void );

/* TRAN_Allocate.c  */
void TRAN_Allocate_Cregion( 
     MPI_Comm mpi_comm_level1,  
     int  SpinP_switch, 
     int atomnum,
     int *WhatSpecies,
     int *Spe_Total_CNO 
     ) ;

/* TRAN_Allocate.c  */
void TRAN_Deallocate_Cregion(int SpinP_switch);

/* in TRAN_Allocate.c  */
void TRAN_Allocate_Lead_Region( MPI_Comm mpi_comm_level1 ); 

/* in TRAN_Allocate.c  */
void TRAN_Deallocate_Lead_Region();

/* TRAN_Deallocate_Electrode_Grid.c */
void TRAN_Deallocate_Electrode_Grid(int Ngrid2);

/* TRAN_Deallocate_RestartFile.c */
void TRAN_Deallocate_RestartFile(char *position);


/* TRAN_Apply_Bias2e.c  */
void  TRAN_Apply_Bias2e(
       MPI_Comm comm1,
       int side,
       double voltage,  
       double TRAN_eV2Hartree,
       int SpinP_switch,
       int atomnum,
       int *WhatSpecies,
       int *Spe_Total_CNO,
       int *FNAN,
       int **natn,
       int Ngrid1,
       int Ngrid2,
       int Ngrid3,
        double ****OLP,
        double *ChemP, 
        double *****H, 
        double *dVHart_Grid
);

/* TRAN_Calc_CentGreen.c  */
void TRAN_Calc_CentGreen(
                      dcomplex w,
                      int nc, 
                      dcomplex *sigmaL,
                      dcomplex *sigmaR, 
                      dcomplex *HCC,
                      dcomplex *SCC,
                      dcomplex *GC  
                      );

/* TRAN_Calc_CentGreenLesser.c  */
void TRAN_Calc_CentGreenLesser(
                      /* input */
                      dcomplex w,
                      double ChemP_e[2],
                      int nc, 
                      int Order_Lead_Side[2],
                      dcomplex *SigmaL,
                      dcomplex *SigmaL_Ad,
                      dcomplex *SigmaR, 
                      dcomplex *SigmaR_Ad, 
                      dcomplex *GC, 
                      dcomplex *GC_Ad, 
                      dcomplex *HCCk, 
                      dcomplex *SCC, 

                      /* work, nc*nc */
                      dcomplex *v1, 
                      dcomplex *v2,
 
                      /*  output */ 
                      dcomplex *Gless 
                      );


 
/* TRAN_Calc_GridBound.c  */
void TRAN_Calc_GridBound(MPI_Comm mpi_comm_level1,
			 int atomnum,
			 int *WhatSpecies,
			 double *Spe_Atom_Cut1,
			 int Ngrid1, 
			 double *Grid_Origin, 
			 double **Gxyz,
			 double tv[4][4],
			 double gtv[4][4],
			 double rgtv[4][4],
			 double Left_tv[4][4],
			 double Right_tv[4][4]);

/* TRAN_Calc_OneTransmission.c  */
void TRAN_Calc_OneTransmission(
   int nc, 
   dcomplex *SigmaL_R,   /* at w, changed when exit */
   dcomplex *SigmaL_A,   /* at w, changed when exit */
   dcomplex *SigmaR_R,   /* at w, changed when exit */
   dcomplex *SigmaR_A,   /* at w, changed when exit */
   dcomplex *GC_R,       /* at w, changed when exit */
   dcomplex *GC_A,       /* at w, changed when exit */
   dcomplex *v1,         /* work */
   dcomplex *v2,         /* work */
   dcomplex *value       /* output, transmission */
   );


/* TRAN_Calc_OneTransmission2.c  */
void TRAN_Calc_OneTransmission2(
				dcomplex w,
				int nc, 
				dcomplex *SigmaL,   /* at w, changed when exit */
				dcomplex *SigmaR,   /* at w, changed when exit */
				double *HCC,
				double *SCC,
				dcomplex *GR,       /* at w, changed when exit */
				dcomplex *v1,       /* work */
				dcomplex *v2,       /* work */
				dcomplex *value     /* output, transmission */
				);


/* TRAN_Calc_SelfEnergy.c  */
void TRAN_Calc_SelfEnergy( 
            dcomplex w,  
            int ne,     
            dcomplex *gr,  
            int nc,
            dcomplex *hce,    
            dcomplex *sce,    
            dcomplex *sigma   
          );


/* TRAN_Calc_Hopping_G.c */
void TRAN_Calc_Hopping_G(
                         /* input */
			 dcomplex w,
			 int ne,          /* size of electrode */ 
			 int nc,          /* size of central region */
			 dcomplex *gs,    /* surface green function of electrode, size=ne*ne */
			 dcomplex *gc,    /* green function of central region, size=nc*nc    */
			 dcomplex *hce,   /* e.g., HCL,    size=nc*ne */
			 dcomplex *sce,   /* e.g., SCL,    size=nc*ne */

                         /* output */
			 dcomplex *gh     /* e.g., GCL_R , size=nc*ne */
			 );


/* TRAN_Calc_SurfGreen.c  */
void TRAN_Calc_SurfGreen_direct(
				dcomplex w,
				int n, 
				dcomplex *h00, 
				dcomplex *h01,
				dcomplex *s00,
				dcomplex *s01,
                                int iteration_max,
                                double eps,
	 			dcomplex *gr  
				);

/* TRAN_Calc_Transmission.c  */
double TRAN_Calc_Transmission(
		int iter, 
		int SpinP_switch,
		double *****nh,   
		double *****ImNL,  
		double ****CntOLP, 
		int atomnum,
		int Matomnum,
		int *WhatSpecies,
		int *Spe_Total_CNO,
		int *FNAN,
		int **natn, 
		int **ncn,
		int *M2G, 
		int **atv_ijk,
		int *List_YOUSO
);


/* TRAN_Connect_Read_Density.c  */
void TRAN_Connect_Read_Density(
    char *filename,
    int SpinP_switch,
    int Ngrid1, 
    int Ngrid2, 
    int Ngrid3,
    double *ChemP,
    double *minE, 
    double *dVHart_Grid,
    double **Vpot_Grid,
    double **Density_Grid
);

/* TRAN_Connect_Read_Hamiltonian.c  */
/* *static
 * void compare_and_print_error(char *buf,char *str,int val1,int val2);*/
/* TRAN_Connect_Read_Hamiltonian.c  */
void TRAN_Connect_Read_Hamiltonian(
    char *filename, 
    int SpinP_switch, 
    int *WhatSpecies,
    int *FNAN, 
    int **natn,
    int **ncn, 
    int *Spe_Total_CNO, 
    double *****H, 
    double ****OLP
);

/* TRAN_Credit.c  */
void TRAN_Credit(MPI_Comm comm1);

/* TRAN_DFT.c  */
/* *static
 * void TRAN_Set_CDM(
 *    MPI_Comm comm1, 
 *    int spin,
 *    int Matomnum,
 *    int *M2G,
 *    int *WhatSpecies,
 *    int *Spe_Total_CNO,
 *    int *MP,
 *    int *FNAN,
 *    int**natn,
 *    dcomplex *v,
 *    int NUM_c,
 *    dcomplex w_weight, 
 *    int mode,   
 *    double *****CDM,
 *    double *****EDM,
 *    double ***TRAN_DecMulP, 
 *    double Eele0[2], double Eele1[2], 
 *    double ChemP_e0[2]
 *);*/
/* TRAN_DFT.c  */
double TRAN_DFT(
                MPI_Comm comm1,
                int SucceedReadingDMfile, 
                int level_stdout,
		int iter, 
		int SpinP_switch,
		double *****nh,   
		double *****ImNL,  
		double ****CntOLP, 
		int atomnum,
		int Matomnum,
		int *WhatSpecies,
		int *Spe_Total_CNO,
		int *FNAN,
		int **natn, 
		int **ncn,
		int *M2G, 
		int *G2ID, 
                int *F_G2M, 
		int **atv_ijk,
		int *List_YOUSO,
		double *****CDM,   
		double *****EDM,   
                double ***TRAN_DecMulP,
		double Eele0[2], double Eele1[2], 
                double ChemP_e0[2]);

/* TRAN_DFT_Dosout.c  */
double TRAN_DFT_Dosout(
                MPI_Comm comm1,
                int level_stdout,
		int iter, 
		int SpinP_switch,
		double *****nh,   
		double *****ImNL,  
		double ****CntOLP, 
		int atomnum,
		int Matomnum,
		int *WhatSpecies,
		int *Spe_Total_CNO,
		int *FNAN,
		int **natn,  
		int **ncn,
		int *M2G, 
		int *G2ID, 
		int **atv_ijk,
		int *List_YOUSO,
                int **Spe_Num_CBasis,
                int SpeciesNum,
                char *filename,
                char *filepath,
		double *****CDM,   
		double *****EDM,   
		double Eele0[2], double Eele1[2])  ;

/* TRAN_Distribute_Node.c  */
void TRAN_Distribute_Node(
   int Start,int End,
   int numprocs,
   int *IDStart,
   int *IDEnd
 );

/* TRAN_Distribute_Node.c  */
void TRAN_Distribute_Node_Idx(
   int Start,int End,
   int numprocs,
   int eachiwmax,
   int **Idxlist
 );


/* TRAN_Input_std.c  */
void TRAN_Input_std(
  MPI_Comm comm1, 
  int Solver,           
  int SpinP_switch,  
  char *filepath,
  double kBvalue,
  double TRAN_eV2Hartree,  
  double Electronic_Temperature,
  int *output_hks
);

/* TRAN_Input_std_Atoms.c  */
void TRAN_Input_std_Atoms(  MPI_Comm comm1, int Solver );



/* TRAN_Output_HKS.c  */
int TRAN_Output_HKS(char *fileHKS);

/* TRAN_Output_HKS_Write_Grid.c  */
void TRAN_Output_HKS_Write_Grid(
				MPI_Comm comm1,
                                int mode,
				int Ngrid1,
				int Ngrid2,
				int Ngrid3,
				double *data,
				double *data1,
				double *data2,
				FILE *fp
				);

/* TRAN_Output_Trans_HS.c  */
/* revised by Y. Xiao for Noncollinear NEGF calculations */ /* iHNL is added */
void  TRAN_Output_Trans_HS(
        MPI_Comm comm1,
        int Solver,
        int SpinP_switch, 
        double ChemP ,
        double *****H,
        double *****iHNL,
        double *****OLP,
        int atomnum,
        int SpeciesNum,
        int *WhatSpecies,
        int *Spe_Total_CNO,
        int *FNAN,
        int **natn,
        int **ncn,
        int *G2ID,
        int **atv_ijk,
        int Max_FSNAN,
        double ScaleSize,
        int *F_G2M,      
        int TCpyCell,
        int *List_YOUSO,
        char *filepath,
        char *filename,
        char *fname  );
/* until here  by Y. Xiao for Noncollinear NEGF calculations */

/* TRAN_Output_Transmission.c  */ 
void TRAN_Output_Transmission(int SpinP_switch);

/* TRAN_Add_Density_Lead.c  */
void TRAN_Add_Density_Lead(
            MPI_Comm comm1,
            int SpinP_switch,
            int Ngrid1,
            int Ngrid2,
            int Ngrid3,
            int My_NumGridB_AB,
            double **Density_Grid_B);

/* TRAN_Add_ADensity_Lead.c */
void TRAN_Add_ADensity_Lead(
            MPI_Comm comm1,
            int SpinP_switch,
            int Ngrid1,
            int Ngrid2,
            int Ngrid3,
            int My_NumGridB_AB,
            double *ADensity_Grid_B);

/* TRAN_Poisson.c  */
double TRAN_Poisson(double *ReRhok, double *ImRhok);

/* FFT2D_Density.c  */
double FFT2D_Density(int den_flag, 
                     double *ReRhok, double *ImRhok);

/* Get_Value_inReal2D.c  */
void Get_Value_inReal2D(int complex_flag,
                        double *ReVr, double *ImVr, 
                        double *ReVk, double *ImVk);

/* TRAN_Print.c  */
void TRAN_Print2_set_eps(double e1);

/* TRAN_Print.c  */
void TRAN_Print2_set_max(int m1);

/* TRAN_Print.c  */
void TRAN_Print2_dcomplex(char *name, int n1,int n2,dcomplex *gc);

/* TRAN_Print.c  */
void TRAN_Print2_double(char *name, int n1,int n2,double *gc);

/* TRAN_Print.c  */
void TRAN_Print2_dx_dcomplex(char *name, int n1,int dx1, int n2,int dx2, dcomplex *gc);

/* TRAN_Print.c  */
void TRAN_Print2_dx_double(char *name, int n1,int dx1,int n2,int dx2,double *gc);

/* TRAN_Print.c  */
void TRAN_FPrint2_double(char *name, int n1,int n2,double *gc);

/* TRAN_Print.c  */
void TRAN_FPrint2_dcomplex(char *name, int n1,int n2,dcomplex *gc);

/* TRAN_Print.c  */
void TRAN_FPrint2_binary_double(FILE *fp, int n1,int n2,double *gc);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_Cell1(
  char *filename,
  int n1, int n2, int n3, 
   int *My_Cell1,
   double *realgrid
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_Cell0(
   char *filename,
   double origin[4],  
   double gtv[4][4],  
   int Ngrid1, int Ngrid2, int Ngrid3s, int Ngrid3e,   
   double  R[4],   
   int *Cell0,
   double *grid_value
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid(
   char *filename,
   double origin[4],  
   double gtv[4][4],  
   int Ngrid1, int Ngrid2, int Ngrid3s, int Ngrid3e,   
   double  R[4],   
   double *grid_value 
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_z(
   char *filename,
   double origin[4],  
   double gtv[4][4],  
   int Ngrid1, int Ngrid2, int Ngrid3s, int Ngrid3e,   
   double  R[4],   
   double *grid_value
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_c(
   char *filenamer,
   char *filenamei,
   double origin[4],  
   double gtv[4][4],  
   int Ngrid1, int Ngrid2, int Ngrid3s, int Ngrid3e,   
   double  R[4],   
   dcomplex *grid_value
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_v(
   char *filename,
   double origin[4],  
   double gtv[4][4],  
   int Ngrid1, int Ngrid2, int Ngrid3s, int Ngrid3e,   
   double  R[4],   
   double ***grid_value
);

/* TRAN_Print_Grid.c  */
void TRAN_Print_Grid_Startv(
   char *filename,
   int Ngrid1, int Ngrid2,  int Ngrid3,   
   int Start,
   double ***grid_value
);

/* TRAN_Read.c  */
void TRAN_Read_double(char *str, int n1,int n2, double *a);

/* TRAN_Read.c  */
void TRAN_Read_dcomplex(char *str, int n1,int n2, dcomplex *a);

/* TRAN_Read.c  */
void TRAN_FRead2_binary_double(FILE *fp, int n1, int n2, double *gc);

/* TRAN_RestartFile.c  */
int TRAN_Input_HKS( MPI_Comm comm1, char *fileHKS);

/* TRAN_RestartFile.c  */
int TRAN_RestartFile(MPI_Comm comm1, char *mode, char *position,char *filepath, char *filename);

/* TRAN_Set_CentOverlap.c  */
void TRAN_Set_CentOverlap( 
			   MPI_Comm comm1,
			   int job, 
			   int SpinP_switch, 
                           double k2,
                           double k3,
                           int *order_GA,
			   double **H1,
			   double *S1,
			   double *****H,  
			   double ****OLP,  
			   int atomnum,
			   int Matomnum,
 			   int *M2G, 
			   int *G2ID, 
			   int *WhatSpecies,
			   int *Spe_Total_CNO,
			   int *FNAN,
			   int **natn,
			   int **ncn, 
			   int **atv_ijk
			   );

/* TRAN_Set_Electrode_Grid.c  */
void TRAN_Set_Electrode_Grid(MPI_Comm comm1,
                             int *TRAN_Poisson_flag2,
			     double *Grid_Origin,   /* origin of the grid */
			     double tv[4][4],       /* unit vector of the cell*/
			     double Left_tv[4][4],  /* unit vector  left */
			     double Right_tv[4][4], /* unit vector right */
			     double gtv[4][4],      /* unit vector of the grid point, which is gtv*integer */
			     int Ngrid1,
			     int Ngrid2,
			     int Ngrid3             /* # of c grid points */
			     );


/* TRAN_Set_Electrode_Grid.c  */
/* *static
 * void  TRAN_FFT_Electrode_Grid(MPI_Comm comm1, int isign);*/
/* TRAN_Set_IntegPath.c  */
void TRAN_Set_IntegPath_Square(void);

/* TRAN_Set_IntegPath.c  */
void      TRAN_Set_IntegPath_ThermalArc(void);

/* TRAN_Set_IntegPath.c  */
void TRAN_Set_IntegPath( MPI_Comm comm1,
			 double TRAN_eV2Hartree,
			 double kBvalue, double Electronic_Temperature );

/* TRAN_Check_Input.c */
void TRAN_Check_Input( MPI_Comm comm1, int Solver );

/* TRAN_Set_MP.c  */
void TRAN_Set_MP(
        int job, 
        int atomnum, int *WhatSpecies, int *Spe_Total_CNO, 
        int *NUM,   
        int *MP     
);

/* TRAN_Set_PathEnergyStr.c  */
/* *static
 * void TRAN_error_and_exit(
 *    char *buf
 *);*/
/* TRAN_Set_PathEnergyStr.c  */
void TRAN_Set_PathEnergyStr_Square(
   int m,
   char **str,
   double default_relative_ene[4],  
   double tran_square_path_ene[4],  
   int    tran_square_path_ene_fix[4]
);


/* TRAN_Set_SurfOverlap.c  */
void TRAN_Set_SurfOverlap( MPI_Comm comm1, char *position, double k2, double k3 );

/* TRAN_Set_Value.c  */
void TRAN_Set_Value_double(dcomplex *A, int n, double a, double b);

/* TRAN_adjust_Ngrid.c  */
void  TRAN_adjust_Ngrid( MPI_Comm comm1, int *Ngrid1,int *Ngrid2, int *Ngrid3);


/* TRAN_Check_Region_Lead.c */
int TRAN_Check_Region_Lead(
		  int atomnum,
		    int *WhatSpecies, 
		      double *Spe_Atom_Cut1,
		        double **Gxyz,
			  double tv[4][4]
		);

/* TRAN_Check_Region.c */
int TRAN_Check_Region(
                      int atomnum,
                      int *WhatSpecies, 
                      double *Spe_Atom_Cut1,
                      double **Gxyz
                      );

/* revised by Y. Xiao for Noncollinear NEGF calculations */
double TRAN_DFT_NC(
                MPI_Comm comm1,
                int SucceedReadingDMfile,
                int level_stdout,
                int iter,
                int SpinP_switch,
                double *****nh,
                double *****ImNL,
                double ****CntOLP,
                int atomnum,
                int Matomnum,
                int *WhatSpecies,
                int *Spe_Total_CNO,
                int *FNAN,
                int **natn,
                int **ncn,
                int *M2G,
                int *G2ID,
                int *F_G2M,
                int **atv_ijk,
                int *List_YOUSO,
                double *koS,
                dcomplex **S,                
                double *****CDM,
                double *****iCDM,
                double *****EDM,
                double ***TRAN_DecMulP,
                double Eele0[2], double Eele1[2],
                double ChemP_e0[2]);

void TRAN_Allocate_Cregion_NC(MPI_Comm mpi_comm_level1,
                           int SpinP_switch,
                           int atomnum,
                           int *WhatSpecies,
                           int *Spe_Total_CNO
                           );

void TRAN_Deallocate_Cregion_NC(int SpinP_switch);

void TRAN_Allocate_Lead_Region_NC( MPI_Comm mpi_comm_level1 );

void TRAN_Deallocate_Lead_Region_NC();

void TRAN_Set_CentOverlap_NC(
                          MPI_Comm comm1,
                          int job,
                          int SpinP_switch,
                          double k2,
                          double k3,
                          int *order_GA,
                          double **H1,
                          double **H2,
                          double *S1,
                          double *****H,
                          double ****OLP,
                          int atomnum,
                          int Matomnum,
                          int *M2G,
                          int *G2ID,
                          int *WhatSpecies,
                          int *Spe_Total_CNO,
                          int *FNAN,
                          int **natn,
                          int **ncn,
                          int **atv_ijk
                          );

void TRAN_Set_SurfOverlap_NC( MPI_Comm comm1,
                           char *position,
                           double k2,
                           double k3);
/* until here by Y. Xiao for Noncollinear NEGF calculations */