You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Remove isosurface.properties_norms and isosurface.scalar_projection((0, 0, 1) to exclude the property mapping altogether or
Add property (e.g. velocity) data prior to calculating the norm of the vectors. A modified script is below that should work.
frompymatgen.io.vasp.outputsimportVasprunfromifermi.surfaceimportFermiSurfacefromifermi.interpolateimportFourierInterpolatorfromifermi.plotimportFermiSlicePlotter, FermiSurfacePlotter, save_plot, show_plotfromifermi.kpointsimportkpoints_from_bandstructure# load VASP calculation outputsvr=Vasprun("vasprun.xml")
bs=vr.get_band_structure()
# interpolate the energies onto a dense k-point meshinterpolator=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 dimensionalityfs=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 surfacefs.n_surfaces# number of isosurfaces for each Spin channelfs.n_surfaces_per_spin# the total area of the Fermi surfacefs.area# the area of each isosurfacefs.area_surfaces# loop over all isosurfaces and check their properties# the isosurfaces are given as a list for each spin channelforspin, isosurfacesinfs.isosurfaces.items():
forisosurfaceinisosurfaces:
# the dimensionality (does the surface cross periodic boundaries)isosurface.dimensionality# what is the orientationisosurface.orientation# does the surface have face propertiesisosurface.has_properties# calculate the norms of the propertiesisosurface.properties_norms# calculate scalar projection of properties on to [0 0 1] vectorisosurface.scalar_projection((0, 0, 1))
# uniformly sample the surface faces to a consistent densityisosurface.sample_uniform(0.1)
# plot the Fermi surfacefs_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 slicefermi_slice.n_lines# do the lines have segment propertiesfermi_slice.has_properties# plot sliceslice_plotter=FermiSlicePlotter(fermi_slice)
plot=slice_plotter.get_plot()
save_plot(plot, "fermi-slice.png") # saves the plot to a fileshow_plot(plot) # displays an interactive plot
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
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:isosurface.properties_norms
andisosurface.scalar_projection((0, 0, 1)
to exclude the property mapping altogether orThe text was updated successfully, but these errors were encountered: