Skip to main content

The BandU program constructs a rank ordered series of crystal orbitals using principal component analysis. These principal orbital components can then be projected on the Fermi surface and visualized

Project description

BandU


BandU OVERVIEW

A package that performs a principal component inspired analysis on the Bloch wavefunctions of periodic material to provide a real space visualization of the states that significantly contribute to the Fermi surface.

These real space functions can then be projected onto the Fermi surface to provide a clear visual for where a nesting vector may combine two points in reciprocal space.

This package is designed to be very straightforward in its use, offering Fermi surface and BandU function visualizations in as little as 5 lines of Python script. This package can also be used to just visual the Fermi surface, without BandU projections, if provided with the necessary k-point and eigenvalue data.


INSTALLATION INSTRUCTIONS

  1. Inside that directory type on the command line
    "git clone https://github.com/pcross0405/BandU.git"

  2. Type "cd BandU"

  3. Make sure you have python's build tool up to date with
    "python3 -m pip install --upgrade build"

  4. Once up to date type
    "python3 -m build"

  5. This should create a "dist" directory with a .whl file inside

  6. On the command line type
    "pip install dist/*.whl"


DEPENDENCIES

REQUIRED FOR VISUALIZING FERMI SURFACE

REQUIRED FOR CUSTOM COLORS

WAVEFUNCTIONS THAT CAN BE READ DIRECTLY

Currently only reading directly from ABINIT 7 and 10 wavefunctions is supported. Reading eigenvalues from other DFT packages will come in future updates.


REPORTING ISSUES

Please report any issues here


TUTORIAL

An example script that can run the different functions of the BandU program is given below.

from bandu.bandu import BandU
from bandu.abinit_reader import AbinitWFK
from bandu.isosurface_class import Isosurface
from bandu.plotter import Plotter
from bandu.colors import Colors

root_name = 'your file root name here' # root_name of WFK files and of XSF files
xsf_number = 1 # XSF file number to be read in
energy_level = 0.000 # Energy relative to the Fermi energy to be sampled
width = 0.0005 # Search half the the width above and below the specified energy level
wfk_path = f'path\to\WFK\file\{root_name}_o_WFK'
xsf_path = f'path\to\XSF\file\{root_name}_bandu_{xsf_number}'
bandu_name = f'{root_name}_bandu'

def main(
        Band_U:bool, Iso_Surf:bool, Load_Surf:bool
)->None:
    if Band_U: # create BandU principal orbital components
        wfk_gen = AbinitWFK(wfk_path).ReadWFK(
            energy_level = energy_level,
            width=width
         )
        wfk = BandU(
            wfks = wfk_gen,
            energy_level = energy_level,
            width = width,
            sym = True
         )
        wfk.ToXSF(
            xsf_name = bandu_name,
            nums = [1,10]
         )
    elif Iso_Surf: # construct energy isosurfaces and plot them
        contours = Isosurface(
            wfk_name = wfk_path,
            energy_level = energy_level,
            width = width
        )
        contours.Contour() # make contours
        plot = Plotter(
            isosurface = contours,
            save_file=f'{root_name}_bandu_{xsf_number}_fermi_surf.pkl'
         ) # create plotter object
        overlap_vals = plot.SurfaceColor(
            wfk_path=wfk_path,
            xsf_path=xsf_path,
        ) # compute overlap between principal orbital component and states in Brillouin Zone
        plot.Plot(
            surface_vals = overlap_vals,
            colormap = Colors().blues,
        ) # plot contours
    elif Load_Surf:
        Plotter().Load(
            save_path='{root_name}_bandu_{xsf_number}_fermi_surf.pkl',
        )
if __name__ == '__main__':
    main(
        Band_U = False,
        Iso_Surf = False,
        Load_Surf = False,
    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bandu-1.1.0.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bandu-1.1.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file bandu-1.1.0.tar.gz.

File metadata

  • Download URL: bandu-1.1.0.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for bandu-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c341315c9c426104669c3f1bb8be689a588fbfa049690f043627a31d9ab1e545
MD5 0a937395e0869c358f3d69ea82474f6e
BLAKE2b-256 68dfb921d6ee30a2b66e415016dfe283f159ce9bdd15d1ca8b7f72f6b877c275

See more details on using hashes here.

File details

Details for the file bandu-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bandu-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for bandu-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec8941cf25f90ccd1593e899167f760c17dfdc63fd3d5e12e6d8a3af5d7a059
MD5 215ab9fdd3183c07f16446d77ceb1480
BLAKE2b-256 be260e10c891e4f15479d09b6a42a83bc85dba1f36bfd82c3e39314f9d78fad8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page