Release Notes
v2.0.1 | 2025-07-18
Bugs fixed
Add missing examples and run_tests.sh to source code packages.
v2.0 | 2025-06-10
We are proud to announce the release of TBPLaS 2.0. With the code base increased from 26,800 to 61,200 lines, this major version brings many new features, along with significant improvements.
New features
Fully compatible C++ implementation of the modeling tools, with efficiency enhancements of orders of magnitude
Brand new solvers rewritten from scratch in C++, with with an efficiency enhancement of at least 1.5 times faster
New
Berryclass for calculating Berry curvature and Chern numberSupport for search of eigenvalues within a specific energy range based on the FEAST library
Support for non-orthogonal basis set for diagonalization methods
Support for GPU computing for TBPM algorithms based on CUDA
New TBPM fast algorithms reusing intermediate results
Native build on Windows now possible
Improvements
Existing Python modeling tools significantly improved for efficiency
Workflow of diagonalization methods and TBPM unified into a more comprehensive and consistent manner
CMake-based build system to handle the dependencies and compilation procedure
Documentation and tutorials updated and enriched
Changes
Legacy FORTRAN code removed, significantly simplifying the build system
Compatibility Notice
Existing scripts for modeling for version 1.x will work for version 2.0.
Compatibility Notice
Due to the change of workflow, exiting scripts for diagonalization and TBPM calculations for version 1.x
will not work for version 2.0. See tbplas-cpp/samples/speedtest/diag.py and
tbplas-cpp/samples/speedtest/tbpm.py for examples of the new workflow.
v1.6 | 2024-01-17
New features
plot_wfc3dofVisualizerclass now works for periodic systems.New
SOCTable2class for evaluating spin-orbital coupling terms.New build system based on scikit-build-core and cmake.
Changes
Dropped support for Python 3.6. Now Python >= 3.7 is required to install TBPLaS.
v1.5 | 2023-08-17
New features
Visualizerget as new methodplot_wfc3dto plot three-dimensional wavefunctions as Gaussian cubes.All exact-diagonalization methods support non-orthogonal basis sets with the help of new
Overlapclass.Added interface for reading Hamiltonian and overlap from the output of DeepH. See
examples/interface/deephfor more details.
Improvements
Efficiency of
wan2pc()significantly enhanced.
Changes
Analytical Hamiltonian now should be implemented using the
FakePCclass.
Bugs fixed
Fixed incorrect restriction on the dimension of supercell.
v1.4.2 | 2023-07-25
New features
Orbitals can be colored using user-defined coloring function via the
orb_colorargument for theplotmethod ofPrimitiveCellandSampleclasses.New
make_mos2_soc()function for making MoS2 primitive cell with SOC.LindhardandAnalyzerclasses have a newcalc_epsilon_q0method to calculate epsilon from AC conductivity for q=0.Lindhardgets a newenergy_minargument for setting the lower bound of energy grid during initialization.
Improvements
Improved output of
printandprint_hkmethods ofPrimitiveCellclass.Improved the observer pattern for keeping data consistency.
Changes
PCInterHoppingandSCInterHoppingclasses moved toprimitiveandsupermodules.
Bugs fixed
Hamiltonian from
set_ham_denseandset_ham_csrmethods ofSampleclass does not consider the rescaling factor.
v1.4.1 | 2023-06-14
Improvements
Simplified
sync_arraymethods ofPrimitiveCellandSuperCell.PrimitiveCelland relevant modeling tools are more robust for empty primitive cells.
Changes
Array attributes of
PrimitiveCellandSuperCellare initialized as empty arrays rather than None.
Bugs fixed
Diagonal terms in output of
print_hkofPrimitiveCellis incorrect.
Examples
Add example for analytical Hamiltonian.
v1.4 | 2023-06-08
New features
Modeling tools
The
PrimitiveCellclass gets a new attributeoriginfor representing the origin of lattice vectors and a new methodreset_latticeto reset the lattice vectors. Setting up complex models is much easier and more flexible.The
PrimitiveCellclass gets a new methodprint_hkfor printing the analytical Hamiltonian of the model.New
SOCTableclass for boosting the evaluation of intra-atom spin-orbital coupling terms.New
make_graphene_soc()function for getting the graphene model with Rashba and Kane-Mele spin-orbital coupling.Models built from the
Sampleclass can be saved to and loaded from files with thesave_arrayandload_arraymethods.The k-point of Hamiltonian of models of
Sampleclass can be set up with theset_k_pointmethod.The
Visualizerclass can plot scalar and vector fields with theplot_scalarandplot_vectormethods, which are particularly useful for visualizing spin textures.
Property calculators
New
SpinTextureclass for calculating spin texture.New
DiagSolverclass for calculating energies, wavefunctions and density of states, which supports analytical Hamiltonian.
Improvments
Legacy
HopDictclass has been refactored to support dictionary-like operations.New algorithm for building the hopping terms of
SuperCellin general cases (100 times faster).The
plotmethod ofSampleclass can plot conjugate hopping terms as well.Timestep for the
calc_psi_tmethod ofSolverclass can be specified through thedt_scaleargument.The
plot_wfcmethod ofVisualizerclass can show the model alongside the wavefunction.
Changes
get_drmethods ofSuperCellandSCInterHoppingclasses have beem merged intoget_hopmethod.init_drmethod ofSampleclass has been merged intoinit_hopmethod accordingly.
Bugs fixed
read_configdoes not back up the names of legal parameters.
Examples
All examples have been reviewed and updated to the latest API.
New example for calculating spin texture of graphene with Rashba and Kane-Mele SOC.
New example for calculating quasi_eigenstates.
For developers
Added type hints for all the classes and functions.
Implemented observer pattern for keeping data consistency. The original top-down approach has also been reviewed and improved.
Redesigned the interfaces of all the classes, with instance attributes made private whenever possible. Now the attributes should accessed via the
get_*methods or as properties.The
get_*methods and properties ofPrimitiveCellandSuperCellcallsync_arrayautomatically. No need to callsync_arraymanually any more.Reorganized package structure
Physical constants, lattice and k-point utilities have been moved to the
basepackage.Interfaces to other codes have been moved to the
adapterpackage.Cython extension has been broken into smaller parts and moved to the
Cythonpackage.Exact diagonalization modules have been moved to the
diaognalpackage.TBPM modules have been moved to the
tbpmpackage.
All methods involving exact diagonalization are now based the
DiagSolverclass. User-defined calculators should be derived from this class.
v1.3 | 2022-12-01
New features
Added
SKclass for setting hopping integrals with Slater-Koster formulationAdded
ParamFitclass for fitting on-site energies and hopping integralsAdded
SOCclass for adding intra-atom spin-orbital couplingAdded
make_graphene_sp()for making the 8-orbital model of grapheneConfig,SolverandAnalyzernow checks for undefined parametersNew algorithm for building the hopping terms of
SuperCell(50 times faster)Visualizergets a newplot_phasesmethod to plot the topological phases from Z2
Improvments
Redesigned
Z2for calculating and analyzing the Z2 topological invariantUpdated the tutorials with a lot of new examples demonstrating the new features
v1.2 | 2022-09-02
New features
Improvments
Removed unnecessary MPI_Allreduce calls in
Lindhard
Changes
Legacy
HopDictclass no longer handles conjugate terms automatically.
v1.1 | 2022-08-13
New features
New
Lindhardclass for evaluating response properties using Lindhard function.Implemented LDOS calculation based exact diagonalization.
Implemented propagation of wave function from initial condition.
Implemented evaluation of diffusion coeffcients from DC correlation function.
Added MPI support for band structure and DOS calculation.
Added support for 64-bit array indices (samples can be much larger).
Improvments
A lot of classes have been refactored for simplicity, maintainability and efficiency.
The default values of common parameters and the units of outputs have been unified for exact diagonalization, Lindhard and TBPM subroutines.
References to papers discussing the methodologies have been revised.
merge_prim_cell()checks lattice vectors before merging cells.plotmethod ofSampleaccepts lists of colors for plotting the supercells and inter-cell hopping terms.DC conductivity subroutine is refactored and much faster.
Changes
The
IntraHoppingclass has beem removed. Modifications to hopping terms are now handled by the supercell itself.The
InterHoppingclass has been renamed toSCInterHopping.The
InterHopDictclass has been renamed toPCInterHopping.apply_pbcandtrim_prim_cellfunctions are moved toPrimitiveCellclass.The output unit of AC conductivity from TBPM has been changed from e^2/(4*h_bar) to e^2/h_bar, for consistency with the
Lindhardclass.
Bugs fixed
merge_prim_cell()does not set theextendattribute properly.reset_arraymethod ofSampleclass does not reset therescaleattribute.The FORTRAN subroutine
normproduces L^1 norm instead of L^2 for complex vectors.The FORTRAN subroutine
tbpm_ldosdoes not set initial state properly.
Misc.
Updated documentation, examples and configuration files.
Added more examples.
v1.0 | 2022-02-18
First public release of TBPLaS.
New features
The
buildermodule is rewritten from scratch. Now it is much easier to use and orders of magnitudes faster.The workflow of setting up a sample is simplified, with many handy tools provided.
Added options to specify the timestep and thresthold for checking wavefunction norm during tbpm calculation.
Changes
Refactored existing code into
Solver,AnalyzerandVisualizerclasses.Simplified
Config. Now it is not dependent on the Sample.Rewritten
materialsmodule with the new builder.Converted output from txt files to numpy format. Add
-DDEBUGto f90flags if you don’t like this feature.Many bug fixes, efficiency improvments and security enhancements.
Bugs fixed
csr.F90:
The subtle bug that
amxpby_dandamxpby_zdo not behave as expected has been fixed. This bug is effective when using built-in sparse matrix library, and causesFermisubroutine to yield diverging results, which affects many calculations, e.g. AC conductivity.funcs.F90:
Removed SIMD instructions that will cause
ifortto abort during compilation.tbpm.f90:
Fixed incorrect initial norm when checking wave function.
v0.9.8 | 2021-06-06
New features
Most of the subroutines involving wave function propagation will check the norm of wave function after 128 steps of propagation. The program will abort and a error message is casted to prompt the user to increase
rescaleif NaN, Inf or large derivation from 1 of the norm is detected.MPI parallelization has been implemented for
corr_DOS,corr_LDOS,corr_AC,corr_dyn_pol,corr_DC,mu_Hall,quasi_eigenstates, which may boost the calculation by approximately 20%. A new moduleparallelhas been introduced for this purpose, as well as necessary adjustments in modules ofconfig,correlation,f2py.pyfandtbpm.f90. Hybrid MPI+OpenMP parallelization is also possible by settingOMP_NUM_THREADSandMKL_NUM_THREADSproperly.A new module
utilshas been introduced, which provides classes for times profiling, progress reporting, random number seeds generating, message printing, etc.
Changes
setup.cfg:
Optimization flags for ifort has changed to
-xHost. Tests should be taken to avoid aggressive and unstable optimizaitons.Compiler name of
gnu95has been changed togfortran.
config:
The logic workflow has been unified and simplified. A new key
prefixhas replaced the old keytimestamp. Default argument values forset_outputandsavemethos have also been changed in according to the new workflow.tbpm.f90
Some temporary arrays in subroutines
tbpm_dccondandtbpm_eigenstateshave been changed from row-major to column-major, which may boosts the calculation by approximately 12%.
Bugs fixed
analysis.f90:
Error of
index out rangehas been fixed for functionanalyze_corr_DC, which is due to the incomplete update of the length ofcorr_DOS. Maybe in the future we may find a more elegant solution to this problem.propagation.f90:
Subroutine
cheb_wf_timestep_invhad not worked properly as due to a typo in the starting range of loop over Bessel coeffcients. Now it has been fixed and shares the same subroutine as cheb_wf_timestep. An argumentfwdhas been introduced to distinguish forward and backward propagation.random.f90:
Subroutine
random_statehad not been thread-safe, which would lead to different results with different number of OpenMP threads, especially for AC and DC conductivity. Now the OpenMP instructions have been removed and the subroutine is made serial, thus being thread-safe.