Code Monkey home page Code Monkey logo

chern-1's Introduction

Chern Calculator

Chern number calculator for 2D materials.

In

  • Mathematica (v11.3)
  • python (python3.7.2)

Usage

Wolfram Mathematica

The Chern calculator is generated in chern.nb notebook. After then, a chern.m is generated for the next time use. One can either

  • Evaluate chern.nb each time in current (working) kernal, or
  • import chern from chern.m in the user's working notebook

to get the chern calculator in the working memory. Then use in two ways:

  • chern[hk]
  • chern[hk, discretized]

To be noticed:

  • It accepts one required arg + one optional arg in the calculator, i.e. chern[hk, discretized]

    • required: hk, the Hamiltonian
    • optional: discretized, the discretization to use in calculation, default to 16. (e.g., discretized=16 stands for 16-by-16 discretization of the Brillioun zone).
  • The Hamiltonian should be two-dimensional, in the sense that it should be either

    • Function that can accept two arguments (..#1..#2..&), or
    • Expression in terms of {kx, ky} (not a function, but when {kx, ky} replaced by numbers it should reduces to matrix with all entries numeric).

    These two form of Hamiltonian can both be accepted by our calculator.

  • The Hamiltonian is not limited to two-band models (example: graphene, haldane etc.), but it should be Hermittian and periodic in ($2\pi\times2\pi$) brillioun zone.

  • The Hamiltonian should not contain other unevaluated Symbols except {kx, ky}, which means that after we assign values to {kx, ky}, the Hamiltonian should be numeric in all its entries.

  • It returns the list of Chern number for all bands, which should be EXACTLY INTEGERs. If it's not, the model possibly be gapless --- which is, by the theory, not allowed to calculate the Chern for gapless bands in the first place.

Examples

python

Installing and getting started

git clone https://github.com/atom-sun/chern.git
cd python/chern
pip install .
python examples/haldane.py

See tutorial:python for the script.

Uninstalling

pip uninstall chern

Examples

  • Haldane honeycomb 2band model
python example/haldane.py

or

python examples/haldane.py --m 0.5 --phi 0

to specify a set of $${m, \phi}$$ values of haldane model. Also in example:haldane.ipynb.

Reference

The algorithm is given by a Japanese group in chern(2005) this paper. Credits to them.

Authors

chern-1's People

Contributors

atom-sun avatar

Stargazers

 avatar

Watchers

 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.