API Reference¶
This detailed reference lists all the classes and functions contained in the package. If you are just looking to get started, read the Tutorial first.
The Lattice
describes the unit cell of a crystal, while the Model
is used to
build up a larger system by translating the unit cell to fill a certain shape or symmetry.
The model builds the Hamiltonian matrix by applying fields and other modifier parameters.
|
Unit cell of a Bravais lattice, the basic building block of a tight-binding model |
|
Builds a Hamiltonian from lattice, shape, symmetry and modifier parameters |
Shapes¶
The geometry of a finite-sized system can be defined using the Polygon
class (2D only)
or using FreeformShape
(1 to 3 dimensions). A few common shapes are included in the
package and listed below. These predefined shapes are just functions which configure and return
a shape class object.
Building blocks
|
Shape defined by a list of vertices in a 2D plane |
|
Shape in 1 to 3 dimensions, defined by a function and a bounding box |
|
A composition of 2 shapes using some operator (and, or, xor...) |
Predefined shapes
|
A circle in the xy plane |
|
A line shape intended for 1D lattices or to specify leads for 2D lattices |
|
Follow the primitive lattice shape -- just repeat the unit cell a number of times |
|
A rectangle in the xy plane |
|
A polygon shape where all sides have equal length |
Symmetry¶
|
Simple translational symmetry in, the form of \(e^{i \vec k \cdot \vec r}\). |
Modifiers¶
The following decorators are used to create functions which express some feature of a tight-binding model, such as various fields, defects or geometric deformations.
Decorators
|
Modify the state (valid or invalid) of lattice sites, e.g. to create vacancies. |
Modify the position of lattice sites, e.g. to apply geometric deformations. |
|
|
Modify the onsite energy, e.g. to apply an electric field. |
|
Modify the hopping energy, e.g. to apply a magnetic field. |
Predefined modifiers
|
Apply a constant onsite energy to every lattice site |
Forces the model to use double precision even if that's not require by any modifier |
|
Forces the model to use complex numbers even if that's not require by any modifier |
|
Forces the model to add the phase so that eigenvectors have the right phase |
Generators¶
The following decorators are used to create functions which add features to a tight-binding model, such as hoppings and sites.
Decorators
|
Introduce a new hopping family (with a new |
|
Introduce a new site family (with a new |
Compute¶
After a Model
is constructed, computational routines can be applied to determine various
physical properties. The following submodules contain functions for exact diagonalization as well
as some approximative compute methods. Follow the links below for details.
Eigensolvers with a few extra computation methods |
|
Computations based on Chebyshev polynomial expansion |
Experimental
Multi-threaded functions for parameter sweeps |
Results¶
Result objects are usually produced by compute functions, but they are also used to express certain model properties. They hold data and offer postprocessing and plotting methods specifically adapted to the nature of the physical properties (i.e. the stored data).
The utility functions pb.save()
and pb.load()
can be used to
efficiently store entire result objects into files. The information about the kind of physical
property is saved along with the raw data, i.e. executing result = pb.load("data_file.pbz")
followed by result.plot()
will work and present the appropriate figure.
|
Save an object to a compressed file |
|
Load an object from a compressed file |
|
Create a path which connects the given k points |
|
A ndarray which represents a path connecting certain points |
|
Band structure along a path in k-space |
|
|
|
Band structure with data per k-point, like SOC or pDOS |
|
Hamiltonian eigenvalues with optional probability map |
|
A series of data points determined by a common relation, i.e. \(y = f(x)\). |
|
Represents some spatially dependent property: data mapped to site positions |
|
A subclass of |
|
2D parameter sweep with |
|
ND parameter sweep |
|
Holds the results of |
|
Named tuple of arrays |
|
Create an area of k-point between k0 and k1, starting from k_origin. |
|
Band structure alond an area in k-space |
|
|
|
Band structure with data per k-point, like SOC or pDOS |
|
Components¶
The following submodules contain classes and functions which are not meant to created manually,
but they are components of other classes (e.g. Model
) so they are used regularly (even
if indirectly).
Structural information and utilities |
|
Lead interface for scattering models |
Miscellaneous¶
A few useful physical constants |
|
Collection of utility functions for matplotlib |
|