Changeset f5586e for pcp/src/wannier.c


Ignore:
Timestamp:
Apr 22, 2008, 8:43:24 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
90c027
Parents:
cc46b0
Message:

RealBasisQ[] removed

RealBasisQ[] is again replaced by sqrt(RealBasisSQ[]) as we are going to switch to a pure matrix transformation for calculating whether points are still within the periodic cell and so forth instead of "hoping" the simulation box is rectangular.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified pcp/src/wannier.c

    rcc46b0 rf5586e  
    10591059      // calculate Wannier Centre
    10601060      for (j=0;j<NDIM;j++) {
    1061         WannierCentre[i][j] = Lat->RealBasisQ[j]/(2*PI) * GSL_IMAG( gsl_complex_log( gsl_complex_rect(gsl_matrix_get(A[j*2],i,i),gsl_matrix_get(A[j*2+1],i,i))));
     1061        WannierCentre[i][j] = sqrt(Lat->RealBasisSQ[j])/(2*PI) * GSL_IMAG( gsl_complex_log( gsl_complex_rect(gsl_matrix_get(A[j*2],i,i),gsl_matrix_get(A[j*2+1],i,i))));
    10621062        if (WannierCentre[i][j] < 0) // change wrap around of above operator to smooth 0...Lat->RealBasisSQ
    1063           WannierCentre[i][j] = Lat->RealBasisQ[j] + WannierCentre[i][j];
     1063          WannierCentre[i][j] = sqrt(Lat->RealBasisSQ[j]) + WannierCentre[i][j];
    10641064      }
    10651065     
     
    10931093    for (i=0; i < Num; i++) {  // go through all occupied wave functions
    10941094      for (j=0;j<NDIM;j++)
    1095         WannierCentre[i][j] = Lat->RealBasisQ[j]/2.;
     1095        WannierCentre[i][j] = sqrt(Lat->RealBasisSQ[j])/2.;
    10961096    }   
    10971097    break;
     
    11001100    for (i=0;i < Num; i++) {  // go through all wave functions
    11011101      for (j=0;j<NDIM;j++) {
    1102         tmp = WannierCentre[i][j]/Lat->RealBasisQ[j]*(double)N[j];
     1102        tmp = WannierCentre[i][j]/sqrt(Lat->RealBasisSQ[j])*(double)N[j];
    11031103        //fprintf(stderr,"(%i) N[%i]: %i\t tmp %e\t floor %e\t ceil %e\n",P->Par.me, j, N[j], tmp, floor(tmp), ceil(tmp));
    11041104        if (fabs((double)floor(tmp) - tmp) < fabs((double)ceil(tmp) - tmp))
    1105           WannierCentre[i][j] = (double)floor(tmp)/(double)N[j]*Lat->RealBasisQ[j];
     1105          WannierCentre[i][j] = (double)floor(tmp)/(double)N[j]*sqrt(Lat->RealBasisSQ[j]);
    11061106        else
    1107           WannierCentre[i][j] = (double)ceil(tmp)/(double)N[j]*Lat->RealBasisQ[j];
     1107          WannierCentre[i][j] = (double)ceil(tmp)/(double)N[j]*sqrt(Lat->RealBasisSQ[j]);
    11081108      }
    11091109    }
Note: See TracChangeset for help on using the changeset viewer.