Giter Club home page Giter Club logo

effmass's Issues

FHI-aims: IndexError: list index out of range

Running effmass for FHI-aims output gives me following error:

Traceback (most recent call last):
  File "/home/-----/.conda/envs/ase-env/bin/effmass", line 8, in <module>
    sys.exit(cli())
  File "/home/-----/.conda/envs/ase-env/lib/python3.6/site-packages/effmass/cli.py", line 83, in cli
    data = inputs.DataAims(pathname)
  File "/home/-----/.conda/envs/ase-env/lib/python3.6/site-packages/effmass/inputs.py", line 475, in __init__
    path_list.append(int(words[8]))
IndexError: list index out of range

How can I solve this problem?

Error while reading data from the location folder

I am using VASP outputs for calculating effective mass using EFFMASS code. While running EFFMASS, I am getting the following errors. I have already specified the correct location of the VASP output files needed for effective mass calculation.

File "/Library/Frameworks/Python.framework/Versions/3.12/bin/effmass", line 8, in
sys.exit(cli())
^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/effmass/cli.py", line 88, in cli
data = inputs.DataVasp(pathname+"/OUTCAR",pathname+"/PROCAR", ignore=int(ignore))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/effmass/inputs.py", line 420, in init
reciprocal_lattice = outcar.reciprocal_lattice_from_outcar(outcar_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/vasppy/outcar.py", line 15, in reciprocal_lattice_from_outcar
outcar = open(filename, "r").read()
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: \location\OUTCAR

Partial occupancy problems

The code seems to be quite sensitive to partial occupancies. My first attempt with a poorly-converged calculation raised some vasppy errors; I think it didn't like occupancy "-0.0000" but didn't quite get to the bottom of it. A healthier calculation with some slight partial occupancy is giving me:

partial occupancy, particle type unknown. Please set Segment.ptype manually.
cannot determine bandedge energy as particle type unknown. Please set Segment.ptype.

How is a user meant to proceed from there? The docstring for a Segment gives

ptype (str): The quasi particle type, determined by occupancy of the eigenstate.

but there isn't a list of valid values.

It would be nice to either have some guidance for this case or a big warning that partial occupancies are not tolerated. It can be hard to avoid them, though.

FHI-AIMS: ValueError

Hello. Running effmass with FHI-AIMS (version 200112.2) outputs is giving me the following error:

Traceback (most recent call last):
File "/usr/bin/effmass", line 8, in
sys.exit(cli())
File "/home/esteve/.local/lib/python3.6/site-packages/effmass/cli.py", line 83, in cli
data = inputs.DataAims(pathname)
File "/home/esteve/.local/lib/python3.6/site-packages/effmass/inputs.py", line 541, in init
self.CBM = extrema._calc_CBM(occupancy, energies)
File "/home/esteve/.local/lib/python3.6/site-packages/effmass/extrema.py", line 46, in _calc_CBM
return np.amin(energy_unoccupied)
File "<array_function internals>", line 6, in amin
File "/usr/lib64/python3.6/site-packages/numpy/core/fromnumeric.py", line 2831, in amin
keepdims=keepdims, initial=initial, where=where)
File "/usr/lib64/python3.6/site-packages/numpy/core/fromnumeric.py", line 85, in _wrapreduction
return reduction(axis=axis, out=out, **passkwargs)
File "/usr/lib64/python3.6/site-packages/numpy/ma/core.py", line 5701, in min
axis=axis, out=out, **kwargs).view(type(self))
File "/usr/lib64/python3.6/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Could you tell me how to solve this problem, please?

Thank you in advance.

AssertionError

Hi

I am getting the following error. And what will be the command prompt if I want to select specific band index and k-point index?

