GithubHelp home page GithubHelp logo

fermisurfaces / ifermi Goto Github PK

View Code? Open in Web Editor NEW
81.0 8.0 33.0 131.02 MB

Fermi surface generation, analysis and visualisation.

Home Page: https://fermisurfaces.github.io/IFermi/

License: MIT License

Python 100.00%
fermi-surface fermi-slice vasp

ifermi's People

Contributors

aj-searle avatar computron avatar dependabot-preview[bot] avatar dependabot[bot] avatar mkhorton avatar paulneves77 avatar tschaume avatar utf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ifermi's Issues

JOSS Review: Optional flag to plot (but not show) a Fermi surface

RE: openjournals/joss-reviews#3089

Describe the bug
Upon running ifermi plot, it appears that an .html file is generated and an attempt is made to view the plot. I think it would be nice to have an optional flag to generate the plot but not show it. In my case, I'm SSH'd into a Linux machine without x-forwarding, and the code calls a web browser that I can't actually view and have to manually cancel out of every time I generate a plot via the command line interface.

BUG: Issue in calculating spin texture (or properties calculation ) in given example of BiSb

Dear Developers,

Thank you for the code IFermi.
I cannot reproduce the BiSb example as reported in the documentation section.

There is an inconsistency in internal routine while interpolating the properties (velocities and spin) from band structure data. Please check and let me know if I get this incorrect.

Please Note:

  1. I have used the vasprun.xml file of BiSb given on the GitHub page.
  2. I am running the latest version of the IFermi 0.3.3 and python3.10.9
  3. I have used the command line terminal to get the spin-polarized 2D Fermi Surface

ifermi plot --mu -0.85 -i 5 --slice 0 0 1 0 --property spin --hide-cell --hide-labels --projection-axis 0 1 0 --property-colormap RdBu

  1. The error says, "ValueError: ndarray is not C-contiguous"

The error output is pasted over here. Please check. I am looking for your reply.

Screenshot of O/P

chk

Thanks
Rahul Verma
Research Scholar
TIFR Mumbai

BUG: Incompatible packages

Trying to install IFermi, as described in Installation notes in documentation:

conda create --name ifermi pip cmake numpy
conda activate ifermi
conda install -c conda-forge pymatgen boltztrap2 pyfftw
pip install ifermi

(exactly on this step: conda install -c conda-forge pymatgen boltztrap2 pyfftw)

