Top Page > Browsing
Absolute eigenvalue's index in conjunction with Absolute eigenvalue and Chemical Potential
Date: 2018/05/01 23:16
Name: Riemann

Dear OpenMX experts,

For future use, I have to extract the index of Absolute eigenvalue which is written in the uppermost part of LUMO at given k-point. I've found that one of the simplest ways is printing it alongside Absolute eigenvalue and Chemical Potential in the uppermost part of each LUMO cube file by manipulating lines 2142-2146 of "OutData.c" file-only for LUMO part. So I decided to apply the desired change and recompile it again. Now my question is: Which parameter within "OutData.c" indicates the Absolute eigenvalue's index at given k-point? Herewith I've attached the lines 2142-2146 of "OutData.c" file for your consideration.

Any help is highly appreciated.

Bests,
Riemann
=====================================================================================
else {
fprintf(fp," Absolute eigenvalue=%10.7f (Hartree) Relative eigenvalue=%10.7f (Hartree) EigenValue_flag=%10.7f\n",
EigenValue,EigenValue-ChemP,EigenValue_flag);
fprintf(fp," Chemical Potential=%10.7f (Hartree)\n",ChemP);
}
=====================================================================================
メンテ
Page: [1]

Re: Absolute eigenvalue's index in conjunction with Absolute eigenvalue and Chemical Potential ( No.1 )
Date: 2018/05/02 01:32
Name: Naoya Yamaguchi

Dear Riemann,

I believe that the current user interface is intuitive and user-friendly, and OpenMX has the function of "the cluster calculation" ("Cluster_DFT.c") so that this UI is appropriate, and guess from similarities between the codes that the calculation of HOMO or LUMO for the band calculation is based on that for the cluster calculation, but I leave information about that in the case of the band calculation.

There are no variables indicating "absolute" band indices in "OutData.c". The calculation of HOMO or LUMO is actually performed in "Band_DFT_MO.c", and you can find an array named EIGEN storing eigenvalues: EIGEN[(k-point index)][spin index][(band index)] (the collinear band calculation); EIGEN[(k-point index)][(band index)] (the non-collinear band calculation).

The following is the part you should check first.

(Collinear case) Lines 552-616 in the function "Band_DFT_MO_Col" in "Band_DFT_MO.c":
/****************************************************
LCAO coefficients are stored for calculating
values of MOs on grids
****************************************************/

nhomos = num_HOMOs;
nlumos = num_LUMOs;

if (SpinP_switch==0){
if ( (Bulk_HOMO[kloop][0]-nhomos+1)<1 ) nhomos = Bulk_HOMO[kloop][0];
if ( (Bulk_HOMO[kloop][0]+nlumos)>n ) nlumos = n - Bulk_HOMO[kloop][0];
}
else if (SpinP_switch==1){
if ( (Bulk_HOMO[kloop][0]-nhomos+1)<1 ) nhomos = Bulk_HOMO[kloop][0];
if ( (Bulk_HOMO[kloop][1]-nhomos+1)<1 ) nhomos = Bulk_HOMO[kloop][1];
if ( (Bulk_HOMO[kloop][0]+nlumos)>n ) nlumos = n - Bulk_HOMO[kloop][0];
if ( (Bulk_HOMO[kloop][1]+nlumos)>n ) nlumos = n - Bulk_HOMO[kloop][1];
}

/* HOMOs */
for (spin=0; spin<=SpinP_switch; spin++){
for (j=0; j<nhomos; j++){

j1 = Bulk_HOMO[kloop][spin] - j;

/* store eigenvalues */
HOMOs_Coef[kloop][spin][j][0][0].r = EIGEN[kloop][spin][j1];

/* store eigenvector */
for (GA_AN=1; GA_AN<=atomnum; GA_AN++){
wanA = WhatSpecies[GA_AN];
tnoA = Spe_Total_CNO[wanA];
Anum = MP[GA_AN];
for (i=0; i<tnoA; i++){
HOMOs_Coef[kloop][spin][j][GA_AN][i].r = C[spin][j1][Anum+i].r;
HOMOs_Coef[kloop][spin][j][GA_AN][i].i = C[spin][j1][Anum+i].i;
}
}
}
}

