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, converters to DFT input formats (Quantum ESPRESSO, SIESTA), and a PUMP-compatible export that flattens a relaxed layer onto the z-geometry of its primitive QE cell.
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-compare-pos |
Overlay a SIESTA supercell on a repeated QE unit cell (PUMP check) |
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
Metadata
Release files for twister2d 2.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| twister2d-2.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Release files / twister2d-2.1.5-py3-none-any.whl
| Download URL | twister2d-2.1.5-py3-none-any.whl |
|---|---|
| Size | 113.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2145f428d4f7f9c4e6da2930d190994320f17054ade3e05ae7f1f94dc5190c34
|
|
BLAKE2b-256 checksum How to use checksums |
06d3ca7ac9e49e78b5cec4482ca0c152cea0d590b19cb83f66c96a3b9842ddc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for twister2d 2.1.5
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.