Skip to main content

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 MANYBODY and INTERLAYER packages (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.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for twister2d 2.0.5
File Interpreter ABI Platform
twister2d-2.0.5-py3-none-any.whl Python 3 none any Details

Release files / twister2d-2.0.5-py3-none-any.whl

Download URL twister2d-2.0.5-py3-none-any.whl
Size 86.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d55f5e5d05d54441c59b18a46088be79fa7c7a2c310a6686f907e2a50d29790b
BLAKE2b-256 checksum
How to use checksums
b132203b4af5d149d04de3f530bfb32c0b4c9e2cb7adef9009f9d8f1e8ac3f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for twister2d 2.0.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.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page