/* LUMOs */
for (spin=0; spin<=SpinP_switch; spin++){
for (j=0; j<nlumos; j++){

j1 = Bulk_HOMO[kloop][spin] + 1 + j;

/* store eigenvalue */
LUMOs_Coef[kloop][spin][j][0][0].r = EIGEN[kloop][spin][j1];

/* store eigenvector */
for (GA_AN=1; GA_AN<=atomnum; GA_AN++){
wanA = WhatSpecies[GA_AN];
tnoA = Spe_Total_CNO[wanA];
Anum = MP[GA_AN];
for (i=0; i<tnoA; i++){
LUMOs_Coef[kloop][spin][j][GA_AN][i].r = C[spin][j1][Anum+i].r;
LUMOs_Coef[kloop][spin][j][GA_AN][i].i = C[spin][j1][Anum+i].i;
}
}
}
}

Bulk_Num_HOMOs[kloop] = nhomos;
Bulk_Num_LUMOs[kloop] = nlumos;


(Non-collinear case) Lines 1492-1551 in the function "Band_DFT_MO_NonCol" in "Band_DFT_MO.c":

/****************************************************
LCAO coefficients are stored for calculating
values of MOs on grids
****************************************************/

nhomos = num_HOMOs;
nlumos = num_LUMOs;

if ( (Bulk_HOMO[kloop][0]-nhomos+1)<1 ) nhomos = Bulk_HOMO[kloop][0];
if ( (Bulk_HOMO[kloop][0]+nlumos)>MaxN) nlumos = MaxN - Bulk_HOMO[kloop][0];

/* HOMOs */

for (j=0; j<nhomos; j++){

j1 = Bulk_HOMO[kloop][0] - j;

/* store eigenvalue */
HOMOs_Coef[kloop][0][j][0][0].r = EIGEN[kloop][j1];
HOMOs_Coef[kloop][1][j][0][0].r = EIGEN[kloop][j1];

/* store eigenvector */
for (GA_AN=1; GA_AN<=atomnum; GA_AN++){
wanA = WhatSpecies[GA_AN];
tnoA = Spe_Total_CNO[wanA];
Anum = MP[GA_AN];
for (i=0; i<tnoA; i++){
HOMOs_Coef[kloop][0][j][GA_AN][i].r = H[Anum+i][j1].r;
HOMOs_Coef[kloop][0][j][GA_AN][i].i = H[Anum+i][j1].i;
HOMOs_Coef[kloop][1][j][GA_AN][i].r = H[Anum+i+n][j1].r;
HOMOs_Coef[kloop][1][j][GA_AN][i].i = H[Anum+i+n][j1].i;
}
}
}

/* LUMOs */
for (j=0; j<nlumos; j++){

j1 = Bulk_HOMO[kloop][0] + 1 + j;

/* store eigenvalue */
LUMOs_Coef[kloop][0][j][0][0].r = EIGEN[kloop][j1];
LUMOs_Coef[kloop][1][j][0][0].r = EIGEN[kloop][j1];

/* store eigenvector */
for (GA_AN=1; GA_AN<=atomnum; GA_AN++){
wanA = WhatSpecies[GA_AN];
tnoA = Spe_Total_CNO[wanA];
Anum = MP[GA_AN];
for (i=0; i<tnoA; i++){
LUMOs_Coef[kloop][0][j][GA_AN][i].r = H[Anum+i][j1].r;
LUMOs_Coef[kloop][0][j][GA_AN][i].i = H[Anum+i][j1].i;
LUMOs_Coef[kloop][1][j][GA_AN][i].r = H[Anum+i+n][j1].r;
LUMOs_Coef[kloop][1][j][GA_AN][i].i = H[Anum+i+n][j1].i;
}
}
}

Bulk_Num_HOMOs[kloop] = nhomos;
Bulk_Num_LUMOs[kloop] = nlumos;


In addition, you can find an array storing the corresponding eigenvectors as C[(spin index)][(band index)][(PAO index)] (collinear) or H[(PAO index)][(band index)] (non-collinear), and modify the above part and the related part of "OutData.c" to add the function you want.

And, you can use "openmx_common.h" to share some variables (including arrays) as global ones between different functions you will prapare by yourself.

Regards,
Naoya Yamaguchi
メンテ

Page: [1]

Thread Title (must) Move the thread to the top
Your Name (must)
E-Mail (must)
URL
Password (used in modification of the submitted text)
Comment (must)

   Save Cookie