Welcome to effmass 2.0.0 🎈
? Which DFT code have you used to generate the bandstructure? Vasp
? What's the path to your Vasp output files? ./../band_gaino/
? How many k-points should I ignore at the start of the file? (useful for hybrid calculations) 0
? How far (in eV) from the CBM (VBM) would you like me to search for minima (maxima)? 0.05
? What would you like the energy range (in eV) of each segment to be? 0.5
? Which values would you like me to calculate? done (2 selections)
? Would you like me to save a plot of the band segments? Yes
? Would you like me to save a summary file? Yes
Reading in data...
Traceback (most recent call last):
File "/anaconda3/bin/effmass", line 33, in
sys.exit(load_entry_point('effmass==2.1.0', 'console_scripts', 'effmass')())
File "/anaconda3/lib/python3.7/site-packages/effmass-2.1.0-py3.7.egg/effmass/cli.py", line 86, in cli
File "/anaconda3/lib/python3.7/site-packages/effmass-2.1.0-py3.7.egg/effmass/inputs.py", line 346, in init
File "/anaconda3/lib/python3.7/site-packages/vasppy-0.7.1.0-py3.7.egg/vasppy/procar.py", line 300, in from_file
pcar._read_from_file( filename=filename )
File "/anaconda3/lib/python3.7/site-packages/vasppy-0.7.1.0-py3.7.egg/vasppy/procar.py", line 326, in _read_from_file
self.parse_projections()
File "/anaconda3/lib/python3.7/site-packages/vasppy-0.7.1.0-py3.7.egg/vasppy/procar.py", line 227, in parse_projections
assert( self._number_of_bands * self._number_of_k_points == len( self.projection_data ) )
AssertionError

Publications list

There should be a publications list page which lists the publications that have used Effmass (3 listed on Google Scholar, + one from Matthias that has not been picked up as a citation for some reason)

Compatability with BandUP

(From Issue #27, @cai-xiaomeng)

Hi!

Does Effmass support supercell band data (band folding) processing?

I already do the band unfolding of supercell by using BandUp program, now how to use Effmass to deal with the unfolded band structure data?

Feature request: Printable representation of Segment

It would be nice if Segment objects had a standard printable representation, such as 2.3 eV [0 0 0] -> [1 0 1]. This can can be implemented by providing a __str__ method. It would make it easier to keep track of them and work with them interactively. The method implied in the tutorial is to repeatedly call plot_segments until you're sure you have the index of the one you want.

How to select segments

Hi Lucy,
I have a problem when using your code for my DFT analysis. I can't select a certain segment when I prefer to calculate effective mass along some certain directions in K-paths. I have tried to change the value of "extrema_search_depth" and "energy_range", but it doesn't work. It would be so great if you can give me some advices. Thanks very much.

Sincerely,

Wuliji

Fix Link

Fix Link to effective mass PRB paper in documentation.

Sort out dependencies

Anyone who installs effmass automatically installs the dependencies for development (in particular, pytest for testing). I should fix this so that these are only installed if requested.

Effmass interface with Pymatgen

Have Effmass interface with pymatgen. This should enable effmass to work with the various codes that pymatgen can parse (which doesn't include Castep, hence separate issue #24). I think this would fix issue #16 and #19 as pymatgen can work with vasprun.xml and Quantum-espresso (pwscf).

Question / potential feature request: obtain band structure from vasprun.xml instead of PROCAR

Perhaps this is a stupid question (sorry if it is), but is it really required to have a PROCAR file (only obtained if one runs VASP with LORBIT = 11) to obtain the full band structure? pymatgen is able to parse it from vasprun.xml without the user having to run VASP with any additional parameters, and since effmass depends on pymatgen anyway, it would be great (IMHO) if that was provided as an alternative option for how to obtain it.

Or is there some advantage to PROCAR that I'm not seeing?

bk option in effective mass

Dear Lucy,

Thank you for this nice code.

As reported by several other users I am also having issue where effmass does not locate correct CBM. I was playing with the bk options in effmass.extrema.generate_segments but unforunately I can.t get it working.

Below is how i am calling it. I am interested in effective mass of band #20, and K-point 40

segments = extrema.generate_segments(settings, data, bk=[20,40])

But this give me error:

379 kpoints_list = []
380 band_list = []
--> 381 for band, kpoint in extrema_array: # flatten CB and VB arrays to a single array
382 kpoints_before = get_kpoints_before(
383 band,

TypeError: cannot unpack non-iterable int object

i am not sure how to resolve this. it will be very helpful if you could provide a working example with "bk" option.

Many thanks,
alex

Handling negative occupancy

effmass should give a warning when there are negative occupancies generated from using the tetrahedron or MP-smearing scheme in vasp. See this PR.

SciPy is not imported, leading to errors in printing results

effmass/analysis.py imports integrate by name, however the mass_integration function uses the qualified scipy.integrate.quad. This leads to an error in line outputs.print_results(segments[-1], data, settings), which fails with the following traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-26-204cc925e032> in <module>()
----> 1 outputs.print_results(segments[-1], data, settings)

~/Projects/joss-reviews/effmass/effmass/outputs.py in print_results(segment, data, settings, polyfit_order)
    136                   polyfit_order=polyfit_order)]))
    137     print("optical mass at band edge (assuming the Kane dispersion) is {:.2f}".
--> 138           format(segment.optical_effmass_kane_dispersion()))
    139 
    140     plt.figure(figsize=(8, 8))

