qeview package

qeview.qe_analyse_FM module

class qeview.qe_analyse_FM.qe_analyse_FM(dir, name)[source]

Bases: qe_analyse_base

Class for analyzing Quantum Espresso (QE) data for ferromagnetic (FM) systems. This class provides methods to read, process, and plot Density of States (DOS), projected Density of States (pDOS), and band structure data from Quantum Espresso calculations. It also includes functionality to interface with Wannier90 for band structure calculations.

get_band_structure(bands_up_name=None, bands_dn_name=None, qe_dir='qe')[source]

Retrieve the band structure from specified or fallback files. This method attempts to load the band structure data from user-specified filenames or from a set of fallback filenames. The method searches for the files in the specified Quantum Espresso (QE) directory.

Parameters:
  • bands_up_name (str, optional) – The name of the spin up band structure file (default is None).

  • bands_dn_name (str, optional) – The name of the spin down band structure file (default is None).

  • qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Returns:

This method updates the instance variables hDFT_up, hDFT_dn and nbandsDFT with the band structure data and the number of bands, respectively.

Return type:

None

Raises:

FileNotFoundError – If the band structure file is not found.

get_full_DOS(filename='dos.dat', qe_dir='qe')[source]
Reads the Density of States (DOS) from a file and stores it in the instance variables:
  • eDOS: A list of energy values.

  • dosup: A list of DOS values for spin-up electrons.

  • dosdn: A list of DOS values for spin-down electrons.

  • efermi: The Fermi energy level.

Parameters:
  • filename (str, optional) – The name of the DOS file (default is ‘dos.dat’).

  • qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • FileNotFoundError – If the DOS file is not found.

  • IOError – If there is an error reading the DOS file.

get_pDOS(qe_dir='qe')[source]

Reads projected density of states (pDOS) data from files and organizes it by spin and orbital type. This method reads pDOS data from files in the specified directory, processes the data, and stores it in dictionaries for spin-up and spin-down states, categorized by orbital type (s, p, d).

Parameters:

qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • FileNotFoundError – If the pDOS file is not found.

  • IOError – If there is an error reading the pDOS file.

load_wannier(kpath_filename, kpaths_dir='kpaths', hr_up_name=None, hr_dn_name=None, wannier_dir='wannier')[source]

Load Wannier data and k-path information.

Parameters:
  • kpath_filename (str) – The filename of the k-path file to be loaded.

  • kpaths_dir (str, optional) – The directory where the k-path files are located. Default is ‘kpaths’.

  • hr_up_name (str, optional) – The filename of the Wannier Hamiltonian for the spin-up component. Default is None.

  • hr_dn_name (str, optional) – The filename of the Wannier Hamiltonian for the spin-down component. Default is None.

  • wannier_dir (str, optional) – The directory where the Wannier files are located. Default is ‘wannier’.

Return type:

None

plot_BS(efrom=-15, eto=15, efermi=None, saveQ=False, picname='BS.png', title='BS', width=7, height=4.375)[source]

Plots the band structure (BS) of the material with spin-up and spin-down components.

Parameters:
  • efrom (float, optional) – The lower energy limit for the plot. Default is -15.

  • eto (float, optional) – The upper energy limit for the plot. Default is 15.

  • efermi (float, optional) – The Fermi energy level. If not provided, it will use self.efermi.

  • saveQ (bool, optional) – If True, the plot will be saved as an image file. Default is False.

  • picname (str, optional) – The name of the image file to save the plot. Default is ‘BS.png’.

  • title (str, optional) – The title of the plot. Default is ‘BS’.

  • width (float, optional) – The width of the plot in inches. Default is 7.

  • height (float, optional) – The height of the plot in inches. Default is 7/1.6.

Raises:

Exception – If no bands were parsed, or if high symmetry points were not parsed, or if efermi is not defined.

Notes

  • Ensure that get_band_structure() and get_sym_points() are run before calling this method.

  • Ensure that get_full_DOS(filename=dos.dat) is run if efermi is not provided.

plot_FullDOS(efrom=-5, eto=5, yto=10, saveQ=False, picname='DOS.png', title='DOS', width=7, height=4.375, qe_dir='qe')[source]

Plots the Density of States (DOS) for a given energy range.

Parameters:
  • efrom (float, optional) – The starting energy value for the plot (default is -5).

  • eto (float, optional) – The ending energy value for the plot (default is 5).

  • yto (float, optional) – The maximum absolute value for the y-axis (default is 10).

  • saveQ (bool, optional) – If True, the plot will be saved as an image file (default is False).

  • picname (str, optional) – The name of the image file to save the plot (default is ‘DOS.png’).

  • title (str, optional) – The title of the plot (default is ‘DOS’).

  • width (float, optional) – The width of the plot (default is 7).

  • height (float, optional) – The height of the plot (default is 7/1.6).

  • qe_dir (str, optional) – The directory where Quantum Espresso files are located (default is ‘qe’).

Return type:

None

Notes

  • If the DOS data is not initialized, the method will call get_full_DOS to initialize it.

  • The x-axis represents the energy relative to the Fermi energy (E - E_f) in eV.

  • The y-axis represents the density of states in arbitrary units.

plot_pDOS(element='1', efermi=None, efrom=-15, eto=15, yfrom=-10, yto=10, saveQ=False, picname='pDOS.png', title='pDOS', width=7, height=4.375, qe_dir='qe')[source]

Plots the projected Density of States (pDOS) for a given element and energy range.

Parameters:
  • element (str, optional) – The element number to plot the pDOS for (default is “1”).

  • efermi (float, optional) – The Fermi energy level (default is None).

  • efrom (float, optional) – The starting energy value for the plot (default is -15).

  • eto (float, optional) – The ending energy value for the plot (default is 15).

  • yfrom (float, optional) – The starting y-axis value for the plot (default is -10).

  • yto (float, optional) – The ending y-axis value for the plot (default is 10).

  • saveQ (bool, optional) – If True, the plot will be saved to a file (default is False).

  • picname (str, optional) – The name of the file to save the plot (default is ‘pDOS.png’).

  • title (str, optional) – The title of the plot (default is ‘pDOS’).

  • width (float, optional) – The width of the plot (default is 7).

  • height (float, optional) – The height of the plot (default is 7/1.6).

  • qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • Exception – If efermi is not defined and get_full_DOS has not been run.

  • Exception – If no pDOS files are found for the specified element.

plot_wannier_BS(efrom=-15, eto=15, saveQ=False, picname='BS_wannier.png', title='BS Wannier', width=7, height=4.375)[source]

Plots the Wannier band structure.

Parameters:
  • efrom (float, optional) – The lower energy limit for the plot (default is -15).

  • eto (float, optional) – The upper energy limit for the plot (default is 15).

  • saveQ (bool, optional) – If True, the plot will be saved to a file (default is False).

  • picname (str, optional) – The name of the file to save the plot (default is ‘BS_wannier.png’).

  • title (str, optional) – The title of the plot (default is ‘BS Wannier’).

  • width (float, optional) – The width of the plot in inches (default is 7).

  • height (float, optional) – The height of the plot in inches (default is 7/1.6).

Return type:

None

Raises:

Exception – If no bands were parsed from QE or Wannier. If efermi is not defined. If High Symmetry Points were not parsed from band.in file.

print_bands_range(band_from=None, band_to=None, efermi=None)[source]

This method prints the Fermi energy and the energy range for each band in the specified range. The energy range is printed both in absolute terms and relative to the Fermi energy.

Parameters:
  • band_from (int, optional) – The starting band index (inclusive) (defaults to 0).

  • band_to (int, optional) – The ending band index (exclusive) (defaults to the total number of bands if not provided).

  • efermi (float, optional) – The Fermi energy level (default is None).

Return type:

None

Raises:
  • Exception – If no bands were parsed.

  • Exception – If efermi is not defined in class and not provided.

qeview.qe_analyse_PM module

class qeview.qe_analyse_PM.qe_analyse_PM(dir, name)[source]

Bases: qe_analyse_base

Class for analyzing Quantum Espresso (QE) data with a focus on paromagnetic (PM) systems. This class inherits from qe_analyse_base and provides methods to read and analyze density of states (DOS), projected density of states (pDOS), and band structure (BS) data from QE calculations. It also includes methods to plot these data.

get_band_structure(bands_filename='bands.dat.gnu', qe_dir='qe')[source]

Reads and processes the band structure data from a specified file.

Parameters:
  • bands_filename (str) – The name of the file containing the band structure data. Default is ‘bands.dat.gnu’.

  • qe_dir (str) – The directory where the Quantum Espresso output files are located. Default is ‘qe’.

Returns:

This method updates the instance variables hDFT and nbandsDFT with the band structure data and the number of bands, respectively.

Return type:

None

get_full_DOS(filename='dos.dat', qe_dir='qe')[source]
Reads the Density of States (DOS) from a file and stores it in the instance variables:
  • eDOS: A list of energy values.

  • dos: A list of DOS values for spin-down electrons.

  • efermi: The Fermi energy level.

Parameters:
  • filename (str, optional) – The name of the DOS file (default is ‘dos.dat’).

  • qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • FileNotFoundError – If the DOS file is not found.

  • IOError – If there is an error reading the DOS file.

get_pDOS(qe_dir='qe')[source]

Reads projected density of states (pDOS) data from files and organizes it by orbital type. This method reads pDOS data from files in the specified directory, processes the data, and stores it categorized by orbital type (s, p, d).

Parameters:

qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • FileNotFoundError – If the pDOS file is not found.

  • IOError – If there is an error reading the pDOS file.

load_wannier(kpath_filename, kpaths_dir='kpaths', wannier_hr_name='wannier90_hr.dat', wannier_dir='wannier')[source]

Load Wannier data and k-path information.

Parameters:
  • kpath_filename (str) – The filename of the k-path file to be loaded.

  • kpaths_dir (str, optional) – The directory where the k-path files are located. Default is ‘kpaths’.

  • wannier_hr_name (str, optional) – The filename of the Wannier Hamiltonian for the spin-up component. Default is .’wannier90_hr.dat’

  • wannier_dir (str, optional) – The directory where the Wannier files are located. Default is ‘wannier’.

Return type:

None

plot_BS(efrom=-15, eto=15, efermi=None, saveQ=False, picname='BS.png', title='BS', width=7, height=4.375)[source]

Plots the band structure (BS) of the material with spin-up and spin-down components.

Parameters:
  • efrom (float, optional) – The lower energy limit for the plot. Default is -15.

  • eto (float, optional) – The upper energy limit for the plot. Default is 15.

  • efermi (float, optional) – The Fermi energy level. If not provided, it will use self.efermi.

  • saveQ (bool, optional) – If True, the plot will be saved as an image file. Default is False.

  • picname (str, optional) – The name of the image file to save the plot. Default is ‘BS.png’.

  • title (str, optional) – The title of the plot. Default is ‘BS’.

  • width (float, optional) – The width of the plot in inches. Default is 7.

  • height (float, optional) – The height of the plot in inches. Default is 7/1.6.

Raises:

Exception – If no bands were parsed, or if high symmetry points were not parsed, or if efermi is not defined.

Notes

  • Ensure that get_band_structure() and get_sym_points() are run before calling this method.

  • Ensure that get_full_DOS(filename=dos.dat) is run if efermi is not provided.

plot_FullDOS(efrom=-5, eto=5, yto=10, saveQ=False, picname='DOS.png', title='DOS', width=7, height=4.375, qe_dir='qe')[source]

Plots the Density of States (DOS) for a given energy range.

Parameters:
  • efrom (float, optional) – The starting energy value for the plot (default is -5).

  • eto (float, optional) – The ending energy value for the plot (default is 5).

  • yto (float, optional) – The maximum absolute value for the y-axis (default is 10).

  • saveQ (bool, optional) – If True, the plot will be saved as an image file (default is False).

  • picname (str, optional) – The name of the image file to save the plot (default is ‘DOS.png’).

  • title (str, optional) – The title of the plot (default is ‘DOS’).

  • width (float, optional) – The width of the plot (default is 7).

  • height (float, optional) – The height of the plot (default is 7/1.6).

  • qe_dir (str, optional) – The directory where Quantum Espresso files are located (default is ‘qe’).

Return type:

None

Notes

  • If the DOS data is not initialized, the method will call get_full_DOS to initialize it.

  • The x-axis represents the energy relative to the Fermi energy (E - E_f) in eV.

  • The y-axis represents the density of states in arbitrary units.

plot_pDOS(element='1', efermi=None, efrom=-15, eto=15, yto=10, saveQ=False, picname='pDOS.png', title='pDOS', width=7, height=4.375, qe_dir='qe')[source]

Plots the projected Density of States (pDOS) for a given element and energy range.

Parameters:
  • element (str, optional) – The element number to plot the pDOS for (default is “1”).

  • efermi (float, optional) – The Fermi energy level (default is None).

  • efrom (float, optional) – The starting energy value for the plot (default is -15).

  • eto (float, optional) – The ending energy value for the plot (default is 15).

  • yto (float, optional) – The ending y-axis value for the plot (default is 10).

  • saveQ (bool, optional) – If True, the plot will be saved to a file (default is False).

  • picname (str, optional) – The name of the file to save the plot (default is ‘pDOS.png’).

  • title (str, optional) – The title of the plot (default is ‘pDOS’).

  • width (float, optional) – The width of the plot (default is 7).

  • height (float, optional) – The height of the plot (default is 7/1.6).

  • qe_dir (str, optional) – The directory where the QE data is located (default is ‘qe’).

Return type:

None

Raises:
  • Exception – If efermi is not defined and get_full_DOS has not been run.

  • Exception – If no pDOS files are found for the specified element.

plot_wannier_BS(efrom=-15, eto=15, saveQ=False, picname='BS_wannier.png', title='BS Wannier', width=7, height=4.375)[source]

Plots the Wannier band structure.

Parameters:
  • efrom (float, optional) – The lower energy limit for the plot (default is -15).

  • eto (float, optional) – The upper energy limit for the plot (default is 15).

  • saveQ (bool, optional) – If True, the plot will be saved to a file (default is False).

  • picname (str, optional) – The name of the file to save the plot (default is ‘BS_wannier.png’).

  • title (str, optional) – The title of the plot (default is ‘BS Wannier’).

  • width (float, optional) – The width of the plot in inches (default is 7).

  • height (float, optional) – The height of the plot in inches (default is 7/1.6).

Return type:

None

Raises:

Exception – If no bands were parsed from QE or Wannier. If efermi is not defined. If High Symmetry Points were not parsed from band.in file.

print_bands_range(band_from=None, band_to=None, efermi=None)[source]

This method prints the Fermi energy and the energy range for each band in the specified range. The energy range is printed both in absolute terms and relative to the Fermi energy.

Parameters:
  • band_from (int, optional) – The starting band index (inclusive) (defaults to 0).

  • band_to (int, optional) – The ending band index (exclusive) (defaults to the total number of bands if not provided).

  • efermi (float, optional) – The Fermi energy level (default is None).

Return type:

None

Raises:
  • Exception – If no bands were parsed.

  • Exception – If efermi is not defined in class and not provided.

qeview.qe_base module

class qeview.qe_base.qe_analyse_base(dir, name)[source]

Bases: ABC

qe_analyse_base is an abstract base class for analyzing Quantum Espresso (QE) calculations. It provides methods to read and process various QE output files, including density of states (DOS), band structure, crystal structure, and high symmetry points.

abstract get_band_structure(bands_up_name=None, bands_dn_name=None)[source]

Retrieves and processes spin band structure data from specified files.

Attributes for FM:
  • hDFT_up (numpy.ndarray): Spin-up band structure data.

  • hDFT_dn (numpy.ndarray): Spin-down band structure data.

  • nbandsDFT (int): Number of bands in the DFT calculation.

Attributes for PM:
  • hDFT (numpy.ndarray): band structure data.

  • nbandsDFT (int): Number of bands in the DFT calculation.

get_crystall_struct(filename='data-file-schema.xml', qe_dir='qe')[source]

Reads and processes the crystallographic structure from a specified XML file. Prints:

  • Unit Cell Volume in cubic Angstroms.

  • Reciprocal-space vectors in Angstroms^-1 and in units of 2π/alat.

  • Real-space vectors in Angstroms and in units of alat.

  • Atomic positions in Cartesian coordinates (in units of alat and Angstroms) and fractional coordinates.

Parameters:
  • filename (str, optional) – The name of the XML file containing the crystallographic data. Defaults to ‘data-file-schema.xml’.

  • qe_dir (str, optional) – The directory where the file is located. Default is ‘qe’.

Raises:
  • FileNotFoundError – If the specified file is not found.

  • IOError – If there is an error reading the file with qeschema.

qerun_dict

Dictionary containing parsed data from the XML file. Tree Structure Example : This page contains the structure of qerun_dict.

Type:

dict

alat

Lattice constant in Angstroms.

Type:

float

acell

Real-space lattice vectors in Angstroms.

Type:

numpy.ndarray

bcell

Reciprocal-space lattice vectors in Angstroms^-1.

Type:

numpy.ndarray

pos

Atomic positions in the unit cell.

Type:

tuple

abstract get_full_DOS(filename='dos.dat')[source]

Reads the density of states (DOS) data from a file and stores it in the instance variables.

This method initializes the following instance variables:
  • eDOS: A list of energy values.

  • efermi: The Fermi energy level.

For spinpolarized DOS:
  • dosup: A list of DOS values for spin-up electrons.

  • dosdn: A list of DOS values for spin-down electrons.

For non-spinpolarized DOS:
  • dos: A list of DOS values.

get_integer_kpath(N_points_direction=10, num_points_betweens=5, saveQ=False, filename='kpath_integer.dat', directory='kpaths')[source]

Generates a k-path with integer coordinates for high symmetry points. The method prints the k-path lines and the high symmetry points names during execution.

Parameters:
  • N_points_direction (int, optional) – The number of points in each direction (default is 10).

  • num_points_betweens (int or list of int, optional) – The number of points between each pair of high symmetry points. If an integer is provided, the same number of points is used between all pairs. If a list is provided, it should have length NHSP-1, where NHSP is the number of high symmetry points (default is 5).

  • filename (str, optional) – The name of the file to save the k-path (default is ‘kpath_integer.dat’).

Returns:

  • kpath_return (list of numpy arrays) – List of k-points with integer coordinates.

  • kpath_draw_path_return (list of floats) – List of distances corresponding to each k-point in units 2 pi / alat.

get_qe_kpathBS(points_per_unit=10, saveQ=True, filename='kpath_qe2.txt', directory='kpaths')[source]

Generate the k-path for band structure calculations and optionally save it to a file.

Parameters:
  • points_per_unit (int, optional) – Number of points per unit distance between high symmetry points (default is 10).

  • saveQ (bool, optional) – If True, save the k-path to a file (default is True).

  • filename (str, optional) – Name of the file to save the k-path (default is “kpath_qe2.txt”).

  • directory (str, optional) – Directory where the file will be saved (default is “kpaths”).

Returns:

  • kpath_coords (np.ndarray) – Array of k-point coordinates along the path.

  • kpath_dists (np.ndarray) – Array of distances along the k-path.

Raises:
  • Exception – If high symmetry points were not parsed from the band.in file.

  • AssertionError – If there are not enough high symmetry points.

  • IOError – If there is an error writing to the file.

static get_spin_BS(file_path)[source]

Reads spin band structure data from a default qe bands file and returns it as a numpy array.

Parameters:

file_path (str) – The path to the file containing the band structure data.

Returns:

A 2D numpy array where each element is a numpy array representing a band.

Return type:

numpy.ndarray

Raises:
  • FileNotFoundError – If the band structure file is not found.

  • IOError – If there is an error reading the band structure file.

get_sym_points(filename='band.in', qe_dir='qe')[source]

Parses the high symmetry points from a Quantum Espresso input file and calculates their distances and coordinates. Populates the HighSymPointsNames, HighSymPointsDists, and HighSymPointsCoords attributes

Parameters:
  • filename (str, optional) – The name of the file to read the high symmetry points from. Default is ‘band.in’.

  • qe_dir (str, optional) – The directory where the file is located. Default is ‘qe’.

Raises:
  • FileNotFoundError – If the specified file does not exist.

  • IOError – If there is an error reading the file.

qeview.wannier_loader module

class qeview.wannier_loader.Wannier_loader[source]

Bases: ABC

Wannier_loader is an abstract base class for loading and manipulating Wannier Hamiltonians.

get_dense_hk(nkpt=10, find_eigsQ=False)[source]

Generate a dense grid of k-points and compute the Hamiltonian for each k-point.

Parameters:
  • nkpt (int, optional) – Number of k-points along each dimension. Default is 10.

  • find_eigsQ (bool, optional) – If True, compute eigenvalues of the Hamiltonian matrices (interpolated band structure). Default is False.

Returns:

  • bs (ndarray (nwa, nkpt, spin)) – Array of band structures or eigenvalues, depending on the value of find_eigsQ.

  • hks_spins (ndarray (nwa, nwa, nkpt, spin)) – Array of Hamiltonian matrices for each k-point.

get_dense_hk_symmetric(nkpt=10, krange=1, find_eigsQ=False)[source]

Generate a dense grid of k-points from -krange to krange (fractional coords) and compute the Hamiltonian matrix for each k-point.

Parameters:
  • nkpt (int, optional) – Number of k-points along each dimension. Default is 10.

  • krange (float, optional) – Range of k-points in reciprocal space. Default is 1.

  • find_eigsQ (bool, optional) – If True, compute eigenvalues of the Hamiltonian matrices (interpolated band structure). Default is False.

Returns:

  • bs (ndarray (nwa, nkpt, spin)) – Array of band structures or eigenvalues, depending on the value of find_eigsQ.

  • hks_spins (ndarray (nwa, nwa, nkpt, spin)) – Array of Hamiltonian matrices for each k-point.

get_hk_eig_path(path, find_eigsQ=False, spin=0)[source]

Calculate the eigenvalues and Hamiltonians along a given k-path.

Parameters:
  • path (list of array-like) – A list of k-points in the path.

  • find_eigsQ (bool, optional) – If True, compute eigenvalues of the Hamiltonian matrices (interpolated band structure). Default is False.

  • spin (int, optional) – Spin index to select the appropriate Hamiltonian. Default is 0.

Returns:

  • band_str (ndarray (nkpt, nwa)) – Array of sorted real parts of eigenvalues for each k-point.

  • hks_bs (ndarray (nkpt, nwa, nwa)) – Array of Hamiltonians for each k-point.

abstract get_hk_spins(path, find_eigsQ=False)[source]

get hamiltonians and eigenvalues along the path for one/both spins

get_wannier_BS(spin=0)[source]

Retrieve the Wannier band structure for a given spin.

Parameters:

spin (int) – The spin index for which to retrieve the band structure. Default is 0.

Returns:

band_str – The eigenvalues of the Hamiltonian along the specified k-path.

Return type:

numpy.ndarray (nkpt, nwa)

load_hk_pickle(dump_name, wannier_dir='wannier')[source]
load_hr_pickle(dump_name, wannier_dir='wannier')[source]
load_kpath(file_path)[source]

Load k-points and their distances from a file.

Parameters:

file_path (str) – The path to the file containing the k-points.

Raises:
  • FileNotFoundError – If the specified file does not exist.

  • IOError – If there is an error reading the file.

  • AssertionError – If the file format is incorrect.

Notes

The file should contain lines formatted as: M 0.0 0.5 0.0 0.591

Examples

The following is an example of the expected input file format:

G  0.00000000  0.00000000  0.00000000  0.00000000
.  0.00000000  0.10000000  0.00000000  0.11820789
.  0.00000000  0.20000000  0.00000000  0.23641577
.  0.00000000  0.30000000  0.00000000  0.35462366
.  0.00000000  0.40000000  0.00000000  0.47283155
M  0.00000000  0.50000000  0.00000000  0.59103943
. -0.11111111  0.55555556  0.00000000  0.70478502
...
where:
  • The first element is a label (ignored in this function).

  • The next three elements are the k-point coordinates (fractional).

  • The last element is the distance associated with the k-point (in 2 pi/ alat).

