Giter Club home page Giter Club logo

kwant.jl-ed3f9b50-51cd-11e9-3ece-75fc8af922bb's Introduction

Kwant.jl

Kwant.jl is an interface with the kwant quantum transport package, using the PyCall pacakage.

The goal of this project is to faithfully emulate the native API of kwant.

To date, the implementation is in its very early stages, reproducing only the first few pages of the First Steps Tutorial. See the tutorials folder.

Installation

To install from the Julia REPL, do ]add https://github.com/wrs28/Kwant.jl.git, which will look like

(v1.1) pkg> add https://github.com/wrs28/Kwant.jl.git

or perhaps using Pkg and Pkg.add("https://github.com/wrs28/Kwant.jl.git").

It is easiest to make a new installation of kwant via the Conda.jl package (first do ]add Conda). This can be done with

using Conda
Conda.add_channel("conda-forge")
Conda.add("kwant")

If you don't want to install a Julia-private instance of kwant, you can play some trickery with building PyCall to the same Python library (instructions here), but I don't recommend it.

Notes

To use the plotting routines that come with kwant, you must implicitly call using PyPlot. Then something like plot(syst) should plot the system. Dependeing on the environment and build, you may need to explicitly call gcf() to show the figure.

The first lines of the kwant tutorial read

import kwant
syst = kwant.Builder()
a=1
lat = kwant.lattice.square(a)
t=1.0
W=10
L=30
for i in range(L):
    for j in range(W):
        # On-site Hamiltonian
        syst[lat(i, j)] = 4 * t

        # Hopping in y-direction
        if j > 0:
            syst[lat(i, j), lat(i, j - 1)] = -t

        # Hopping in x-direction
        if i > 0:
            syst[lat(i, j), lat(i - 1, j)] = -t

while the first lines of the Julia implementation read

import Kwant
kwant = Kwant
syst = kwant.Builder()
a = 1
lat = kwant.lattice.square(a)
t = 1.0
W = 10
L = 30
for i in range(0,length=L)
    for j in range(0,length=W)
        # On-site Hamiltonian
        syst[lat(i, j)] = 4 * t

        # Hopping in y-direction
        if j > 0
            syst[lat(i,j),lat(i,j-1)] = -t
        end

        # Hopping in x-direction
        if i > 0
            syst[lat(i, j), lat(i - 1, j)] = -t
        end
    end
end

Note that the Python range(W) becomes range(0,length=W). Alternate expressions for iterating can be found here.

kwant.jl-ed3f9b50-51cd-11e9-3ece-75fc8af922bb's People

Contributors

wrs28 avatar

Watchers

James Cloos 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.