lead to
pyfftw -> numpy[version='>=1.18.5,<2.0a0'] -> numpy-base[version='1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.11.3|1.14.3|1.14.3|1.14.3|1.14.3|1.14.3|1.14.3|1.14.4|1.14.4|1.14.4|1.14.4|1.14.4|1.14.4|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.5|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.14.6|1.15.0|1.15.0|1.15.0|1.15.0|1.15.0|1.15.0|1.15.0|1.15.0|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.1|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.2|1.15.3|1.15.3|1.15.3|1.15.3|1.15.3|1.15.3|1.15.4|1.15.4|1.15.4|1.15.4|1.15.4|1.15.4|1.15.4|1.15.4|1.15.4|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.0|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.1|1.16.2|1.16.2|1.16.2|1.16.2|1.16.2|1.16.2|1.16.3|1.16.3|1.16.3|1.16.3|1.16.3|1.16.3|1.16.4|1.16.4|1.16.4|1.16.4|1.16.4|1.16.4|1.16.5|1.16.5|1.16.5|1.16.5|1.16.5|1.16.5|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.16.6|1.17.2.*|1.17.3.*|1.17.4.*|1.18.1.*|1.18.5.*|1.19.1|1.19.1|1.19.1|1.19.1|1.19.1|1.19.1|1.19.2|1.19.2|1.19.2|1.19.2|1.19.2|1.19.2|1.19.2|1.19.2|1.20.1|1.20.1|1.20.1|1.20.1|1.20.1|1.20.1|1.20.2|1.20.2|1.20.2|1.20.2|1.20.2|1.20.2|1.20.3|1.20.3|1.20.3|1.20.3|1.20.3|1.20.3|1.21.2|1.17.0|1.17.0|1.17.0|1.17.0|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|1.9.3|>=1.9.3,<2.0a0',build='py27h2b20989_6|py27hdbf6ddf_6|py36hdbf6ddf_6|py27hdbf6ddf_7|py37h2b20989_7|py27hdbf6ddf_7|py36hdbf6ddf_8|py36h2b20989_8|py37hdbf6ddf_8|py37h2b20989_8|py27h2b20989_8|py27hdbf6ddf_8|py35hdbf6ddf_8|py35h2b20989_8|py27h7cdd4dd_9|py37h3dfced4_9|py36h3dfced4_9|py36h81de0dd_9|py37h81de0dd_9|py27h74e8950_9|py37h74e8950_10|py35h74e8950_10|py36h74e8950_10|py27h81de0dd_10|py35h81de0dd_10|py37h2f8d375_10|py27h2f8d375_10|py37h2f8d375_11|py27h2f8d375_11|py36hde5b4d6_11|py27hde5b4d6_11|py37h2f8d375_12|py27h2f8d375_12|py36h2f8d375_12|py27hde5b4d6_12|py38hde5b4d6_12|py36h0ea5e3f_1|py36h9be14a7_1|py27h9be14a7_1|py35h9be14a7_1|py27h2b20989_0|py36h2b20989_0|py35h2b20989_0|py27hdbf6ddf_0|py36hdbf6ddf_0|py36h2b20989_0|py27h2b20989_0|py36hdbf6ddf_0|py27hdbf6ddf_0|py36h2b20989_1|py37h2b20989_1|py27hdbf6ddf_1|py37hdbf6ddf_1|py36h2b20989_2|py27hdbf6ddf_2|py37hdbf6ddf_2|py36hdbf6ddf_2|py37hdbf6ddf_3|py36hdbf6ddf_3|py27h2b20989_3|py27hdbf6ddf_3|py27hdbf6ddf_4|py37hdbf6ddf_4|py36h2b20989_4|py36hdbf6ddf_4|py35hdbf6ddf_4|py35h2b20989_4|py37h2f8d375_4|py27h2f8d375_4|py35h81de0dd_4|py38h2f8d375_4|py38hde5b4d6_4|py36h2f8d375_5|py27h2f8d375_5|py36hde5b4d6_5|py37h7cdd4dd_0|py35h7cdd4dd_0|py36h3dfced4_0|py35h3dfced4_0|py35h74e8950_0|py27h74e8950_0|py36h74e8950_0|py36h81de0dd_0|py35h81de0dd_0|py27h2f8d375_0|py37h2f8d375_0|py37h2f8d375_0|py27h2f8d375_0|py37h81de0dd_0|py27h81de0dd_0|py35h81de0dd_0|py35h2f8d375_0|py36h81de0dd_0|py36h2f8d375_1|py37h81de0dd_1|py37h2f8d375_1|py27h2f8d375_0|py37h2f8d375_0|py36h81de0dd_0|py27h2f8d375_0|py36h81de0dd_0|py27hde5b4d6_0|py27h2f8d375_0|py27hde5b4d6_0|py36h2f8d375_1|py37hde5b4d6_1|py36hde5b4d6_1|py27h2f8d375_0|py27hde5b4d6_0|py27h2f8d375_1|py37h2f8d375_1|py36h2f8d375_1|py37hde5b4d6_1|py27h2f8d375_0|py27hde5b4d6_0|py27h2f8d375_0|py27hde5b4d6_0|py36hde5b4d6_0|py27h2f8d375_0|py27hde5b4d6_0|py36hde5b4d6_0|py37h2f8d375_0|py27hde5b4d6_0|py36hde5b4d6_0|py36hde5b4d6_0|py38hde5b4d6_0|py27hde5b4d6_0|py39hfb011de_1|py39h76555f2_1|py39h41b4c56_3|py38h41b4c56_3|py37h41b4c56_3|py36hdc34a94_3|py38hdc34a94_3|py38h75fe3a5_0|py38hfa32c7d_0|py36hfa32c7d_0|py38h75fe3a5_0|py36hfa32c7d_0|py38hfa32c7d_0|py39h2ae0177_0|py39h34387ca_0|py38h7d8b39e_0|py38hfae3a4d_0|py37he2ba247_0|py39hfae3a4d_0|py37h74d4b33_0|py38h74d4b33_0|py38h39b7dee_0|py37h39b7dee_0|py38h79a1101_0|py39h2b8c604_0|py310h2b8c604_0|py310h79a1101_0|py38h2b8c604_0|py37h79a1101_0|py37h2b8c604_0|py39h79a1101_0|py39h39b7dee_0|py39h74d4b33_0|py37hfae3a4d_0|py39he2ba247_0|py38he2ba247_0|py39h7d8b39e_0|py38h34387ca_0|py37h7d8b39e_0|py37h34387ca_0|py39h0f7b65f_0|py36h75fe3a5_0|py37h75fe3a5_0|py37hfa32c7d_0|py37h75fe3a5_0|py36h75fe3a5_0|py37hfa32c7d_0|py37hdc34a94_3|py39hdc34a94_3|py36h41b4c56_3|py27h2f8d375_0|py38h2f8d375_0|py37hde5b4d6_0|py36h2f8d375_0|py37h2f8d375_0|py36hde5b4d6_0|py37hde5b4d6_0|py37h2f8d375_0|py36h2f8d375_0|py37hde5b4d6_0|py27h2f8d375_0|py36h2f8d375_0|py37hde5b4d6_0|py37h2f8d375_0|py36h2f8d375_0|py37hde5b4d6_0|py36h2f8d375_0|py37h2f8d375_0|py36hde5b4d6_0|py37hde5b4d6_0|py36h2f8d375_0|py37h2f8d375_0|py27hde5b4d6_1|py36hde5b4d6_1|py37hde5b4d6_0|py36hde5b4d6_0|py36h2f8d375_0|py37h2f8d375_0|py27hde5b4d6_1|py27h2f8d375_1|py37h2f8d375_1|py36hde5b4d6_0|py36h2f8d375_0|py37hde5b4d6_0|py37h2f8d375_0|py37hde5b4d6_0|py36hde5b4d6_0|py27h81de0dd_0|py37h81de0dd_0|py36h2f8d375_0|py37h2f8d375_0|py37h81de0dd_0|py27h81de0dd_0|py36h2f8d375_0|py36h81de0dd_1|py27h81de0dd_1|py27h2f8d375_1|py36h2f8d375_0|py36h2f8d375_0|py35h2f8d375_0|py37h81de0dd_0|py27h81de0dd_0|py37h74e8950_0|py37h3dfced4_0|py27h3dfced4_0|py36h7cdd4dd_0|py27h7cdd4dd_0|py37hde5b4d6_5|py27hde5b4d6_5|py37h2f8d375_5|py36h81de0dd_4|py37h81de0dd_4|py36h2f8d375_4|py27h81de0dd_4|py35h2f8d375_4|py37h2b20989_4|py27h2b20989_4|py37h2b20989_3|py36h2b20989_3|py37h2b20989_2|py27h2b20989_2|py27h2b20989_1|py36hdbf6ddf_1|py35hdbf6ddf_0|py35hdbf6ddf_0|py35h0ea5e3f_1|py27h0ea5e3f_1|py38h2f8d375_12|py36hde5b4d6_12|py37hde5b4d6_12|py37hde5b4d6_11|py36h2f8d375_11|py35h2f8d375_10|py36h2f8d375_10|py36h81de0dd_10|py37h81de0dd_10|py27h74e8950_10|py35h81de0dd_9|py27h81de0dd_9|py36h74e8950_9|py37h74e8950_9|py35h74e8950_9|py27h3dfced4_9|py35h3dfced4_9|py37h7cdd4dd_9|py35h7cdd4dd_9|py36h7cdd4dd_9|py37hdbf6ddf_7|py36hdbf6ddf_7|py36h2b20989_7|py27h2b20989_7|py37h2b20989_7|py37hdbf6ddf_7|py35h2b20989_7|py35hdbf6ddf_7|py36h2b20989_7|py36hdbf6ddf_7|py27h2b20989_7|py37hdbf6ddf_6|py37h2b20989_6|py36h2b20989_6']

