nanotools.bandunfolding module

Created on 2020-05-11

@author: Vincent Michaud-Rioux

class nanotools.bandunfolding.BandUnfoldData(primitive_cell=None, kpoint=NOTHING, spectral_function=None)[source]

Bases: Base

BandUnfolding data class.

primitive_avec

Lattice vectors of the primitive cell.

spectral_function

Spectral function of the unfolded band structure (i.e. weights in [0, 1] for each Bloch state).

Type:

numpy.ndarray

class nanotools.bandunfolding.BandUnfolding(system, unfold=NOTHING, energy=NOTHING, solver=NOTHING, classname: str = NOTHING)[source]

Bases: Base

BandUnfolding class.

Examples:

from nanotools import BandUnfolding as BU
import numpy as np
calc = BU.from_totalenergy("nano_scf_out.json")
calc.set_primitive_cell(avec=3.74/2.*(np.ones((3,3)) - np.eye(3)))
calc.set_kpoint_path(special_points=["L","G","X"])
calc.solve()
system

Object containing system related parameters.

Type:

nanotools.system.System

unfold

Object containing the unfolding data and parameters (primitive lattice vectors, spectral function, etc.).

Type:

nanotools.bandunfolding.BandUnfoldData

energy

Object containing the total energy and its derivatives (force, stress, etc.).

Type:

nanotools.energy.Energy

solver

Object containing solver related parameters.

Type:

nanotools.solver.Solver

plot_bs(filename=None, show=True)[source]

Generates a plot of the band structure.

Parameters:
  • filename (str, optional) – If not None, then the figure is saved to filename.

  • show (bool, optional) – If True block and show figure. If False, do not show figure.

Returns:

A figure handle.

Return type:

fig (matplotlib.figure.Figure)

plot_spectral_function(filename=None, show=True)[source]

Generates a plot of the spectral function.

Parameters:
  • filename (str, optional) – If not None, then the figure is saved to filename.

  • show (bool, optional) – If True block and show figure. If False, do not show figure.

Returns:

A figure handle.

Return type:

fig (matplotlib.figure.Figure)

set_kpoint_path(special_points=None, grid=None)[source]

Sets the kpoint path for the band structure calculation.

Parameters:
  • special_points (list) – List of high-symmetry point labels or fractional coordinates. For example, [“L”, “G”, “X”, “W”].

  • grid (int) – Number of points along the k-point path. Note that a line [“L”, “G”, “X”, “W”] is always decomposed into segments [[“L”, “G”], [“G”, “X”], [“X”, “W”]]. Since “G” and “X” are duplicated, if grid is set to 20, internal quantities like kpoint.fractional_coordinates will have size 22 in the k-point axis.

solve(input='nano_bsu_in', output='nano_bsu_out')[source]

Performs a non.self-consistent calculation calling rescuplus.

Parameters:
  • filename (str) – The object is saved to an input file filename which is read by rescuplus.

  • output (str) – The results (with various extensions) are moved to files output and the results are loaded to the object.