tepkit 0.2.1
A user-friendly program for accelerating the calculation and analysis processes of transport, electronic, and thermoelectric properties of materials.
Requires Python: >=3.11

# Tepkit

<p align="center">
  <img src="doc/source/_static/logo.png" style="height:250px;">
</p>
<p align="center">
  <a href="https://pypi.org/project/tepkit/">
    <img src="https://img.shields.io/pypi/pyversions/tepkit.svg" alt="Python"></a>
  <a href="https://pypi.org/project/tepkit/">
    <img src="https://img.shields.io/pypi/v/tepkit.svg" alt="PyPI"></a>
</p>

**Tepkit** is a user-friendly program for accelerating
the calculation and analysis processes of 
transport, electronic, and thermoelectric properties of materials.

- GitHub: [Tepkit | GitHub](https://github.com/TepLabCode/Tepkit)
- Documentation: [Home | Tepkit Documentation](https://teplabcode.github.io/TepkitDoc/)
- API Reference: [API Reference | Tepkit Documentation](https://teplabcode.github.io/TepkitDoc/others/api_reference_overview.html)

---

## Features

- Calculate the root-mean-square (RMS) of interatomic force constants (IFCs)
- Visualize the RMS of IFCs in real-space
- Adjust the cutoff radius of the anharmonic IFCs calculations without repeated calculations
- Detect the duplicated jobs generated by thirdorder/fourthorder and skip them
- Calculate the DOS average effective mass from the BoltzTraP2 results
- Calculate the carrier mobility and the relaxation time using deformation potential (DP) theory
- Apply the effective thickness correction (ETC) to the properties of 2D materials
- Plot the transport property figures from the output files of the DFT calculations
- Plot the heatmap of the band structure (3D band structure) of the 2D materials
- Get the layer group of 2D materials through Spglib and derive various symmetry information 
- Allow users to add custom functions into the command-line interface (CLI)

## How To Cite

If you have used Tepkit in your work, please cite our paper
which indeed helps the Tepkit project to continue:

- S.-H. Cao, X.-R. Chen, Z.-Y. Zeng, H.-Y. Geng, Tepkit: A toolkit for measuring and visualizing interatomic force constants and accelerating transport-property calculations, Comput. Mater. Sci. 259 (2025) 114151, https://doi.org/10.1016/j.commatsci.2025.114151.

> ✏️ Examples described in the paper are available in the `examples/paper_examples` directory.

## Requirements

As of now, this package is only supported on `Python >= 3.11`.  

The following libraries are required to run basic functions and will be installed automatically:

- `typer` & `docstring_parser` for Command-Line Interface (CLI)
- `loguru` & `tqdm`for Logging
- `toml` for Configuration File
- `numpy` & `scipy` for Mathmatical Calculations
- `pandas` for Table Data Handling
- `matplotlib` for Plotting

## How to Install

### Step 1 — Prepare the Environment

#### *Method A: In conda environment* (Recommended)

You can use conda to create a virtual environment with Python 3.11 for Tepkit.

```bash
conda create --name tepkit python=3.11
conda activate tepkit
```

If you have not installed it, check one of the following:

- [Anaconda](https://www.anaconda.com/download)
- [Conda](https://docs.conda.io/projects/conda/en/latest/index.html)
- [Miniconda](https://www.anaconda.com/docs/getting-started/miniconda/main)

#### *Method B: In native environment*

Cheak if you have installed [Python](https://www.python.org), and check if the version is **at least 3.11** by:

```bash
python --version
# Python 3.11.x
```

### Step 2 — Install Tepkit

#### *Method A: Form PyPI* (Recommended)

```bash
pip install tepkit
```

#### *Method B: From GitHub*

```bash
pip install git+https://github.com/TepLabCode/Tepkit.git
```

#### *Method C: From Releases*

1. **Download**:  
   Go to the [releases page](https://github.com/TepLabCode/Tepkit/releases),
   and download the latest released package:  
   `tepkit-<version>.tar.gz`
2. **Extract**:  
   Extract the package by command or any other tool you like.  
   ( Example command: `tar -xvf tepkit-*.tar.gz` )
3. **Install**:
   Go to the extracted directory and install the package:  
   ```bash
   cd tepkit-*
   pip install .
   ```
#### (Optional) Install All Dependencies

By default, Tepkit will only install the basic dependencies,  
so you may meet `ModuleNotFoundError` when running some commands or using some functions.

If you want to install all dependencies at once,  
you can add the `[all]` option to the installation command, like:

```bash
pip install tepkit[all]
```

### Step 3 — Test

#### *A. As a Command-line Interface (CLI)*

You can test if Tepkit is installed correctly by running the `tepkit` command in the console.

```bash
> tepkit
```

If you installed Tepkit in conda, you need to activate the environment before running the command:

```bash
> conda activate tepkit
> tepkit
```

#### *B. As a Python Module*

You can test if Tepkit can be imported correctly by the following code in Python:

```python
import tepkit
```

## About Name

**Tepkit** is a python package to assist with the first principles calculations.

- It is a **T**ransport and **E**lectronic **P**roperties Tool**kit**.

- It is also a **T**hermo**E**lectric **P**roperties Tool**kit**.