Skip to main content

Simulate moire lattice systems in both real and momentum space and calculate various related observables.

Project description

MoirePy: Twist It, Solve It, Own It!

MoirePy is a FOSS Python package for the simulation and analysis of bilayer moiré lattices using tight-binding models. Built for computational physicists and material scientists, it enables quick and flexible moiré band structure calculations, visualization, and manipulation. Our primary focus is on commensurate moiré lattices only.

Documentation: https://jabed-umar.github.io/MoirePy/
Github Repository: https://github.com/jabed-umar/MoirePy
PyPI page: https://pypi.org/project/moirepy/

Features

  • Fast and efficient simulation of 2D bilayer moiré lattices.
  • Efficient $O(\log n)$ time nearest neighbour searches.
  • supports custom lattice definitions with some basic predefined ones:
    • Triangular
    • Square
    • Hexagonal
    • Kagome
  • both real and k-space Hamiltonian generation for tight-binding models with:
    • Nearest-neighbour coupling
    • Arbitrary number of orbitals per site
    • All couplings can be real (default), or complex numbers.
    • All couplings can be functions of position of the point(s) and the point type(s) (for example, different coupling for A-A, A-B, B-B sites for hexagonal lattices)
    • Custom Intra and Interlayer Coupling Design.
  • Web based tool makes it convenient to calculate lattice angles before simulation.
  • Extensive Documentation and examples for easy onboarding.
  • Compatible with other related libraries like Kwant (so that you can generate moire Hamiltonian and use it with Kwant for further analysis).
  • Freedom to researcher: We allow you to define your layers and apply whatever couplings you want. If you want the lattice points to have 53 orbitals each—sure, go ahead. As long as you know what you're doing, we won’t stop you. We don't verify whether it's physically possible.

Upcoming Features

  • Support for higher-dimensional layers: Extend current 2D-only support to include higher dimensional constituent layers.
  • Multi-layer stacking: Go beyond bilayers; enable simulation of trilayers and complex heterostructures.
  • Non-equilibrium Green's function support (research in progress): Develop tools for computing Green’s functions efficiently to study non-equilibrium and quantum transport phenomena.

Installation

You can install MoirePy from PyPI via pip:

$ pip install moirepy

Basic Usage

For detailed usage, please refer to our documentation.

>>> import matplotlib.pyplot as plt
>>> from moirepy import BilayerMoireLattice, TriangularLayer
>>> # Define the Moiré lattice with two triangular layers
>>> moire_lattice = BilayerMoireLattice(
>>>     latticetype=TriangularLayer,
>>>     ll1=9, ll2=10,
>>>     ul1=10, ul2=9,
>>>     n1=1, n2=1,  # number of unit cells
>>> )
twist angle = 0.0608 rad (3.4810 deg)
271 points in lower lattice
271 points in upper lattice
>>> ham = moire_lattice.generate_hamiltonian(
>>>     tll=1, tuu=1, tlu=1, tul=1,
>>>     tuself=1, tlself=1,
>>> )
>>> plt.matshow(ham, cmap="gray")

alt text

License

This project is licensed under the MIT License.

License: MIT

Cite This Work

If you use this software or a modified version in academic or scientific research, please cite:

@misc{MoirePy2025,
	author = {Aritra Mukhopadhyay, Jabed Umar},
	title = {MoirePy: Python package for efficient atomistic simulation of moiré lattices},
	year = {2025},
	url = {https://jabed-umar.github.io/MoirePy/},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moirepy-0.0.9.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moirepy-0.0.9-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file moirepy-0.0.9.tar.gz.

File metadata

  • Download URL: moirepy-0.0.9.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for moirepy-0.0.9.tar.gz
Algorithm Hash digest
SHA256 b9f5806319a171d9e572badd50ee81cb8796f548b71e1902ab01d2b1e99ed26b
MD5 f10049464cbd8184ce4c8070ffe1063c
BLAKE2b-256 9fdcdb9ee5c869ec00d641d70c1a66e298ca033645eaf950bfdf834925e53b0d

See more details on using hashes here.

File details

Details for the file moirepy-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: moirepy-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for moirepy-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1f225b440723d1ffcd02c070aedc04b1853939e9128db23566b07f99b5253503
MD5 01c577ecc9ec88e03a5c5e904c17cb8b
BLAKE2b-256 296fcf6f430a158cbb3aa646be2bed40698f621adfd700ff51ff14f540d89955

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page