unifiedkappa
Computes lattice thermal conductivity, including both the diagonal (particle-like, Peierls) and off-diagonal (wave-like, coherence) contributions, with a unified treatment of phonon transport. It supports two kinds of calculation:
- Minimum thermal conductivity (minikappa): needs only harmonic force constants. Every
phonon mode gets the maximum scattering rate, Γ =
tau_factor· ω / 2π (the defaulttau_factor=2gives Γ = ω/π). This is the model of Xia et al., PNAS 120, e2302541120 (2023); it bounds the isotropically averaged high-temperature minimum kappa of crystals to roughly 0.1–2.6 W/m/K. This package supersedes the original Minikappa scripts. It produces the same output format but uses the public phonopy API instead of a patched phonopy. - Unified kappa: uses the anharmonic phonon scattering rates from a
ShengBTE/FourPhonon calculation. Diagonal group velocities are taken from ShengBTE
(
BTE.v_full) so that they are consistent with its scattering rates, and off-diagonal group velocities are computed with phonopy.
Off-diagonal group velocity tensors, with degeneracy properly treated, are computed by
unifiedkappa/full_group_velocity.py.
Installation
pip install unifiedkappa # once released on PyPI
From source:
git clone git@github.com:dgaines2/unifiedkappa.git
cd unifiedkappa
pip install -e . # or: uv pip install -e .
For plotting, install the optional matplotlib dependency:
pip install -e ".[plot]"
For development (pytest, ruff, pre-commit, coverage, matplotlib):
pip install -e ".[dev]"
pre-commit install
Usage
Minikappa from harmonic force constants
import numpy as np
from unifiedkappa import UnifiedkappaManager
manager = UnifiedkappaManager.from_parameters(
poscar_path="POSCAR",
supercell_matrix=np.eye(3) * 4,
primitive_matrix=np.eye(3),
force_constants_filename="FORCE_CONSTANTS",
mesh=[12, 12, 12],
)
minikappa_results = manager.run_minikappa(temperatures=[300.0, 600.0], tau_factors=[2.0])
Unified kappa from a ShengBTE/FourPhonon run
from unifiedkappa import UnifiedkappaManager
# supercell and q-point mesh are read from CONTROL
manager = UnifiedkappaManager.from_control(
"path/to/shengbte_dir", poscar_filename="POSCAR"
)
unified_results = manager.run_unified_kappa()
minikappa_results = manager.run_minikappa(temperatures=[300.0]) # also available here
Frequency-resolved kappa
With save_histogram=True, the diagonal and off-diagonal contributions are also written
binned by the frequencies of the two modes, which unifiedkappa.plotting can plot:
from unifiedkappa import UnifiedkappaManager
from unifiedkappa.plotting import make_kappa_histogram_plots
manager = UnifiedkappaManager.from_control(
"path/to/shengbte_dir", poscar_filename="POSCAR", save_histogram=True
)
manager.run_unified_kappa()
# saves path/to/shengbte_dir/T300K/unifiedkappa-{d,od}_xx.{pdf,png}
make_kappa_histogram_plots(
"path/to/shengbte_dir/T300K/unifiedkappa", fig_formats=("pdf", "png")
)
See examples/ for runnable NaCl examples of all of the above.
- Minikappa outputs (
minikappa-{T}-{tau_factor}.dat) are saved in the base ShengBTE (or phonopy) directory as they're based on only harmonic properties - Unifiedkappa outputs (
T{T}K/unifiedkappa.dat) are saved in each ShengBTE temperature directory as they're based on anharmonic phonon scattering rates - Each output file holds three flattened 3x3 tensors in W/m/K: diagonal, off-diagonal, and total
- Note that in order to read scattering rates produced by ShengBTE, you must explicitly
specify
onlyharmonic=.FALSE.in theCONTROLfile
Testing
pytest # full suite (~20 s)
pytest -m "not slow" # skip the full 25x25x25 mesh regression tests
The regression tests compare against the reference outputs in examples/.
Citation
If you use the minikappa model, please cite:
Y. Xia, D. Gaines II, J. He, K. Pal, Z. Li, M. G. Kanatzidis, V. Ozoliņš, and C. Wolverton, "A unified understanding of minimum lattice thermal conductivity," Proc. Natl. Acad. Sci. U.S.A. 120, e2302541120 (2023). https://doi.org/10.1073/pnas.2302541120
@article{xia_unified_2023,
title = {A unified understanding of minimum lattice thermal conductivity},
author = {Xia, Yi and Gaines, II, Dale and He, Jiangang and Pal, Koushik and Li, Zhi and
Kanatzidis, Mercouri G. and Ozoli{\c{n}}{\v{s}}, Vidvuds and Wolverton, Chris},
journal = {Proceedings of the National Academy of Sciences},
volume = {120},
number = {26},
pages = {e2302541120},
year = {2023},
doi = {10.1073/pnas.2302541120},
}
Metadata
Release files for unifiedkappa 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 |
|---|---|---|---|---|
| unifiedkappa-0.1.0.tar.gz | 30.3 kB | With provenance | Details for unifiedkappa-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unifiedkappa-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for unifiedkappa-0.1.0-py3-none-any.whl |
Total release size: 52.3 kB
Release files / unifiedkappa-0.1.0.tar.gz
| Download URL | unifiedkappa-0.1.0.tar.gz |
|---|---|
| Size | 30.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ae61083b6668a0d2d777728bd3f82cbc0986c376259ac1ee5406e088b610715
|
|
BLAKE2b-256 checksum How to use checksums |
cd6c1fff6a7ca2cf603df285cbbedd1213a063fa9574c56f79a7c1141e6a5133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / unifiedkappa-0.1.0-py3-none-any.whl
| Download URL | unifiedkappa-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
79b14c3baa46d5cf14bbb93a426f603e27b81130ed9be15b477c8ceb8bb88929
|
|
BLAKE2b-256 checksum How to use checksums |
1f40ec191186b738646d852902c4de889e6987a562254758cc2c7c6fbf234729
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for unifiedkappa 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for unifiedkappa-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA 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.