Twisted 2D material structure generation and analysis (graphene, hBN, TMDs) with LAMMPS integration
Project description
Twister2.0
Twister2.0 builds commensurate supercells of twisted 2D materials (graphene, hBN, transition-metal dichalcogenides), generates ready-to-run LAMMPS structure and input files with automatic interlayer-potential configuration, and post-processes relaxed structures into per-layer strain and interlayer-spacing maps. It also includes a parallel commensurate-twist-angle finder for lattice-mismatched heterobilayers and converters to DFT input formats (Quantum ESPRESSO, SIESTA).
Repository layout
Twister2.0/
├── pyproject.toml # pip-installable package definition
├── twister2/ # Python package (source)
├── potentials/
│ ├── classical/ # KC, SW, Tersoff, REBO, ILP potential files
│ └── ml/ # PANNA (panna/vdw) config + LAMMPS plugin sources
├── docs/ # detailed documentation
└── examples/ # example input files for each workflow
Installation
pip install twister2d # from PyPI
# or from a checkout:
cd Twister2.0
pip install . # or: pip install -e . (editable, for development)
pip install ".[mpi]" # optional: MPI support for the angle finder
(The PyPI distribution is named twister2d; the installed commands are twister2, twister2-process, etc.)
This installs the library and the command-line tools:
| Command | Purpose |
|---|---|
twister2 |
Structure generation (reads twisterase.inp) |
twister2-process |
Extract layers from a relaxed LAMMPS dump |
twister2-analyze |
Strain + interlayer-spacing analysis pipeline |
twister2-angle |
Commensurate twist angle search (reads get_ang.inp) |
twister2-cif2qe |
CIF → Quantum ESPRESSO input |
twister2-cif2siesta |
CIF → SIESTA input |
twister2-remap-types |
Remap LAMMPS atom types to PANNA ordering (manual use) |
twister2-restore-tags |
Restore original atom tags in an ML dump (manual use) |
See docs/installation.md for details, including LAMMPS build requirements.
Quick start
cd examples/tmd-twisted-bilayer-hex
cp ../../potentials/classical/{MoWSSe.KC,tmd.sw} .
twister2 # -> structure.lammps, lammps.in, process_relaxed.inp
lmp_serial -in lammps.in # relax with LAMMPS -> dump.Final
twister2-process # -> layer_N.cif, layer_N_coords.dat
twister2-analyze # -> StrainMap/, InterlayerSpacingMap/
The full walkthrough is in docs/quickstart.md.
Documentation
| Document | Contents |
|---|---|
docs/installation.md |
Installing the package, dependencies, LAMMPS requirements |
docs/quickstart.md |
A first end-to-end run, step by step |
docs/cli.md |
Complete command-line reference |
docs/workflow.md |
The four-stage pipeline in detail |
docs/input_files.md |
Full reference for twisterase.inp, layer*.inp, process_relaxed.inp |
docs/hbn.md |
Automatic hBN substrate / cap / encapsulation |
docs/ml_potentials.md |
Machine-learned potential (panna/vdw) workflow |
docs/angle_finder.md |
Commensurate twist angle search (twister2-angle) |
docs/analysis.md |
Layer extraction and post-processing |
docs/converters.md |
CIF → QE / SIESTA converters |
docs/potentials.md |
The bundled potential files and how to use them |
Requirements
- Python ≥ 3.10 with
numpy,scipy,matplotlib,ase(installed automatically by pip) - LAMMPS with the
MANYBODYandINTERLAYERpackages (classical workflow), plus the bundled PANNA plugin for the ML workflow - Optional:
mpi4py+ an MPI library to parallelize the angle finder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twister2d-2.0.0-py3-none-any.whl.
File metadata
- Download URL: twister2d-2.0.0-py3-none-any.whl
- Upload date:
- Size: 83.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a3a9b2933953b2104233329753fdeb35723c10ff651a53d7ea0b8eac0e75f80
|
|
| MD5 |
4c05ae06b9988a3c35290553432f2eba
|
|
| BLAKE2b-256 |
254d5bf6f4131539340fe27b2d3207f5b27c16eca6f7b23c8f53b9927f8c4d24
|