Releases: dean0x7d/pybinding
v0.9.5
It has been a long time since the last version was released. The Python ecosystem has changed quite a bit in the meantime and this has led to a number of compatibility issues when installing or running pybinding. The main purpose of this new version is to bring this library back to life with lots of compatibility fixes and general modernization.
That said, a couple of new features have also snuck in: site and hopping generators should help with the creation of more general models that were not possible before. They make it possible to create heterostructures and systems with various forms of disorder.
Thank you to @MAndelkovic (Miša Anđelković) for making this release possible! And thanks to everyone who reported the various issues.
Necromancy
- Fixed compatibility issues with Python 3.7 and 3.8. Notably, this fixes the deadlocks as reported in #17, #21, and #23.
- Fixed compatibility with new versions of
matplotlib
: theallow_rasterization
import error (#11), various warnings, and smaller visual glitches. - Fixed installation errors due to the encoding of the
changelog.md
file (#7). - Fixed failure to compile the project from source code because the Eigen library's download URL changed (#14).
- Fixed deprecation warnings from the latest versions of
numpy
. - Fixed documentation generation with
sphinx
v2.x. - Dropped support for Python 3.5. You must have Python 3.6 or newer to install this version.
General bug fixes
- Fixed reversed order of
Lattice.reciprocal_vectors()
: it should bea_n * b_n = 2pi
but it was accidentallya_n * b_{N-n} = 2pi
. - Fixed incorrect Hamiltonian construction in cases where complex hoppings were used together with translational symmetry.
New features
- Added
@site_generator
which can be used to add new sites independent of the mainLattice
definition. This is useful for creating heterostructures or defects with various add-atoms. See the new "Generators" section of the tutorial. @hopping_generator
has been promoted to a regular feature and added to the tutorial. It's useful for creating additional local hoppings around existing sites or connecting completely new sites which were added by a@site_generator
.- Added
System.count_neighbors()
which counts the neighbors each site has. Useful for finding edge atoms. Generators can requestsystem
as an argument so that they can stitch new atoms to the edges. See the API reference for@site_generator
and@hopping_generator
. @site_state_modifier
s and@site_position_modifier
s can now be freely ordered. Before this, all state modifiers would be evaluated first and then all position modifiers. Now, they will be evaluated in the exact order in which they are given toModel
. Take care: this may change the behavior of some existing models but it will give more control to create new models which not possible before.
v0.9.4
-
Fixed issues with multi-orbital models: matrix onsite terms were not set correctly if all the elements on the main diagonal were zero (#5), hopping terms were being applied asymmetrically for large multi-orbital systems (#6). Thanks to @oroszl (László Oroszlány) for reporting the issues.
-
Fixed KPM Hamiltonian scaling for models with all zeros on the main diagonal but asymmetric spectrum bounds (non-zero KPM scaling factor
b
). -
Fixed compilation on certain Linux distributions (#4). Thanks to @nu11us (Will Eggleston) for reporting the issue.
-
Fixed compilation with Visual Studio 2017.
-
Improved support for plotting slices of multi-layer systems. See "Plotting Guide" > "Model structure" > "Slicing layers" in the documentation.
v0.9.3
v0.9.2
New KPM features and improvements
-
Added a method for calculating spatial LDOS using KPM. See the "Kernel Polynomial Method" tutorial page and the
KPM.calc_spatial_ldos
API reference. -
Improved single-threaded performance of
KPM.calc_dos
by ~2x by switching to a more efficient vectorization method. (Multiple random starter vectors are now computed simultaneously and accelerated using SIMD intrinsics.) -
Various KPM methods now take advantage of multiple threads. This improves performance depending on the number of cores on the target machine. (However, for large systems performance is limited by RAM bandwidth, not necessarily core count.)
-
LDOS calculations for multiple orbitals also take advantage of the same vectorization and multi-threading improvements. Single-orbital LDOS does not benefit from this but it has received its own modest performance tweaks.
-
Long running KPM calculation now have a progress indicator and estimated completion time.
General improvements and bug fixes
-
StructureMap
can now be sliced using a shape. E.g.s = pb.rectangle(5, 5); smap2 = smap[s]
which returns a smaller structure map cut down to the given shape. -
Plotting the structure of large or periodic systems is slightly faster now.
-
Added 2D periodic supercells to the "Shape and symmetry" section of the tutorial.
-
Added a few more examples to the "Plotting guide" (view rotation, separating sites and hoppings and composing multiple plots).
-
Fixed broken documentation links when using the online search function.
-
Fixed slow Hamiltonian build when hopping generators are used.
v0.9.1
-
Fixed an issue with multi-orbital models where onsite/hopping modifiers would return unexpected results if a new
energy
array was returned (rather than being modified in place). -
Fixed
Solver.calc_spatial_ldos
andSolver.calc_probability
returning single-orbital results for multi-orbital models. -
Fixed slicing of
Structure
objects and made access to thedata
property ofSpatialMap
andStructureMap
mutable again.
v0.9.0
Updated requirements
-
This version includes extensive internal improvements and raises the minimum requirements for installation. Starting with this release, only Python >= 3.5 is supported. Newer versions of the scientific Python packages are also required: numpy >= 1.12, scipy >= 0.19 and matplotlib >= 2.0.
-
On Linux, the minimum compiler requirements have also been increased to get access to C++14 for the core of the library. To compile from source, you'll need GCC >= 5.0 or clang >= 3.5.
Multi-orbital models
-
Improved support for models with multiple orbitals, spins and any additional degrees of freedom. These can now be specified simply by inputting a matrix as the onsite or hopping term (instead of a scalar value). For more details, see the "Multi-orbital models" section of the documentation.
-
Lifted all limits on the number of sublattices and hoppings which can be defined in a
Lattice
object. The previous version was limited to a maximum of 128 onsite and hopping terms per unit cell (but those could be repeated an unlimited number of times to form a complete system). All restrictions are now removed so that the unit cell size is only limited by available memory. In addition, the memory usage of the internal system format has been reduced. -
Added a 3-band model of group 6 transition metal dichalcogenides to the Material Repository. The available TMDs include: MoS2, WS2, MoSe2, WSe2, MoTe2, WTe2. These are all monolayers.
Composite shapes
- Complicated system geometries can now be created easily by composing multiple simple shapes. This is done using set operations, e.g. unions, intersections, etc. A complete guide for this functionality is available in the "Composite shapes" section of the documentation.
Kernel polynomial method
-
The KPM implementation has been revised and significantly expanded. A guide and several examples are available in the "Kernel polynomial method" section of the documentation (part 9 of the Tutorial). For a complete overview of the available methods and kernels, see the
chebyshev
section of the API reference. -
New builtin computation methods include the stochastically-evaluated density of states (DOS) and electrical conductivity (using the Kubo-Bastin approach).
-
The new low-level interface produces KPM expansion moments which allows users to create their own KPM-based computation routines.
-
The performance of various KPM computations has been significantly improved for CPUs with AVX support (~1.5x speedup on average, but also up to 2x in some cases with complex numbers).
Miscellaneous
-
Added the
pb.save()
andpb.load()
convenience functions for getting result objects into/out of files. The data is saved in a compressed binary format (Python's builtinpickle
format with protocol 4 and gzip). Loaded files can be immediately plotted:result = pb.load("file.pbz")
and thenresult.plot()
to see the data. -
The eigenvalue solvers now have a
calc_ldos
method for computing the local density of states as a function of energy (in addition to the existingcalc_spatial_ldos
). -
Improved plotting of
Lattice
objects. The view can now be rotated by passing theaxis="xz"
argument, or any other combination of x, y and z to define the plotting plane.
Deprecations and breaking changes
-
Added
Lattice.add_aliases()
method. The oldLattice.add_sublattice(..., alias=name)
way of creating aliases is deprecated. -
The
greens
module has been deprecated. This functionality is now covered by the KPM methods. -
The internal storage format of the
Lattice
andSystem
classes has been revised. This shouldn't affect most users who don't need access to the low-level data.
v0.8.2
v0.8.1
This is a minor release with some plotting improvements and bug fixes. Major new features will arrive in v0.9.
- Structure plotting functions have been improved with better automatic scaling of lattice site circle sizes and hopping line widths.
- Fixed Brillouin zone calculation for cases where the angle between lattice vectors is obtuse (#1). Thanks to @obgeneralao (Oliver B Generalao) for reporting the issue.
- Fixed a flaw in the example of a phosphorene lattice (there were extraneous t5 hoppings). Thanks to Longlong Li for pointing this out.
- Fixed missing CUDA source files in PyPI sdist package.
- Revised advanced installation instructions: compiling from source code and development.
v0.8.0
New features
- Added support for scattering models. Semi-infinite leads can be attached to a finite-sized scattering region. Take a look at the documentation, specifically section 10 of the "Basic Tutorial", for details on how to construct such models.
- Added compatibility with Kwant for transport calculations. A model can be constructed in Pybinding and then exported using the
Model.tokwant()
method. This makes it possible to use Kwant's excellent solver for transport problems. While Kwant does have its own model builder, Pybinding is much faster in this regard: by two orders of magnitude, see the "Benchmarks" page in the documentation for a performance comparison. - Experimental: Initial CUDA implementation of KPM Green's function (only for diagonal elements for now). See the "Experimental Features" section of the documentation.
Improvements
- The performance of the KPM Green's function implementation has been improved significantly: by a factor of 2.5x. The speedup was achieved with CPU code using portable SIMD intrinsics thanks to libsimdpp.
- The Green's function can now be computed for multiple indices simultaneously.
- The spatial origin of a lattice can be adjusted using the
Lattice.offset
attribute. See the "Advanced Topics" section.
Breaking changes
- The interface for structure plotting (as used in
System.plot()
andStructureMap
) has been greatly improved. Some of the changes are not backwards compatible and may require some minor code changes after upgrading. See the "Plotting Guide" section of the documentation for details. - The interfaces for the
Bands
andStructureMap
result objects have been revised. Specifically, structure maps are now more consistent with ndarrays, so the oldsmap.filter(smap.x > 0)
is replaced bysmap2 = smap[smap.x > 0]
. The "Plotting Guide" has a few examples and there is a full method listing in the "API Reference" section.
Documentation
- The API reference has been completely revised and now includes a summary on the main page.
- A few advanced topics are now covered, including some aspects of plotting. A few more random examples have also been added.
- Experimental features are now documented.
Bug fixes
- Fixed translational symmetry skipping directions for some 2D systems.
- Fixed computation of off-diagonal Green's function elements with
opt_level > 0
- Fixed some issues with shapes which were not centered at
(x, y) = (0, 0)
.
v0.7.2
- Lots of improvements to the documentation. The tutorial pages can now be downloaded and run interactively as Jupyter notebooks. The entire user guide is also available as a PDF file.
- The
sub_id
andhop_id
modifier arguments can now be compared directly with their friendly string names. For example, this makes it possible to writesub_id == 'A'
instead of the oldsub_id == lattice['A']
andhop_id == 'gamma1'
instead ofhop_id == lattice('gamma1')
. - The site state modifier can automatically remove dangling sites which have less than a certain number of neighbors (set using the
min_neighbors
decorator argument). - Added optional
sites
argument for state, position, and onsite energy modifiers. It can be used instead of thex, y, z, sub_id
arguments and contains a few helper methods. See the modifier API reference for more information. - Fixed a bug where using a single KPM object for multiple calculations could return wrong results.
- Experimental
hopping_generator
which can be used to add a new hopping family connecting arbitrary sites independent of the mainLattice
definition. This is useful for creating additional local hoppings, e.g. to model defects.