load_util(hr_filepath)[source]

Load Wannier Hamiltonian data from a specified file.

Parameters:

hr_filepath (str) – The file path to the Wannier Hamiltonian file.

Returns:

  • R_coords (np.ndarray(Rpts, 3)) – An array of R coordinates. Second dimention should be 3 even in 2D case (zero value)

  • hr (np.ndarray (nwa, nwa, Rpts)) – An array representing the Hamiltonian matrix.

Raises:
  • FileNotFoundError – If the specified file is not found.

  • IOError – If there is an error reading the file.

save_hk_pickle(dump_name, wannier_dir='wannier')[source]
class qeview.wannier_loader.Wannier_loader_FM(hr_up_name=None, hr_dn_name=None, wannier_dir='wannier', **kwargs)[source]

Bases: Wannier_loader

A class to handle loading and processing of Wannier90 data for ferromagnetic hamiltonians.

get_hk_spins(path, find_eigsQ=False)[source]

Computes the Hamiltonian matrix elements and optionally the eigenvalues for spin-up and spin-down states along a given path.

Parameters:
  • path (np.ndarray (n_points, n_dimensions)) – The k-point path along which to compute the Hamiltonian and eigenvalues.

  • find_eigsQ (bool, optional) – If True, the eigenvalues will also be computed. Defaults to False.

Returns:

  • bs_spins (np.ndarray(nwa, nkpt, spin)) – Array of band structures or eigenvalues, depending on the value of find_eigsQ.

  • hks_spins (np.ndarray(nwa, nwa, nkpt, spin)) – Array of Hamiltonian matrices for each k-point.

load_wannier90(hr_up_name=None, hr_dn_name=None, wannier_dir='wannier', **kwargs)[source]

Load Wannier90 Hamiltonians from specified or default filenames.

This method attempts to load Wannier90 Hamiltonians from the provided filenames or from default filenames (‘hrup.dat’ and ‘hrdn.dat’) within the specified directory. The Hamiltonians are expected to have the same R mesh.

Parameters:
  • hr_up_name (str, optional) – Filename for the spin-up Hamiltonian. Defaults to None.

  • hr_dn_name (str, optional) – Filename for the spin-down Hamiltonian. Defaults to None.

  • wannier_dir (str, optional) – Directory containing the Wannier90 files. Defaults to ‘wannier’.

  • **kwargs (Additional keyword arguments.)

Raises:
  • FileNotFoundError – If no valid Wannier90 Hamiltonians are found in the specified directory.

  • Fields

  • -------

:raises complex_hr : numpy.ndarray(nwa, nwa, Rpts, spin): complex wannier hamiltonian in R basis :raises R_coords: numpy.ndarray(Rpts, 3):

class qeview.wannier_loader.Wannier_loader_PM(wannier_hr_filename, wannier_dir='wannier')[source]

Bases: Wannier_loader

A class to handle loading and processing of Wannier90 data for paramagnetic hamiltonians.

get_hk_spins(path, find_eigsQ=False)[source]

Computes the Hamiltonian matrix elements and optionally the eigenvalues along a given path.

Parameters:
  • path (np.ndarray (n_points, n_dimensions)) – The k-point path along which to compute the Hamiltonian and eigenvalues.

  • find_eigsQ (bool, optional) – If True, the eigenvalues will also be computed. Defaults to False.

Returns:

  • bs_spins (np.ndarray(nwa, nkpt, 1)) – Array of band structures or eigenvalues, depending on the value of find_eigsQ.

  • hks_spins (np.ndarray(nwa, nwa, nkpt, 1)) – Array of Hamiltonian matrices for each k-point.

load_wannier90(wannier_hr_filename, wannier_dir='wannier', **kwargs)[source]

Load Wannier90 Hamiltonian from specified filename.

Parameters:
  • wannier_hr_filename (str) – Filename for the wannier Hamiltonian.

  • wannier_dir (str, optional) – Directory containing the Wannier90 files. Defaults to ‘wannier’.

  • **kwargs (Additional keyword arguments.)

Module contents