Giter VIP home page Giter VIP logo

moire-lattice-generator's Introduction

Moiré lattice generator

Binder build PyPI Documentation Status DOI

test

Easily generate renders of lattices, moiré lattices and even quasi-lattices in Python.

Documentation: https://moire-lattice-generator.readthedocs.io

Magic angle bilayer graphene was shown to be superconducting in 2018 [1]. Despite the considerable hype concerning this discovery, little code exists to visualize the moiré pattern of two graphene layers.

To illustrate the work as done in our own paper "Direct evidence for flat bands in twisted bilayer graphene from nano-ARPES" (arXiv version here), I created this repository.

This repository contains Python code to generate lattices with values reasonably like experimental (e.g. STM or TEM) results. If you are looking to generate more schematic like hexagonal lattice drawings, have a look at @alexkaz2's excellent hexalattice.

  • Trigonal, hexagonal, square lattices as well as quasi lattices can be created and combined.
  • Linear distortions, such as a uniaxial strain along an arbitrary direction and rotations are supported. In addition, arbitrary deformations can be rendered (by passing a deformation tensor to the shift parameter).
  • Edge dislocations can be added to the lattice as well.

A simple Python notebook to interactively generate visualizations of moire patterns of hexagonal lattices at different angles is included.

A high resolution resulting movie of varying twist angle can be found here.

Furthermore, the effect of uniaxial deformation along a single direction as described in e.g. "Measuring local moiré lattice heterogeneity of twisted bilayer graphene " can be visualized.

Click the "Launch binder" button above to open an interactive notebook directly in your browser. (Note: performance in the mybinder environment is somewhat slow. Download and run the notebook on a local machine for better performance.)

moire pattern

Installation

Using pip

The package is available on pypi:

pip install latticegen

From source

If you want to install from source, that is of course also possible:

git clone https://github.com/TAdeJong/moire-lattice-generator.git
cd moire-lattice-generator
pip install .

If you want to be able to play around with the functions themselves, consider using pip install -e ..

Using conda:

Not yet available in conda-forge, but you can install it in a conda environment using pip. There is an environment.yml located in the binder folder in this project which can be used to create the environment: conda env create -f binder/environment.yml

Development

Testing

This project uses pytest and hypothesis to run tests.

Install the test dependencies:

$ pip install -r requirements_test.txt

To run the tests:

$ pytest

Releasing

Releases are published to PyPI by github actions when a tag is pushed to GitHub. (Note: we are using versioneer for version management)

Acknowledgement

This work was financially supported by the Netherlands Organisation for Scientific Research (NWO/OCW) as part of the Frontiers of Nanoscience (NanoFront) program.

moire-lattice-generator's People

Contributors

tadejong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.