KPM Tools
KPM Tools is an open-source Python package that extends the Kernel Polynomial Method (KPM) functionalities of Kwant, a popular software for quantum transport simulations in tight-binding models. Our package specifically enhances the KPM expansion capabilities within the realm of closed tight-binding systems.
Features
- Advanced KPM expansion of typical spectral functions like Density of States, Green's Functions, Kubo Conductivity, and Chern Markers.
- Extremely efficient time evolution operator expansion
- Additional functionalities like KPM vector factories producing tiles, and velocity and distance operators adapted to periodic boundaries.
Requirements
- Python >=3.11, <3.13
- Kwant >= 1.4.4
- NumPy <2.0 (required by Kwant, see the note below)
Installation
Installing KPM Tools
You can install KPM Tools via pip from PyPI:
$ pip install kpm-tools
Important Note on Kwant Dependency
While KPM Tools requires Kwant to function, direct installation of Kwant via pip can sometimes be problematic due to its specific build requirements. To ensure a smooth setup, we recommend the following installation approach:
-
Try installing with pip (optional):
You can attempt to install Kwant along with KPM Tools via pip:
$ pip install kpm-tools[kwant]
If this installation fails, proceed to the next step.
-
Install Kwant using Conda or follow Kwant's installation guide:
We recommend using Conda to install Kwant, which typically handles its build requirements more reliably:
$ conda install -c conda-forge kwant
Alternatively, refer to the Kwant installation page for detailed instructions on installing Kwant in different environments.
After installing Kwant, you can then install KPM Tools using pip as shown above.
Note on NumPy 2: Kwant is currently incompatible with NumPy 2.x — the C sources in its published release access a NumPy internal that became opaque in 2.0, so it fails to compile. KPM Tools therefore constrains
numpy<2.0(andscipy<1.14, which would otherwise pull NumPy 2 in). This constraint will be relaxed once Kwant publishes a NumPy 2 compatible release.
Python API
Please see the python api reference for details.
Contributing
Contributions, especially in documentation and the 'concatenator' function/module, are very welcome. For more information, see our Contributor Guide.
License
Distributed under the terms of the BSD 2-Clause license, KPM Tools is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
Many of the ideas implemented in KPM Tools originate from the early work on KPM expansion on the paper
Computation of topological phase diagram of disordered PbSnTe using the kernel polynomial method.
Phys. Rev. Research 2, 013229 (2020) arXiv:1905:02215
Consider citing that work if you use this package on a publication.
Acknowledgments to Kwant
KPM Tools is built upon the robust and efficient foundation provided by Kwant. We extend our gratitude to the Kwant authors and contributors for their work in developing a versatile platform for quantum transport simulations. KPM Tools aims to complement Kwant's capabilities in KPM expansions, adhering to the high standards of quality and performance set by the Kwant project.
See the original KPM implementation in Kwant: https://kwant-project.org/doc/1/tutorial/kpm https://kwant-project.org/doc/1/reference/kwant.kpm
Project Template
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.
Metadata
Release files for kpm-tools 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kpm_tools-0.1.0.tar.gz | 31.0 kB | Without provenance | Details for kpm_tools-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kpm_tools-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for kpm_tools-0.1.0-py3-none-any.whl |
Total release size: 64.0 kB
Release files / kpm_tools-0.1.0.tar.gz
| Download URL | kpm_tools-0.1.0.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddb3017318363eabcd2666f027b61508cfe380e6179f0a45b1741e116a3502a4
|
|
BLAKE2b-256 checksum How to use checksums |
c3712560c6dfbc6bfd64ce63803a373dcce2fbf56898137054a506bd31d7da01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / kpm_tools-0.1.0-py3-none-any.whl
| Download URL | kpm_tools-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b71d23e4263d0789c8e1d105c009a3545b7454df63d41dbeb54f40def2df3e6
|
|
BLAKE2b-256 checksum How to use checksums |
1dc8cbcde14e7078d118e6e49927d0ee16df2da004191a7cf4b22e8bb3db2c32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for kpm-tools 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.