Package gdbm conflicts for:
pyfftw -> pypy3.7[version='>=7.3.7'] -> gdbm[version='>=1.18,<1.19.0a0']
boltztrap2 -> pypy3.7[version='>=7.3.3'] -> gdbm[version='>=1.18,<1.19.0a0']
Package ca-certificates conflicts for:
python=3.10 -> openssl[version='>=3.0.0,<4.0a0'] -> ca-certificates
pyfftw -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates
Package pypy3.7 conflicts for:
pyfftw -> pypy3.7[version='>=7.3.3|>=7.3.7']
pyfftw -> numpy[version='>=1.18.5,<2.0a0'] -> pypy3.7[version='7.3.*|7.3.3.*|7.3.4.*|7.3.5.*|7.3.7.*|>=7.3.4|>=7.3.5']
Package setuptools conflicts for:
boltztrap2 -> matplotlib-base -> setuptools
pymatgen -> cython -> setuptools[version='<60.0.0']
python=3.10 -> pip -> setuptools
Package wheel conflicts for:
python=3.10 -> pip -> wheel
pymatgen -> pip -> wheel

Package spglib conflicts for:
boltztrap2 -> spglib
pymatgen -> spglib[version='>=1.9.9.44']The following specifications were found to be incompatible with your system:
  - feature:/linux-64::__glibc==2.24=0
  - feature:|@/linux-64::__glibc==2.24=0
  - boltztrap2 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - pymatgen -> vtk[version='>=6.0.0'] -> __glibc[version='>=2.17|>=2.17,<3.0.a0']
  - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.24

