Giter VIP home page Giter VIP logo

pyeels's Introduction

PyEELS - Python EELS simulation package

PyEELS is a python package intended for simulating Electron Energy Loss Spectroscopy from model band structures.

The use of the package can be seen as threefold:

  1. Constructing a real space model system
  2. Create/generate model band structures in reciprocal space
  3. Simulate EELS on the model band structure

The creation of model band structures is mainly based on PythTB, an additional model with parabolic bands is also provided.

The simulation of EELS is implemented in an C extension and can be multiprocessed for faster calculation.

HyperSpy has been chosen as a framework for an interactive visualization of EELS-spectra, in this process Jupyter Notebook is a natural platform for scripting purpose.

An example is presented below:

# Generate real space crystal model
from pyeels import Crystal

myCrystal = Crystal(lattice=np.eye(3))
myAtom = Atom(number=0,position=[0,0,0])
myAtom.add_orbital(Orbital(label="s", onsite=0))
myCrystal.add_atom(atom=myAtom)

# Create parabolic bands in reciprocal space
from pyeels import ParabolicBand
reci = ParabolicBand(myCrystal)

reci.set_grid(mesh=31) # Number of k-points in each dimension

# Parabolic valence band
reci.set_parabolic(effective_mass=[-0.5, -0.5, -0.5], 
                   energy_offset=0, 
                   k_center=[0,0,0], 
                   wave=np.array([0,0.02])
                  )
		 
# Parabolic conduction band
reci.set_parabolic(effective_mass=[ 0.5,  0.5,  0.5], 
                   energy_offset=1, 
                   k_center=[0,0,0],
                   wave=np.array([0,1])
                  )

# Calculate EELS on the parabolic bands
from pyeels import EELS

mySystem = EELS(myCrystal)
mySystem.temperature = 0    # Absolute zero
mySystem.fermienergy = 0.5  # Placing the fermi level at center of the band gap

mySystem.set_meta(
	name="My test sample", 
	author=["Author1", "Author2"], 
	title="myCrystal", 
	notes="This model is just an example." 
	)

# The q-resolution of the scattering cross section
# no argument correspond to the density of the k-grid in Brillouin Zone
mySystem.set_diffraction_zone()

mySignal = mySystem.calculate_eels_multiproc(energyBins=np.linspace(0,4,200),
                                     	     smearing=0.05
                                     	     max_cpu=4
					    )
					    
#HyperSpy visuailzation
mySignal.plot()

pyeels's People

Contributors

sindrerb avatar thomasaarholt 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.