This thread is locked.Only browsing is available.
Top Page > Browsing
Is an output wave function Bloch?
Date: 2015/10/17 14:38
Name: M. Yamada

Hi,

I am now confused by the description in the manual on output files.
http://www.openmx-square.org/openmx_man3.7/node22.html

If 'MO.fileout=ON' and 'scf.EigenvalueSolver=Band', what is a
generated wave function (such as*.homo*_*_*_*.cube files)?
An actual wave function (non-periodic)?
Or a Bloch wave function (periodic w.r.t. the lattice vectors)?

And how should I convert from one to the other?

Best regards,

Masahiko Yamada
メンテ
Page: [1]

Re: Is outputted wave function Bloch? ( No.1 )
Date: 2015/10/16 19:40
Name: Artem Pulkin

Hi,

You can plot and check whether it is periodic or not. AFAIK the "actual wave function" is plotted by OpenMX.

Since those two are connected through an exponent it is easy to get one from another in real space. However I do not see any single point of having the Bloch function in real space.

Regards,

Artem
メンテ
Re: Is an output wave function Bloch? ( No.2 )
Date: 2015/10/17 14:41
Name: M. Yamada

Hi, Artem,

Thank you for your kind reply to my stupid question,
I have seen that an output file is non-periodic and written up a simple program
to convert from non-periodic to periodic.
Finally, I managed to get a periodic Bloch wave function.

#define _USE_MATH_DEFINES
#include <math.h>
#include <complex>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main(int argc,char* argv[]){
complex<double> c,d;
double ka,kb,kc;
int na,nb,nc;
int i,j,k,a;
double x,y,z;
string re,im;
double rea,ima;
if(argc!=3){
cout << "Use ./a.out realpartfile imaginarypartfile."<< endl;
return 0;
}
cout << "real part:" <<argv[1]<<endl;
cout << "imag part:" <<argv[2]<<endl;
ifstream real(argv[1]);
ifstream imag(argv[2]);
if(real.fail()||imag.fail()){
cout << "Unreadable file."<<endl;
return 0;
}
ofstream oreal("out_r.cube");
ofstream oimag("out_i.cube");
getline(real,re);
oreal <<re<<endl;
getline(real,re);
oreal <<re<<endl;
real>>a>>x>>y>>z;
oreal <<a<<" "<<x<<" "<<y<<" "<<z<<endl;
real>>na>>x>>y>>z;
oreal <<na<<" "<<x<<" "<<y<<" "<<z<<endl;
real>>nb>>x>>y>>z;
oreal <<nb<<" "<<x<<" "<<y<<" "<<z<<endl;
real>>nc>>x>>y>>z;
oreal <<nc<<" "<<x<<" "<<y<<" "<<z;
for(i=0;i<a;i++){
getline(real,re);
oreal <<re<<endl;
}
getline(imag,im);
oimag <<im<<endl;
getline(imag,im);
oimag <<im<<endl;
imag>>a>>x>>y>>z;
oimag <<a<<" "<<x<<" "<<y<<" "<<z;
for(i=0;i<a+3;i++){
getline(imag,im);
oimag <<im<<endl;
}

cout << "k?" << endl;
cin >>ka>>kb>>kc;
for(i=0;i<na;i++) for(j=0;j<nb;j++) for(k=0;k<nc;k++){
real >>rea;
imag >>ima;
c=complex<double>(rea,ima);
d=c*polar(1.0,-(2.0*M_PI*ka*i/na+2.0*M_PI*kb*j/nb+2.0*M_PI*kc*k/nc));
oreal <<d.real()<<" ";
oimag <<d.imag()<<" ";
}
return 0;
}

Regards,

Masahiko
メンテ
Re: Is an output wave function Bloch? ( No.3 )
Date: 2015/10/18 00:35
Name: M. Yamada

There was a stupid mistake in my code

:
:
for(i=0;i<a+1;i++){
getline(real,re);
oreal <<re<<endl;
}
getline(imag,im);
oimag <<im<<endl;
getline(imag,im);
oimag <<im<<endl;
imag>>a>>x>>y>>z;
oimag <<a<<" "<<x<<" "<<y<<" "<<z;
for(i=0;i<a+4;i++){
getline(imag,im);
oimag <<im<<endl;
}
:
:

is correct.
メンテ

Page: [1]