Latest version

Hi @ajsearle97

Just wondering if you can upload the latest version of your code on here? I'd like to plot a Fermi surface for the project I'm working on and it'd be great if I could use this code!

bottlenecks in isosurface calculation?

as a follow up to yesterday question, I am trying to smooth a surface by increasing interpolation factor.

I am working with not so high number of kpoints, the interpolatied mesh has about 500k kpoints. However, the step of generating the fermi surface takes too long sometimes crashing the execution. I can see that the bottleneck is somewhere in the _calculate_band_isosruface method but cant tell exactly where, with only one cpu going to 100%. I guess the suspect for this must be the marching_cube method but I dont see a way to make it behave better.
For larger kpoints also this line gives problems, but I guess this is not so easy to evercome.

The reason for me on digging into this is that with old Xcrysden very good renders of the same isosurface can be acheved in almos no time. the disadvantage in that case is that I can not come with a solution to automate the generation of the surfaces and is too much mouse click dependent.

Once again, thank you so much for the support.

BUG: Too many values to unpack

I just installed ifermi using anaconda in windows wsl, and try to run "ifermi info" in example/MgB2 folder. The error also appears if I run pytest.

image

couple suggestions for the plotter

first of all, thank you for the hard work!

I have been using IFermi for hardworking the fermisurfaces on an high-throughoutput scheme. I have found a few ponts where the code could be improbed:
1: fermisurface_plotter.plotter does not return the plot objects.
2: the smooth algorith did not reurn a the desired surface , when the not smoothed algo actually did.

I modified a few lines of the code to try to fix this. Would you pleas consider the changes?:

master...mdforti:isosurfaceoffset

I dont have experience on big projects, so I probably should ask before sending the pull request.
Once again thank you for all the help I got from this code.

Feature Request: Area / Volume enclosed by Fermi surface within the Brillouin Zone.

Hello,

One of the attractiveness of Ifermi that I like is its feature to provide the area of Fermi surface by "ifermi info".
I think, the area calculated in this feature is the surface area of the Fermi surface layer.

I wonder, if a feature exists/ can be added in IFermi that calculates the area/volume enclosed by the Fermi surface to the boundaries of the First Brillouin Zone. The feature will be useful to estimate the number of carriers as they are explained this example below from Alloul's Introduction to the Physics of Electrons in Solids textbook.

Thank you very much for your help and consideration.

image

image

image

Feature Inquiry: 3d points in fermislice

Dear developers,
I am using ifermi and find it very useful. I am kind of interested in visualizing the 2d fermi slices in 3d because sometimes the 3d plotter requires too much memory and time.
I tried to plot the isoline and properties from the fermislice in 3d, then I found that the isoline segments are 2d segments on the x-y plane. Would it be possible to output the 3d isoline segments in the FermiSlice.from_fermi_surface function?

An example would be like the following:
image

Best,
Dongsheng

JOSS Review: installation in a conda environment

RE: openjournals/joss-reviews#3089

I tried to install ifermi using my usual approach, which is within a new conda environment:

conda create --name ifermi
conda activate ifermi
conda install pip
pip install ifermi

This did not work as I think the combination of conda/pip meant that there were problems with the cmake command needed to install the boltztrap2 and pyfftw dependencies (full output attached).

So instead I did the following:

conda create --name ifermi
conda activate ifermi
conda install -c conda-forge boltztrap2==20.7.1
conda install -c conda-forge pyfftw==0.12.0
conda install pip
pip install ifermi

where I've pinned the conda-forge installs to the versions specified in requirements. iFermi installed without errors, though I haven't been able to run the tests (will raise a separate issue).

