Release Notes
v1.6 | 2024-01-17
New features
plot_wfc3d
ofVisualizer
class now works for periodic systems.New
SOCTable2
class 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
Visualizer
get as new methodplot_wfc3d
to plot three-dimensional wavefunctions as Gaussian cubes.All exact-diagonalization methods support non-orthogonal basis sets with the help of new
Overlap
class.Added interface for reading Hamiltonian and overlap from the output of DeepH. See
examples/interface/deeph
for more details.
Improvements
Efficiency of
wan2pc()
significantly enhanced.
Changes
Analytical Hamiltonian now should be implemented using the
FakePC
class.
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_color
argument for theplot
method ofPrimitiveCell
andSample
classes.New
make_mos2_soc()
function for making MoS2 primitive cell with SOC.Lindhard
andAnalyzer
classes have a newcalc_epsilon_q0
method to calculate epsilon from AC conductivity for q=0.Lindhard
gets a newenergy_min
argument for setting the lower bound of energy grid during initialization.
Improvements
Improved output of
print
andprint_hk
methods ofPrimitiveCell
class.Improved the observer pattern for keeping data consistency.
Changes
PCInterHopping
andSCInterHopping
classes moved toprimitive
andsuper
modules.
Bugs fixed
Hamiltonian from
set_ham_dense
andset_ham_csr
methods ofSample
class does not consider the rescaling factor.
v1.4.1 | 2023-06-14
Improvements
Simplified
sync_array
methods ofPrimitiveCell
andSuperCell
.PrimitiveCell
and relevant modeling tools are more robust for empty primitive cells.
Changes
Array attributes of
PrimitiveCell
andSuperCell
are initialized as empty arrays rather than None.
Bugs fixed
Diagonal terms in output of
print_hk
ofPrimitiveCell
is incorrect.
Examples
Add example for analytical Hamiltonian.
v1.4 | 2023-06-08
New features
Modeling tools
The
PrimitiveCell
class gets a new attributeorigin
for representing the origin of lattice vectors and a new methodreset_lattice
to reset the lattice vectors. Setting up complex models is much easier and more flexible.The
PrimitiveCell
class gets a new methodprint_hk
for printing the analytical Hamiltonian of the model.New
SOCTable
class 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
Sample
class can be saved to and loaded from files with thesave_array
andload_array
methods.The k-point of Hamiltonian of models of
Sample
class can be set up with theset_k_point
method.The
Visualizer
class can plot scalar and vector fields with theplot_scalar
andplot_vector
methods, which are particularly useful for visualizing spin textures.
Property calculators
New
SpinTexture
class for calculating spin texture.New
DiagSolver
class for calculating energies, wavefunctions and density of states, which supports analytical Hamiltonian.
Improvments
Legacy
HopDict
class has been refactored to support dictionary-like operations.New algorithm for building the hopping terms of
SuperCell
in general cases (100 times faster).The
plot
method ofSample
class can plot conjugate hopping terms as well.Timestep for the
calc_psi_t
method ofSolver
class can be specified through thedt_scale
argument.The
plot_wfc
method ofVisualizer
class can show the model alongside the wavefunction.
Changes
get_dr
methods ofSuperCell
andSCInterHopping
classes have beem merged intoget_hop
method.init_dr
method ofSample
class has been merged intoinit_hop
method accordingly.
Bugs fixed
read_config
does 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 ofPrimitiveCell
andSuperCell
callsync_array
automatically. No need to callsync_array
manually any more.Reorganized package structure
Physical constants, lattice and k-point utilities have been moved to the
base
package.Interfaces to other codes have been moved to the
adapter
package.Cython extension has been broken into smaller parts and moved to the
Cython
package.Exact diagonalization modules have been moved to the
diaognal
package.TBPM modules have been moved to the
tbpm
package.
All methods involving exact diagonalization are now based the
DiagSolver
class. User-defined calculators should be derived from this class.
v1.3 | 2022-12-01
New features
Added
SK
class for setting hopping integrals with Slater-Koster formulationAdded
ParamFit
class for fitting on-site energies and hopping integralsAdded
SOC
class for adding intra-atom spin-orbital couplingAdded
make_graphene_sp()
for making the 8-orbital model of grapheneConfig
,Solver
andAnalyzer
now checks for undefined parametersNew algorithm for building the hopping terms of
SuperCell
(50 times faster)Visualizer
gets a newplot_phases
method to plot the topological phases from Z2
Improvments
Redesigned
Z2
for 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
HopDict
class no longer handles conjugate terms automatically.
v1.1 | 2022-08-13
New features
New
Lindhard
class 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.plot
method ofSample
accepts lists of colors for plotting the supercells and inter-cell hopping terms.DC conductivity subroutine is refactored and much faster.
Changes
The
IntraHopping
class has beem removed. Modifications to hopping terms are now handled by the supercell itself.The
InterHopping
class has been renamed toSCInterHopping
.The
InterHopDict
class has been renamed toPCInterHopping
.apply_pbc
andtrim_prim_cell
functions are moved toPrimitiveCell
class.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
Lindhard
class.
Bugs fixed
merge_prim_cell()
does not set theextend
attribute properly.reset_array
method ofSample
class does not reset therescale
attribute.The FORTRAN subroutine
norm
produces L^1 norm instead of L^2 for complex vectors.The FORTRAN subroutine
tbpm_ldos
does 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
builder
module 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
,Analyzer
andVisualizer
classes.Simplified
Config
. Now it is not dependent on the Sample.Rewritten
materials
module with the new builder.Converted output from txt files to numpy format. Add
-DDEBUG
to 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_d
andamxpby_z
do not behave as expected has been fixed. This bug is effective when using built-in sparse matrix library, and causesFermi
subroutine to yield diverging results, which affects many calculations, e.g. AC conductivity.funcs.F90:
Removed SIMD instructions that will cause
ifort
to 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
rescale
if 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 moduleparallel
has been introduced for this purpose, as well as necessary adjustments in modules ofconfig
,correlation
,f2py.pyf
andtbpm.f90
. Hybrid MPI+OpenMP parallelization is also possible by settingOMP_NUM_THREADS
andMKL_NUM_THREADS
properly.A new module
utils
has 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
gnu95
has been changed togfortran
.
config:
The logic workflow has been unified and simplified. A new key
prefix
has replaced the old keytimestamp
. Default argument values forset_output
andsave
methos have also been changed in according to the new workflow.tbpm.f90
Some temporary arrays in subroutines
tbpm_dccond
andtbpm_eigenstates
have been changed from row-major to column-major, which may boosts the calculation by approximately 12%.
Bugs fixed
analysis.f90:
Error of
index out range
has 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_inv
had 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 argumentfwd
has been introduced to distinguish forward and backward propagation.random.f90:
Subroutine
random_state
had 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.