~/Projects/joss-reviews/effmass/effmass/analysis.py in optical_effmass_kane_dispersion(self, fermi_level, temp, alpha, mass_bandedge, upper_limit)
    488             alpha=alpha,
    489             mass_bandedge=mass_bandedge,
--> 490             upper_limit=upper_limit)
    491         bottom = self.weight_integration(
    492             fermi_level=fermi_level,

~/Projects/joss-reviews/effmass/effmass/analysis.py in mass_integration(self, fermi_level, temp, alpha, mass_bandedge, upper_limit)
    334         fermi_level = self.fermi_energy if fermi_level is None else fermi_level
    335 
--> 336         result = scipy.integrate.quad(
    337             self._mass_integrand,
    338             0,

NameError: name 'scipy' is not defined

Fixing scipy.integrate.quad -> integrate.quad should fix this.

I also suggest writing a test for this code path.

(Part of openjournals/joss-reviews#797)

Improve label placement in output plots

The label placements in the bandstructure plots are ugly. In some cases they obscure the axes.
It would be nice to find a more attractive and sensible way to label each Segment.
Marked as a good first issue as it is a quite self-contained task. A good one for someone with Python knowledge, but not no domain-specific computational chemistry knowledge.

Broken link to notebook from docs

The link to the Jupyter example works on the README page, but fails from the homepage of the RTD manual (https://effmass.readthedocs.io/en/latest/). I'm not sure why, as the link in the actual README file looks fine?

My theories are

  • there is some strange markdown conversion going on, or
  • you fixed it already and the RTD build is stale.

command line interface

Hey, Lucy. Thank you for this great instrument. Today I was trying to run it via command line. I have performed installation using pip install effmass but when I try to run it I got "effmass" is not recognized as an internal or external command.
Maybe problem on my side, but other stuff seems to work fine.

how to efficiently select the input parameters for the targeted bands

Dear Lucy,

I hope this message finds you well.

I have a small question while I am using effmass. Please see the attached files.
I actually would like to estimate the effective mass for the band of VBM and CBM. A case is attached for Cs2AgBiBr6, which has the indirect band gap nature. I feel it is a bit difficult for me to get the suitable input parameters for my interested bands.

Please see the figure named "0_0.7_0.5.png", which is corresponding to the input below:
How many k-points should I ignore at the start of the file? (useful for hybrid calculations) [0]
How far (in eV) from the CBM (VBM) would you like me to search for minima (maxima)? 0.7
What would you like the energy range (in eV) of each segment to be? 0.5

The figure named "0_1_0.5.png" is corresponding to:
How many k-points should I ignore at the start of the file? (useful for hybrid calculations) 0
How far (in eV) from the CBM (VBM) would you like me to search for minima (maxima)? 1
What would you like the energy range (in eV) of each segment to be? 0.5

I played quite a lot of combinations about those parameters not just the two cased I showed you. It seems effmass is always trying to avoid the VBM without considering its effective mass. Do you have some suggestions how we can select the input parameters for the targeted bands? I am generally interested in the VBM and CBM region.

Many thanks for your time and looking forward to hearing from you.

Cs2AgBiBr6.zip

Best regards,
Haiyuan Wang.

Refactor the `extrema` module

The extrema module is feeling pretty clunky!

An improvement might be to create a new Bandstructure class within extrema.py, with each of the functions in the module mapped to Bandstructure methods. Might also rename extrema.py to bandstructure.py.

info file output by Octopus

Hello @afatt,

I am trying to calculate the effective mass from the Octopus output.
However, when I tried to use the outputs obtained from the Octopus tutorial, I obtained the following error.

File "/<path>/octopuspy/info.py", line 74, in get_lattice_vectors
    index = self._info.index(match)
            ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: '  Lattice Vectors [A]' is not in list

I checked with less and indeed did not find "Lattice Vectors [A]" in the info file.
("UnitsOutput = eV_Angstrom" was added to inp and we have confirmed that Lattice Vectors [A] is output to standard output.)

I would like to compare the input files, so could you please show me the inp when you get the tests/data_octopus.
Or could you tell me how to get "Lattice Vectors [A]" to show up in info?

Sincerely,

TS

Reword documentation

Function docstring for analysis._fermi_function() could be improved: at the moment it is not clear if the probability refers to the probability of the valence band being occupied by an electron or a hole.

`python setup.py` test fails

python setup.py test fails with:

    (pytest.lazy_fixture('MAPI_settings_object'), 0.025, 0.25),
AttributeError: module 'pytest' has no attribute 'lazy_fixture'

Tests are working correctly with python -m pytest as recommended by the README, but this might trip people up.

Error loading a spin-polarised calculation

I ran an LDA band structure for MgO. With no spin enabled it reads in ok, but when I set ISPIN=2 and recalculated the band structure effmass seems to have trouble reading the files.

Are spin-polarized calculations supported? I see that effmass.inputs.Data has an attribute for the number of spin channels, but I get an error while the object is being instantiated.

spin_test.zip

Inputs doesnt read VASP OUTCAR PROCAR

Hi

I am trying to follow your jupyter demo and gave this input:

from effmass import inputs, analysis, extrema, outputs, dos, ev_to_hartree
settings = inputs.Settings(extrema_search_depth=0.075, energy_range=0.25)
data = inputs.Data(r"C:\Users\gr426\PycharmProjects\effmass\OUTCAR",r"C:\Users\gr426\PycharmProjects\effmass\PROCAR", ignore=216)

but got this error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\gr426\AppData\Roaming\Python\Python37\site-packages\effmass\inputs.py", line 115, in __init__
    energies[i] = vasp_data.bands[:, 1:].reshape(
TypeError: list indices must be integers or slices, not tuple

The OUTCAR and PROCAR files were taken from effmass/tests/data Ge_SP_OUTCAR and Ge_SP_PROCAR.

Are there working sample files that I can try? Please advise.

inconsistent segments

Hi,

I'm using effmass module to determine the effective masses of some layered materials. However, there is a problem that I could not find a solution yet. I'd appreciate your help and suggestions.

When I plot effective masses in different directions for different HfS2 bulk systems (optimized with different levels), efmass shows a segment that does not available in other plot. All band structure calculations were performed using FHI-aims with HSE06+SOC level. The first plot shows effmass plot for HSE06+SOC@PBE+D3 and the second one shows for HSE06+SOC@PBE+D4.
image
image
Because of that reason effective masses in directions [100] and [110] are incomparable. Thanks in advance

Update documentation

The documentation has a basic tutorial workflow. However there should be some FAQs added:

  • how to adjust the fermi level and update CBM/VBM (especially useful when there is no occupancy data)
  • how to specify a particular band/k-point when the one you want is automatically found

Also change structure of documentation so that inputs section is extended to cover various DFT calculators.

IndexError: list index out of range with FHI-aims

Dear Lucy,

I'm getting following error while using effmass for FHI-aims band structure calculation:

IndexError                                Traceback (most recent call last)
Input In [8], in <cell line: 1>()
----> 1 mos2_mos2_hhh = inputs.DataAims('hhh/')

File ~\anaconda3\lib\site-packages\effmass\inputs.py:688, in DataAims.__init__(self, directory_path, output_name)
    686 kpoints[int(kpoint_counter), 2] = float(words[3])
    687 for i in range(number_of_bands):
--> 688     energies[i, int(kpoint_counter)] = float(words[5 + 2 * i])
    689     occupancy[i, int(kpoint_counter)] = float(words[4 + 2 * i])
    690 kpoint_counter += 1

IndexError: list index out of range

I have tried the all the possible solutions mentioned in similar issues posted and installed effmass using all posible methods. However, nothing solved the problem.

You can find my input files attached to this post
hhh.zip

Effective masses undetectable in a command line?

In my use of effmass in a command line, the detection of effective masses in an electronic band structure sometimes fails.

My purpose in the use of effmass is the quick evalution of effective masses in various insulators.
Below is an example of my calculation and analysis.
・ DFT code: VASP
・ chemical composition: BaO2
・ space group: _I_4/mmm
・ cell: primitive unit cell (fully relaxed before the evaluation of a band structure)
・ k points to evaluate band structures : created by the SeeK-path program in vise, which has been developed by Y. Kumagai.
・ how to use effmass: command line

As an important supplement, regardless of the type of XC potential (GGA or HF/DFT hybrid), band structures in my calculations have been obtained through SCF calculations with explicit lists of k points.

This is a band structure of BaO2, which was drawn by vise.
Its VBM and CBM are on the M points.
The names of high-symmetry k points in this band structure are defined in SeeK-path.
band_BaO2_PBEsol.pdf

Two cases of k-point distance (k-point density) in zero-weighed k points were tested.
k-point distance is controlled by vise.
Case 1) rougher k points
As shown in a png file and a txt file, six hole effective masses along the M-to-gamma and M-to-S directions, and three electron effective masses along the same directions were detected.
RougherKpoints.zip

Case 2) finer k points
Unlike in Case 1, hole/electron effective masses along the M-to-S direction were NOT detected.
In the case of even finer k points, the detection of effective masses still failed.
To improve the reliability of effective mass, I would like to use the finest possible k-point distance.
FinerKpoints.zip

What could be the source of this difference?
Could you please provide any methods to improve the accuracy of detection?

Extracting effective masses just for specific directions on VB and CB in a specific range on x-axis

Hi,

I like to ask you something. Even though efmass works nicely, I'd like to extract effective masses for specific directions on VB and CB in the path GMKG. Since I work with hundreds of band structures, checking all band structures manually is really time-consuming. I'd appreciate your suggestions. I am using band structures generated with FHI-aims.

For example, I'd like to extract effective masses at directions [100], [120], and [110] for VB and CB in the path GMKG like in the following plot

image

Assertion Error

Hi Lucy
I am getting this error. The calculation is HSE and the fermi level is inside the conduction band, but there is a gap before the same.
Can you tell me how to solve this?
I have used both the command line interface as well as your example notebook format. This error comes when I try to load the PROCAR and OUTCAR file. I have used pip for installation.
Reading in data...
Traceback (most recent call last):
File "/home/suman/.local/bin/effmass", line 8, in
sys.exit(cli())
File "/home/suman/.local/lib/python3.8/site-packages/effmass/cli.py", line 87, in cli
data = inputs.DataVasp(pathname+"/OUTCAR",pathname+"/PROCAR", ignore=int(ignore))
File "/home/suman/.local/lib/python3.8/site-packages/effmass/inputs.py", line 402, in init
self.check_data(self.spin_channels, self.number_of_kpoints, self.number_of_bands,
File "/home/suman/.local/lib/python3.8/site-packages/effmass/inputs.py", line 137, in check_data
assert (CBM >
AssertionError: The CBM energy is lower than than the VBM energy

partial occupancies error

Hi Lucy,
I am currently using your code effmass for my research and have faced an error which I haven't been able to solve. I am not very versed with using python so pardon me for stupid questions.
So actually the error comes as "You have partial occupancy numbers in Data.occupancy ....... You should check that the attributes Data.VBM, Data.CBM and Data.fermi_energy are correct, and if not, set them manually"
I am using your jupyter notebook example. I can't really figure out where or how I can set them manually.
It would be great if you could give me any suggestion regarding this

generate_segments docstring

The docstring for effmass.extrema.generate_segments seems to be outdated:

Generates a list of Segment objects.

Args:
    extrema_array (array(int)): A 2-dimensional array of size (number of extrema, 2). Each row corresponds to an extrema and contains [:attr:`~effmass.inputs.Data.bands` index, :attr:`~effmass.inputs.Data.kpoints` index]. See :func:`find_extrema_indices`.
    Settings (Settings): instance of the :class:`Settings` class.
    Data (Data): instance of the :class:`Data` class.
    truncate_dir_change (bool): If True, truncates eigenstates when there is a change in direction. If False, there is no truncation. Defaults to True.

Returns:
    list(Segments): A list of :class:`Segment` objects.

There is no extrema_array argument?

Effmass command line interface

Create a CLI for the most basic (and probably commonly used) analysis: a parabolic effective mass for each maxima/minima within a certain energy range. Could print out: start point of segment, end point of segment, least squares effective mass, finite difference effective mass. One command for each calculator type: effmass-vasp, effmass-aims, effmass-castep. User would have to specify the filepath(s) only.

Segment selection

Hi,
I'm using effmass with FHI-AIMS inputs/outputs and I would like to extract the effective mass for specific segments.
I am aware there is an option called "extrema.generate_segments" that performs that task.
However, I'm struggling with this since I don't know how to use the argument "bk" properly.
Could you, please, provide some examples using the "extrema.generate_segments" option with the bk argument?

Best regards,
María

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.