PatrizioGraziosi / EMAF-code

Effective Mass Finder code, to extract comprehensive effective masses for the density of states and the conductivity in arbitrary band structures.
5 stars 0 forks source link

Supported DFT codes of this project. #1

Open hongyi-zhao opened 3 years ago

hongyi-zhao commented 3 years ago

Which DFT codes are supported by this project, say, quantum espresso, vasp, wien2k, and so on?

Regards, HY

PatrizioGraziosi commented 3 years ago

Hi, the code can interface with every DFT code which can save the bandstructure in the .bxsf format. After the DFT calc., whichever code you prefer, you should save the results as a .bxsf file.

Then, you can use the https://github.com/PatrizioGraziosi/Extraction-from-bsxf-files project to extract a .mat file from your bxsf file. This file will be the input for the EMAF code project.

Hope this helps.

Keep me posted, please.

Patrizio

PatrizioGraziosi commented 3 years ago

the code can interface with every DFT code which can save the bandstructure in the .bxsf format. After the DFT calc., whichever code you prefer, you should save the results as a .bxsf file.

Then, you can use the https://github.com/PatrizioGraziosi/Extraction-from-bsxf-files project to extract a .mat file from your bxsf file. This file will be the input for the EMAF code project.

Hope this helps.

Keep me posted, please.

Patrizio

Il giorno sab 20 mar 2021 alle ore 07:40 hongyi-zhao < @.***> ha scritto:

Which DFT codes are supported by this project, say, quantum espresso, vasp, wien2k, and so on?

Regards, HY

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PatrizioGraziosi/EMAF-code/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCPJIVYFNGFVNNV3SYYOFTTEQ7ONANCNFSM4ZQD4SKQ .

hongyi-zhao commented 3 years ago

Thank you for your reply. I'll give it a try with quantum espresso. Some other questions/suggestions:

  1. Why do you use the close source MATLAB to implement this project, instead of other more popular languages, say, python, FORTRAN, etc.?
  2. It would be better to add some examples for different DFT codes.
  3. Why you reply twice with the same comments?
PatrizioGraziosi commented 3 years ago

Hi Hongyi,

thanks for your interest. About your questions:

  1. I used Matlab because it has a lot of built-in functions, already tested and debugged, with a large support community, which allows much faster coding, for example the EMAF code is few hundreds of lines but if I port it in C it becomes more than five times longer. Matlab is also widely used among engineers and companies and is compatible with other codes like simulink and comsol. Python does not add that much in computation time as it is an interpreted language as well. The only reason to go for Fortran is speed, but since the EMAF code runs in a few seconds in a single cpu I don't see a practical reason to do it. Differently, I'm porting the ELECTRA code in C for speed reasons...

2.When you ask for examples for DFT code, do you mean something as follows for the case of QE? A) scf calculation input &control prefix='Material', pseudo_dir = './', outdir='./' wf_collect=.true. etot_conv_thr = 1.0d-9, / &system ibrav= 2, celldm(1) = 8.50565729, nat= 3, ntyp= 2, ecutwfc = 300.0, ecutrho = 2500.0, / &electrons conv_thr = 1.0d-9, mixing_beta = 0.7, / ATOMIC_SPECIES at1 24.305 at1.upf at2 28.085 at2.upf ATOMIC_POSITIONS crystal at1 0.25 0.25 0.25 at2 0.75 0.75 0.75 at1 0 0 0 K_POINTS automatic 21 21 21 0 0 0

      launch command

mpirun pw.x -npool 24 -input scf.in > Material.out

B) nscf calculation

             input

&control prefix='Material', pseudo_dir = './', outdir='./' wf_collect=.true. etot_conv_thr = 1.0d-8, calculation = 'nscf', / &system ibrav= 2, celldm(1) = 8.50565729, nat= 3, ntyp= 2, ecutwfc = 60.0, occupations = 'tetrahedra', / &electrons conv_thr = 1.0d-8 mixing_beta = 0.7 / ATOMIC_SPECIES at1 24.305 at1.upf at2 28.085 at2.upf ATOMIC_POSITIONS crystal at1 0.25 0.25 0.25 at2 0.75 0.75 0.75 at1 0 0 0 K_POINTS automatic 71 71 71 0 0 0

     launch command

mpirun pw.x -npool 24 -input nscf.in > Material_nscf.out

C) bxsf file composition

input

&fermi outdir = './', prefix = 'Material', deltaE = 3 /

  launch command (fs.x is serial)

fs.x -input fs.in > Material_fermi.out

a file Material.bxsf will be saved in the working directory. This will be used, together the alat value which is in the .out file, for the "Extraction_from_bxsf" routines to compose the input file for the EMAF code. In this way, you can use every DFT code capable of writing a bxsf file. Please, remember to use the scripts in https://github.com/PatrizioGraziosi/Extraction-from-bsxf-files ; if you use the files into the EMAF project you might receive an error if the k-mesh has different sampling in the different directions or if the total numbers of k-points is a multiple of 6...I'll add updated files asap.

Thanks, Patrizio

Il giorno sab 20 mar 2021 alle ore 16:47 hongyi-zhao < @.***> ha scritto:

Thank you for your reply. I'll give it a try with quantum espresso. Some other questions:

  1. Why do you use the close source MATLAB to implement this project, instead of other more popular languages, say, python, FORTRAN, etc.?
  2. It would be better to add some examples for different DFT codes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PatrizioGraziosi/EMAF-code/issues/1#issuecomment-803384468, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCPJIRDRFAWH5ZQAI6AF43TES7RXANCNFSM4ZQD4SKQ .

