Hetbuilder
Builds 2D heterostructures via coincidence lattice theory.
Install / Use
/learn @romankempt/HetbuilderREADME
Hetbuilder - builds heterostructure interfaces
Builds 2D heterostructure interfaces via coincidence lattice theory.
Installation
Build-time dependencies
Requires a C++17 compiler and cmake.
It is also recommended to preinstall spglib and pybind11. Otherwise, these will be built during the installation from the submodules.
Installing with Anaconda
Create a clean conda environment:
conda env create -n hetbuilder python=3.11
Then install the build-time dependencies first:
conda install -c conda-forge compilers git pip cmake scikit-build spglib=2.1.0 pybind11=2.11.1
<!-- Then, you can install the project from pip:
```bash
pip install hetbuilder
```
-->
Install directly from git via pip:
pip install git+https://github.com/romankempt/hetbuilder.git
Development Installation with Anaconda
After creating the same environment, nstall conda-build:
conda install conda-build
Download or clone the github repository. Then, cd to the repository and
pip install -r requirements.txt
conda develop .
mkdir build
cd build
cmake .. && make
cp hetbuilder_backend.*.so ../hetbuilder/
The last step is necessary so that the C++ extension is found in the module directory.
First steps
The installation exposes a multi-level typer CLI utility called hetbuilder:
hetbuilder --help
The build utility is fully implemented.
You can use any ASE-readable structure format to specify the lower and upper layer. They should be recognizable as two-dimensional, e.g., by having a zero vector in the z-direction.
hetbuilder build graphene.xyz MoS2.cif
This should open a matplotlib interface looking like this:

Documentation
Documentation is available at Read the Docs.
Testing
Tests can be run in the project directory with
pytest -v tests
Citing
If you use this tool, please cite 10.5281/zenodo.4721346.
Requirements
Known Issues
error: '::timespec_get' has not been declaredsee here. In this case, the solution seems to be to runconda upgrade -c conda-forge --all.- Installation troubles, e.g., with spglib:
- Try to update your conda forge packages:
conda config --add channels conda-forgeconda config --set channel_priority strictconda update --allconda install -c conda-forge spglig
