GithubHelp home page GithubHelp logo

chinchay / greenpy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 587 KB

Decimation of the Green function in graphene nanoribbons

License: MIT License

Python 100.00%
density-of-states graphene hubbard-model self-consistent-field tight-binding-model nano-ribbon green-functions

greenpy's Introduction

GreenPy

The package implements a class to handle different calculations to obtain the electronic density of states of a nanomaterial. The code is based on the iterative use of the Dyson equation through a process called "dressing up" or "decimation." It is assumed the system is periodic along the axial axis.

Quick start

Clone the repo: https://github.com/chinchay/GreenPy.git

or install it:

$ pip install GreenPy

What's included

Ready to use methods are available: get_density_OneLinearChain() and get_density_smallestZGNR() to calculate and display the electronic density of a linear chain of atoms and for the smallest zigzag graphene nanoribbon, respectively.

import numpy as np
from GreenPy import Green
import matplotlib.pyplot as plt

energy_list  = np.arange(-3.15, 3.25, 0.05)
density_list = []
for energy in energy_list:
    dens = Green.get_density_smallestZGNR(energy)
    density_list.append( dens )
#
Green.plot(energy_list, density_list)

drawing

The src folder contains a performance comparison between Numpy and LAPACK functions. Unit test is also available.

The package allows to include electronic correlation. First, a self-consistent calculation is performed to find the occupation at each atom site:

import numpy as np
from GreenPy import Green
import matplotlib.pyplot as plt
from GreenPy import library as lib

nAtoms = 4 # for a 2-ZGNR
t00, t, td, onsite_list = lib.get_ZGNR_interactions(nAtoms)
g = Green(t00=t00, t=t, td=td, onsite_list=onsite_list, consider_spin=True)

store_errors=True
g.find_occupations(store_errors=True)
plt.plot(g.hist_err, '.')
plt.show()

drawing

Now, the DOS for electrons with spin up and down can be found after a decimation process, using the converged occupations stored in g:

energy_list = np.arange(-3.15, 3.25, 0.05)
up_list, dw_list = [], []
for (i, energy) in enumerate(energy_list):
    up, dw = g.get_DOS(energy=energy)
    up_list.append(up)
    dw_list.append(dw)
#
g.plot(energy_list, up_list)
g.plot(energy_list, dw_list)

drawing

DOS curves are degenerated, so results for spin-down electrons are the same.

Under development

  • A future release will connect the code to ASE objects and calculators
  • Electric and magnetic field effects

References

Copyright and license

Code released under the MIT License

greenpy's People

Contributors

chinchay 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.