hongyi-zhao commented 3 years ago

Dear @PatrizioGraziosi, thank you very much for your reply. I give the further discussion/comment as follows:

  1. Thank you for your explanations. Some other questions/considerations:
  1. Yep, thanks for your example. I'll try to compare EMAF-code's results with other similar methods for a well studied material (e.g. Si, GaAs).

Best, Hongyi

PatrizioGraziosi commented 3 years ago

Hi Hongyi,

thanks for your comments. About the point of porting in C vs Fortran, I think your point is good and I have to think about, I reckon it's 15 years I don't code in Fortran and it would take to me a lot of time in porting line-by-line, while Matlab have a "translator" from Matlab to C which makes the thing much faster and smooth, saving a lot of time to me.

About the EMAF code, yes, it is based on charge transport theory and aims to extract the comprehensive band structure effective masses which are relevant in charge transport. The mstar project you mention computes the effective mass as the (inverse of) second derivative of the energy versus wave-vector. It is useful since it is local both in the k-space and energy - you can compute the effective mass for a certain band at a certain point of the BZ and a certain energy. Although it has a strong and immediate relation to the electronic structure, it is not directly related to charge transport. As I've shown in the manual's figure, for example, the conductivity effective mass found by EMAF can be used to approximate the charge transport, this is the objective of EMAF: extract for a certain band structure simple parameters which are meaningful for charge transport. The Seebeck effective mass should be somehow related to the DOS effective mass even if I'm not sure about the underlying hypothesis of this specific expression of the Seebeck coefficient, I have to read more about it.

About the isotropic/anisotropic point, for the DOS it does not matter as the DOS(E) is a scalar. For the conductivity, the code uses the isotropic approximation for each crystalline direction separately (it's a matter of the employed equations), so the conductivity effective masses are computed separately for the three cartesian directions x, y, and z and, for anisotropic bands, you'll get different conductivity effective mass for the three directions. These are labelled me_inj_x me_inj_y me_inj_z mh_inj_x mh_inj_y mh_inj_z for electrons and holes respectively.

Then, they are combined with the known equation 3/(1/mx+1/my+1/mz) to get a single number, but the three numbers for three space directions are computed, and saved, separately.

Patrizio

Il giorno lun 22 mar 2021 alle ore 15:07 hongyi-zhao < @.***> ha scritto:

Dear @PatrizioGraziosi https://github.com/PatrizioGraziosi, thank you very much for your reply. I give the further discussion/comment as follows:

  1. Thank you for your explanations. Some other questions/considerations:

  2. Yep, thanks for your example. I'll try to compare EMAF-code's results with other similar methods using the same well known material, say, Si and graphene.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PatrizioGraziosi/EMAF-code/issues/1#issuecomment-804089890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCPJIUWUD4LCDIEFFILME3TE5FJBANCNFSM4ZQD4SKQ .

hongyi-zhao commented 3 years ago
  1. I find the following MATLAB to FORTRAN converters: mc2for with its GitHub repo and matlab2fortran, as well as a C to Fortran converter (C2F.ZIP), referred on comp.lang.fortran newsgroup here. Hope the above codes/projectes can help you, to some extent, reduce your workload.
  2. Thank you very much for your comments on the effective mass relative literatures, I have to read more about them, too.
  3. Thank you very much again for your commenting about the isotropic/anisotropic point. As a further complementary comment, I'm currently reading and studying this paper by Dr. Lucy Whalley. You can check out a more detailed discussion here, if you're interested.

Regards, Hongyi

hongyi-zhao commented 3 years ago

while Matlab have a "translator" from Matlab to C

Do you mean MATLAB Coder? It seems like a really great tool.

PatrizioGraziosi commented 3 years ago

Hi Hongyi,

it's called matlab coder, it can be run from the app tab (GUI-like) or by command line.

Thank you so much for the C2F converter! I am curious to explore the different speeds.

Patrizio

Il giorno gio 1 apr 2021 alle ore 07:07 hongyi-zhao < @.***> ha scritto:

while Matlab have a "translator" from Matlab to C

I have never heard of it. Do you mean Matlab has this built-in feature/module/tool?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PatrizioGraziosi/EMAF-code/issues/1#issuecomment-811641360, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCPJIQ4I64A3F4ING7QQU3TGP5SHANCNFSM4ZQD4SKQ .

hongyi-zhao commented 3 years ago

Thank you so much for the C2F converter! I am curious to explore the different speeds.

Have you compiled this tool on the *nix platform, or directly run the pre-compiled Windows binary file? To be frank, I failed to compile and run it on Ubuntu 20.04.

For reference, I recently heard of another framework that can build C to Fortran translator. See here for more info.

Hongyi

PatrizioGraziosi commented 3 years ago

Hi Hongyi,

I'm actually piled up with a bunch of things and I couldn't try it yet, sorry. Patrizio

Il giorno ven 2 apr 2021 alle ore 15:16 hongyi-zhao < @.***> ha scritto:

Thank you so much for the C2F converter! I am curious to explore the different speeds.

Have you compiled this tool on the *nix platform, or directly run the pre-compiled Windows binary file? To be frank, I failed to compile and run it on Ubuntu 20.04.

FYI, I learned another framework https://github.com/rose-compiler/rose which can build a C to Fortran translator. See here https://github.com/rose-compiler/rose/issues/156#issuecomment-810572239 for more info.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PatrizioGraziosi/EMAF-code/issues/1#issuecomment-812524626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCPJIXOQYSC6URMLTOSIUDTGW7SHANCNFSM4ZQD4SKQ .