This isn't a bug as I installed within a conda environment, which is not what is specified in the documentation. And the problem of conda/pip not playing nicely is one that goes well beyond this project. But as a decent proportion of researchers seem to be using conda I thought I'd flag it up. The optimum solution would be to distribute a conda package (though then you'd need to think about whether the dependencies are available on conda also...), but documenting the above (maybe on the message board) would help others who use conda.

conda_install_output.txt

JOSS Review: Example Python script is missing properties

RE: openjournals/joss-reviews#3089

In the main README, the example Python code crashes at isosurface.properties_norms because the surface does not have face properties. I would suggest one of two options:

  1. Remove isosurface.properties_norms and isosurface.scalar_projection((0, 0, 1) to exclude the property mapping altogether or
  2. Add property (e.g. velocity) data prior to calculating the norm of the vectors. A modified script is below that should work.
from pymatgen.io.vasp.outputs import Vasprun
from ifermi.surface import FermiSurface
from ifermi.interpolate import FourierInterpolator
from ifermi.plot import FermiSlicePlotter, FermiSurfacePlotter, save_plot, show_plot
from ifermi.kpoints import kpoints_from_bandstructure

# load VASP calculation outputs
vr = Vasprun("vasprun.xml")
bs = vr.get_band_structure()

# interpolate the energies onto a dense k-point mesh
interpolator = FourierInterpolator(bs)
dense_bs, velocities = interpolator.interpolate_bands(return_velocities=True)
dense_kpoints = kpoints_from_bandstructure(dense_bs)

# generate the Fermi surface and calculate the dimensionality
fs = FermiSurface.from_band_structure(
  dense_bs, mu=0.0, wigner_seitz=True, calculate_dimensionality=True,
  property_data=velocities, property_kpoints=dense_kpoints
)

# number of isosurfaces in the Fermi surface
fs.n_surfaces

# number of isosurfaces for each Spin channel
fs.n_surfaces_per_spin

# the total area of the Fermi surface
fs.area

# the area of each isosurface
fs.area_surfaces

# loop over all isosurfaces and check their properties
# the isosurfaces are given as a list for each spin channel
for spin, isosurfaces in fs.isosurfaces.items():
  for isosurface in isosurfaces:
    # the dimensionality (does the surface cross periodic boundaries)
    isosurface.dimensionality

    # what is the orientation
    isosurface.orientation

    # does the surface have face properties
    isosurface.has_properties

    # calculate the norms of the properties
    isosurface.properties_norms

    # calculate scalar projection of properties on to [0 0 1] vector
    isosurface.scalar_projection((0, 0, 1))

    # uniformly sample the surface faces to a consistent density
    isosurface.sample_uniform(0.1)

# plot the Fermi surface
fs_plotter = FermiSurfacePlotter(fs)
plot = fs_plotter.get_plot()

# generate Fermi slice along the (0 0 1) plane going through the Γ-point.
fermi_slice = fs.get_fermi_slice((0, 0, 1))

# number of isolines in the slice
fermi_slice.n_lines

# do the lines have segment properties
fermi_slice.has_properties

# plot slice
slice_plotter = FermiSlicePlotter(fermi_slice)
plot = slice_plotter.get_plot()

save_plot(plot, "fermi-slice.png")  # saves the plot to a file
show_plot(plot)  # displays an interactive plot

JOSS review: Documentation

RE: openjournals/joss-reviews#3089

The documentation looks very thorough and useful. I noticed a couple of smaller things:

  • There are no units for group velocity or area in the API documentation. It's in the CLI section, and is commented in the code, but for quick reference might be nice to give in the API reference also.
  • update documentation here with a link to the help forum
  • Consider highlighting papers where ifermi has already been used? From the JOSS paper I see that the iFermi authors have related publications in the last couple of years (Park 2020, Inzani 2021)

BUG:

Describe the bug
RuntimeError: Undefined plan with nthreads. This is a bug
Exception ignored in: 'pyfftw.pyfftw._fftw_plan_with_nthreads_null'
Traceback (most recent call last):
File "/home/weitao/software/anaconda3/envs/ifermi/lib/python3.9/site-packages/pyfftw/builders/_utils.py", line 285, in _Xfftn
FFTW_object = pyfftw.FFTW(input_array, output_array, axes, direction,
RuntimeError: Undefined plan with nthreads. This is a bug

conda list
ifermi 0.3.1 pypi_0 pypi
conda 23.5.2
conda-list.txt

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

fermi-withbug.zip

Query

Is there a way to view/display Fermi surface in repeated reciprocal unit cell? I have hexagonal Billion zone and have a very tiny iso-energy surface (tiny pocket) at H point (one of the corner of the BZ). Viewing it on one BZ does not show how the full pocket looks like. Was wondering if you have command lines or something I can change in my source files to achieve this.

Thank you and best regards

DEPRECATION: spglib depreciating ASE Atoms-like input.

IFermi currently supports spglib version 2.2.0. To take VASP-like input and put it into spglib, IFermi currently converts to an ASE Atoms-like format, such as in the following code.

atoms = AseAtomsAdaptor().get_atoms(self._band_structure.structure)
mapping, grid = spglib.get_ir_reciprocal_mesh(
interpolation_mesh, atoms, symprec=0.1
)

However, using ASE Atoms-like input for spglib is deprecated, and is completely absent in spglib 2.3.0.

At present, installing the latest version of spglib causes IFermi to fail.

The current work-around is to downgrade spglib to 2.2.0 or less.

A fix would involve converting the structures to spglib cell format manually, before passing to spglib, rather than relying on ASEAtomsAdaptor. A fix would be required before further upgrading spglib to 2.3.0 or greater.

BUG: During the last step of the installation process: "pip install ifermi"

I was trying to install Ifermi in the conda environment (ubuntu 22.04.4), but the step "pip install Ifermi" is giving these errors:

"error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.

│ exit code: 1

╰─> [33 lines of output]

  Traceback (most recent call last):

    File "/home/matteo/anaconda3/envs/ifermi/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>

      main()

    File "/home/matteo/anaconda3/envs/ifermi/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main

      json_out['return_val'] = hook(**hook_input['kwargs'])

                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/home/matteo/anaconda3/envs/ifermi/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel

      backend = _build_backend()

                ^^^^^^^^^^^^^^^^

    File "/home/matteo/anaconda3/envs/ifermi/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend

      obj = import_module(mod_path)

            ^^^^^^^^^^^^^^^^^^^^^^^

    File "/home/matteo/anaconda3/envs/ifermi/lib/python3.12/importlib/__init__.py", line 90, in import_module

      return _bootstrap._gcd_import(name[level:], package, level)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import

    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load

    File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked

    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed

    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import

    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load

    File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked

    File "<frozen importlib._bootstrap>", line 935, in _load_unlocked

    File "<frozen importlib._bootstrap_external>", line 995, in exec_module

    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed

    File "/tmp/pip-build-env-i11hsye6/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>

      import setuptools.version

    File "/tmp/pip-build-env-i11hsye6/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>

      import pkg_resources

    File "/tmp/pip-build-env-i11hsye6/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>

      register_finder(pkgutil.ImpImporter, find_on_path)

                      ^^^^^^^^^^^^^^^^^^^

  AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.

│ exit code: 1

╰─> See above for output."

image

JOSS Review: tests

RE: openjournals/joss-reviews#3089

Perhaps you could include information for people who want to run the unit tests locally? Might be useful for those where the standard "pip install" doesn't work smoothly.

In the documentation you state that there is CI. If it's publically accessible through Travis-CI or similar then perhaps you could provide a link so that users can verify the latest version is working as expected.

Features Reqeust: Fermi surface nesting function and bare static electron susceptibility

The Fermi surface nesting function $\xi_\mathbf{q}$ is defined as:

$$\xi_\mathbf{q} =\frac{1}{N}\sum_{\mathbf{k}, i, j}\delta(\epsilon_{\mathbf{k},i}-\epsilon_\mathrm{F})\delta(\epsilon_{\mathbf{k}+\mathbf{q},j}-\epsilon_\mathrm{F})$$

where $\epsilon_{\mathbf{k},I}$ is the Kohn-Sham eigenvalue and $i$, $j$ are the indices of energy bands, $N$ is the number of $\mathbf{k}$ points, and $\epsilon_\mathrm{F}$ is the Fermi energy.

The bare static electron susceptibility ($\chi_\mathbf{q}$) is also called bare Lindhard function and defined as below:

$$\chi_\mathbf{q} =-\frac{1}{N}\sum_{\mathbf{k}, i, j}\frac{f(\epsilon_{\mathbf{k},i}-\epsilon_\mathrm{F})-f(\epsilon_{\mathbf{k}+\mathbf{q},j}-\epsilon_\mathrm{F})}{\epsilon_{\mathbf{k},i}-\epsilon_{\mathbf{k}+\mathbf{q},j}}$$

where $f$ is the Fermi-Dirac function.

These defintions can be referred to

  1. M. D. Johannes and I. I. Mazin, Fermi surface nesting and the origin of charge density waves in metals, Phys. Rev. B 77, 165135, 2008, https://doi.org/10.1103/PhysRevB.77.165135
  2. J Low Temp Phys (2015) 178:355–366, DOI 10.1007/s10909-014-1253-y

Once the band structures at a dense k-grid is obtained by the FFT interpolation method, the above two properties of the Fermi surface can be calculated easily through the summation.

decimation not working as expected.

I am sorry if this is not the place but I can not create a new account at the support forum:

New registrations are not allowed from your IP address (maximum limit reached). Contact a staff member.

I need to ask something about the surface smoothing and increasing number of faces in the surface. My objective is to smooth the surface at the plot without open3d.
I cant get the surface smooth and decimator_method to work. whatever values I use for thee options the results are allways the same.
at some point I got a warning for 'decimation need open3d' but after installing this requirement I get planar surfaces as shown in the figure 'with open3d', instead of expected result. I would appreciate a clue about to where to start debugging.

whithout open3d:
without open3d

with open3d:
with open3d

JOSS Review: Plotting Error on Ubuntu Subshell for Windows

RE: openjournals/joss-reviews#3089

Describe the bug
When I use ifermi plot, I receive the following error message:


Start : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ Start "file:///home/arosen/ifermi/fermi-surface.html"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

To Reproduce

  1. Install IFermi
  2. Run ifermi plot on an example vasprun.xml (e.g. vasprun.zip).

Expected behavior
A plot. There is no plot.

Hypothesis
Again, perhaps this is a Windows thing. I am running IFermi on the Ubuntu subsystem for Windows since two of my common Linux workstation had issues with the installation (see #17).

BUG: Disconnected isosurfaces plotted as multiple colors

Describe the bug
When plotting a specific band index that has multiple disconnected surfaces, some surfaces are plotted as different colors. This happens in both matplotlib and plotly (I do not have the other libraries configured to test).

To Reproduce
Here is a minimal set of code to reproduce this. Please replace MGB2_PATH with a path to the example MgB2 vasprun.xml:

from pymatgen.io.vasp.outputs import Vasprun
from ifermi.interpolate import FourierInterpolator
from ifermi.surface import FermiSurface
from ifermi.plot import FermiSurfacePlotter
from pymatgen.electronic_structure.core import Spin

vr=Vasprun('MGB2_PATH/vasprun.xml')

bs = vr.get_band_structure()

interpolator = FourierInterpolator(bs)

dense_bs = interpolator.interpolate_bands(interpolation_factor=5)

dense_kpoints = kpoints_from_bandstructure(dense_bs)

fs = FermiSurface.from_band_structure(dense_bs, wigner_seitz=True)

plotter = FermiSurfacePlotter(fs)

plot = plotter.get_plot(plot_type="plotly", plot_index={Spin.up: 6})
plot.show()

Expected behavior
You should see one band (with multiple components) plotted with different colors. Perhaps this is an intended behavior, but it does not happen when no plot_index is specified. In another case with a different material where one band had many small pockets, the pockets on the boundary of the 1BZ in one octant were all multicolored, but the rest of the pockets were the same color.

Screenshots
image

Feature request: mesh decimation

Some meshes output from IFermi have a very large number of triangles due to the resolution of the input, even if the resulting surface is actually not that complicated. For long-term storage of Fermi surfaces or retrieval over a web API, it would be helpful to be able to reduce the sizes of the meshes.

I've had a look what's out there and it looks like it's a common feature request in trimesh and is actively being worked on in sk-image: scikit-image/scikit-image#4537

In the mean time, perhaps using the methods from vtk would be suitable, see here and here.

I might take a look at implementing this myself if there was interest in including this, but I don't have a lot of vtk experience so would have to see how IFermi is using vtk currently. I was imagining some sort of method on FermiSurface like decimate_mesh(factor).

Gracefully exit on bad inputs

For example, readable errors should be printed if:

  • The selected Fermi level does not cross any bands.
  • The slice plane does not cross any Fermi surfaces.

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.