ml-evs / matador

⚗️ matador is an aggregator, manipulator and runner of first-principles calculations, written with a bent towards battery 🔋 electrode materials.
https://matador-db.readthedocs.io
MIT License
29 stars 19 forks source link

Electric Field Calculation and matador #142

Closed sajidurehman closed 3 years ago

sajidurehman commented 3 years ago

Hi Matthew, I am trying to introduce the electric field effect on materials through matador calculations. I use the following block in .cell file. %BLOCK EXTERNAL_EFIELD 0.0000000000 0.0000000000 0.2000000000 %ENDBLOCK EXTERNAL_EFIELD

Unfortunately, i didn't find any effect on band structure and DOS. Could you please guide me how to introduce the electric field effect via matador calculations. Thank you in advance.

Best Wishes Sajid

ml-evs commented 3 years ago

Hi @sajidurehman, I'm afraid I've never done an external E calculation with CASTEP so can't be much help. There is also a chance that OptaDOS does not interpret E properly, so I would check just the CASTEP output first.

If you get the calculation running without matador and find that matador is doing something wrong, then please re-open this issue.

sajidurehman commented 3 years ago

Hi @ml-evs thank you for your kind response. As per you suggestion, I have separately used sumo and OptaDOS with CASTEP for Electric field calculation for Si. Interestingly, It is working fine without any problem with OptaDOS. After applying the electric field it increases the bandgap from 0.590 to 0.689 eV. But in case of matador it doesn't show any effect on electronic properties.
Looking forward to your kind response.

ml-evs commented 3 years ago

I've just checked this, it looks like the electric field block isn't being read by matador so doesn't get passed through the workflow. I'll reopen this issue and add support for it when I get a chance.

sajidurehman commented 3 years ago

Thank you for considering this issue and reopening the issue.

ml-evs commented 3 years ago

Hi @sajidurehman, I've just merged support for this in #143. Feel free to try it and write back here with any issues.

sajidurehman commented 3 years ago

Hi @ml-evs, thank you for adding the support for External Electric Field. I use the following block in .cell file with direct CASTEP calculation and it works fine. %BLOCK EXTERNAL_EFIELD 0.0000000000 0.0000000000 0.5000000000 %ENDBLOCK EXTERNAL_EFIELD

But when trying to use above EXTERNAL_EFIELD block in matador calculation. Unfortunately, got the following error.

Si2.cell: <class 'ValueError'> could not convert string to float: '%ENDBLOCK' Failed to scrape file ['Si2.cell'] Si2.cell: could not convert string to float: '%ENDBLOCK'

Failed to parse cell file

ml-evs commented 3 years ago

My mistake, I shouldn't have tried to add it so late at night... fixed in 55c3d61

sajidurehman commented 3 years ago

Thank you for fixing the issue. Now it is working fine. But band structure is looking broken in CB and VB at K. Could you please also fix this issue. image

ml-evs commented 3 years ago

Nothing has changed with plotting so I don't think this is a matador issue but must be from CASTEP/OptaDOS itself. Do you not see the same results if you run the same k-point path with just CASTEP? I'm afraid I don't have time to investigate this any further, good luck.

ml-evs commented 3 years ago

Bear in mind that the electric field is only really valid for slabs/molecules as CASTEP applies it as a simple sawtooth potential across the cell. (see e.g. https://www.tcm.phy.cam.ac.uk/castep/documentation/WebHelp/content/modules/castep/keywords/k_external_efield_castep.htm). It looks like you're running on bulk Si here so I don't know what you would expect to see but a small direction-dependent shift doesn't seem too crazy.

sajidurehman commented 3 years ago

Yes, you are right. I was trying on Si just for testing and practice. But now i am trying on GaN monolayer. Then I will compare the both results with and without Electric Field. Definitely share with you.

sajidurehman commented 3 years ago

Hi @ml-evs, I have successfully applied external electric field from -0.8 to +0.8 eV/A on GaN. I am glad its working great and there is no issue regarding band structure and DOS. Once again thank you.

Now waiting for addition of Scissor operator feature.