hungpham2017 / mcu Goto Github PK
View Code? Open in Web Editor NEWModeling and Crystallographic Utilities
Home Page: https://hungqpham.com/mcu/index.html
License: Apache License 2.0
Modeling and Crystallographic Utilities
Home Page: https://hungqpham.com/mcu/index.html
License: Apache License 2.0
Hello, I've been trying to calculate the spin-texture using mcu. I've followed what Is presented in the page for the MoS2 case but when I try to run my case I get the following:
ValueError: cannot reshape array of size 0 into shape (3,8,8)
Any idea?,
Regards,
For the cell-periodic parts |m>, |n>
of Bloch wavefunctions, along some custom k-space path, I want to calculate the matrix element <m|d/dk n> = <m|dH/dk|n>/Enm
(where Enm = En - Em
for eigenvalues En,Em). I did this using finite differences for models with analytical Hamiltonians using MATLAB, Python, etc. In these models, I have that |m>
and |n>
are orthonormal instantaneous energy eigenstates.
But I wish to try it using VASP as well. I would ideally get at least the wavefunction for each band, and the derivative, so that I can do a finite difference to calculate the matrix element along the k-space path. However, it has been hard for me to achieve this. VASP itself offers LPEAD and LEPSILON, but they each give me an issue. For instance, LPEAD does not support a custom k-space path; while I do not know how to read the data from LEPSILON. I have limited experience with these techniques.
Is mcu capable of giving me an array of wavefunctions and derivatives? I noticed that cder
gives a derivative.
Thanks for your help!
mcu/mcu/wannier90/pywannier90_vasp.py
Line 811 in bfee934
The hamiltonian from interpolate_ham_kpts() is exact conjugate of get_hamiltonian_kpts(), might be due to the phase problem.
Hi!
First of all, this is not an issue report, but an improvement suggestion.
I find mcu
very useful for quick plots of PDOS obtained from VASP calculations. However, as I had to plot individual or grouped atomic PDOS, I needed to change the code a little bit. You can find the description of these changes below. If you think they would be an improvement for the package, please let me know.
mcu/vasp/vasprun.py
file so the mcu.plot_dos()
function can accept atom list as an argument in lm
argument, without losing existing functionalities.Example:
mcu.plot_dos(lm=['Pt:d','[1]:p','[2,3,4]:s,p'])
# should plot the DOS of
# - the sum of Platinum 'd' orbitals
# - the atom with index 1 'p' orbitals
# - the sum of atoms with indexes [2,3,4] 's' and 'p' orbitals
mcu.plot_dos()
function called totaldos
, which allows to select if TDOS should be plotted (True
) or not (False
).Thanks!
Hi,
I just tried installing the package but it seems there is some problem. After git clone ..., I issued the command ''python setup.py install" but it gives an error.
byte-compiling build/bdist.linux-x86_64/egg/mcu/vasp/vasprun.py to vasprun.cpython-37.pyc
File "build/bdist.linux-x86_64/egg/mcu/vasp/vasprun.py", line 805
<<<<<<< HEAD
^
SyntaxError: invalid syntax
See below image also.
Can you please advice how to resolve this?
Hi,
I have tried to use mcu to plot spin polarized band structure. My vasprun.xml and OUTCAR were generated with VASP 5.4.4. When I type
import mcu
mymcu=mcu.VASP()
It showed error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/polyucmp/.local/lib/python3.10/site-packages/mcu/vasp/vasprun.py", line 47, in __init__ self.get_info(self.vasprun) File "/home/polyucmp/.local/lib/python3.10/site-packages/mcu/vasp/vasprun.py", line 89, in get_info self.get_efermi() File "/home/polyucmp/.local/lib/python3.10/site-packages/mcu/vasp/vasprun.py", line 117, in get_efermi tdos, pdos, efermi = self.vasprun.get_dos() File "/home/polyucmp/.local/lib/python3.10/site-packages/mcu/vasp/vasp_io.py", line 400, in get_dos total_out.append(self.extract_vec(spin)) File "/home/polyucmp/.local/lib/python3.10/site-packages/mcu/vasp/vasp_io.py", line 579, in extract_vec vec = np.float64(vec) ValueError: could not convert string to float: '**********'
Is there something wrong wih vasprun.xml? I do not know what happened. Hope you can help me.
Hi,
First of all, thank you for developing the mcu. I am using mcu, it's really nice and has good features.
I have few questions.
Dear Quang Pham, I installed the "NumPy, matplotlib, spglib, scipy" libraries in the Anaconda environment. When I run the mcu / mcu / vasp / utils.py program to process WAVEDER files, Pycharm prompts an error: " from ..utils.misc import check_exist; ImportError: attempted relative import with no known parent package ", I do nโt know where the error occurred, thank you for your help.
Hi!
I'm not familiar with your Apache License, but in our upcoming publication I used your code to plot DOS and bands. So I can I cite it?
Yizhou
"n" and "ngrid" aren't defined before they are assgined to "band" and "ngrid", respectively.
It seems that this line should be corrected as:
unk = self.wave.get_unk(spin=self.spin, kpt=k_id+1, band=band+1,ngrid=grid)
After the above modification, it caused the following error:
line 634, in export_AME
self.export_unk(self, grid = grid)
TypeError: export_unk() got multiple values for argument 'grid'
Please check it.
Do you have any advice on mitigating the following error?
Code (from https://hungqpham.com/mcu/plottingwfn.html):
import mcu mymcu = mcu.WAVECAR() unk = mymcu.get_unk() # Generate the unk
Error:
unk = mymcu.get_unk() # Generate the unk Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/software/mcu/mcu/vasp/wavecar.py", line 195, in get_unk gvec = self.get_gvec(kpt) - Gp File "/software/mcu/mcu/vasp/wavecar.py", line 148, in get_gvec assert Gvec.shape[0] == self.nplws[kpt] / n, 'No. of planewaves not consistent! %d %d %d' % \ AssertionError: No. of planewaves not consistent! 13681 27362 44573
I used a uniform G-centered k-grid.
Apologies if this is the wrong place to ask. Thanks!
Traceback (most recent call last):
File "/media/polyucmp/DATA/BIAN_Tieyuan/yinjun/plot/mcu/test/original+LORBIT/ICHARG2/plot.py", line 6, in
mymcu.plot_pband(style=1)
TypeError: main.plot_pband() got an unexpected keyword argument 'style'
I used the code "$ git clone https://github.com/hungpham2017/mcu" to install mcu in the server with VASP and python on it. Then when I ran the code for plotting:
import mcu
import matplotlib.pyplot as plt
mymcu = mcu.VASP()
mymcu.plot_dos(spin='updown', style=1, efermi=5.0705, lm=['Ga:p','N:px'], elim=[-6, 8],yscale=0.05, save=True,fontsize=10, figname='Ga_updown', dpi=300)
plt.show()
It always shows "Traceback (most recent call last):
File "/vol01/homes/hy29793/SiC/mcuplot.py", line 3, in
mymcu = mcu.VASP()
AttributeError: module 'mcu' has no attribute 'VASP'
"
The code in the tutorial also used "import mcu
mymcu = mcu.VASP()".
What is the problem here and how to solve it?
I faced the following error while trying to use mcu utility for plotting the electrostatic potential:
locpot_data = np.float64(locpot_data).reshape(ngxyz, order='F')
ValueError: cannot reshape array of size 24883344 into shape (240,240,216)
using the same script provided in the examples:
import mcu
mymcu = mcu.LOCPOT()
mymcu.plot(axis='z', error=0.01)
My INCAR file:
ISTART = 1
ISPIN = 2
LREAL = Auto
ENCUT = 400
PREC = Normal
LWAVE = .TRUE.
LCHARG = .TRUE.
LAECHG = .TRUE.
ADDGRID = .TRUE.
LVTOT = .TRUE.
ISMEAR = -5
IBRION = -1
SIGMA = 0.05
LORBIT = 11
NEDOS = 2001
NELM = 60
EDIFF = 1E-05
NBANDS = 800
NSW = 0
LDIPOL = .TRUE.
IDIPOL = 3
POTIM = 0.5
GGA = PS
IVDW = 11
while KPOINTS:
0
Gamma
2 2 1
0.0 0.0 0.0
Any idea what is the source of this error? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.