Skip to main content

A collection of functions for simulating EELS

Project description

PyEELS - Python EELS simulation package
=======================================

PyEELS is a package for simulation Electron Energy Loss Spectra from model band structures. It can both be used as tool within education or comparison to experimental results.

The use of the package can be seen as threefold:
1. Creating real space crystal models
2. Create/generate band structures in reciprocal space
3. Simulate EELS on the model band structures

Creating real space crystal models
==================================

The crystal defines much of the reciprocal band structure, a model of the crystal is thus important if a realistic band structure is to be generated.
Some parameters defined in the crystal are important for the reciprocal space calculation (i.e. Tight Binding)

Example usage:

```python
from pyeels import Crystal, Atom, Orbital
import numpy as np

myCrystal = Crystal(lattice=np.array([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])

myAtom = Atom(number=1, position=[0,0,0])
myAtom.add_orbital(Orbital(label="s", onsite="-2")

myCrystal.add_atom(myAtom)
```


Band structures in reciprocal space
===================================

The band structure can either be generated by a Tight Binding model (based on [PythTB](http://physics.rutgers.edu/pythtb/)) or parabolic bands.


Example usage:
```python
from pyeels import ParabolicBand

myCrystal_pb = ParabolicBand(myCrystal)

myCrystal_pb.set_grid(mesh=25)

# Affects the band structure in myCrystal
# Creates two parabolic bands with a direct band gap of 1
myCrystal_pb.set_parabolic(energy_offset=0, effective_mass=[-1, -1, -1], k_center=[0, 0, 0])
myCrystal_pb.set_parabolic(energy_offset=1, effective_mass=[ 1, 1, 1], k_center=[0, 0, 0])

# Visualization of the bands
myCrystal_pb.bandstructure()
```




Simulation of EEL-spectrum from the model system
================================================

The band structure gives the basis of the EEL-spectrum of a crystal. This simulation package lets you adjust all parameters in order to examine the effect of different features.
The outcomming signal is a [hyperspy](http://hyperspy.org/) signal, that can be investigated real time.

Example usage:

```python
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=["Supervisor", "Student"],
title="myCrystal",
notes="This model is just an example."
)

# The resolution of the diffraction zone, (can relate to the CCD-resolution)
mySystem.set_diffraction_zone() #No input autogenerates a zone

mySignal = mySystem.calculate_eels_multiproc(energyBins=np.linspace(0,4,50))

mySignal.plot()
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyEELS-1.0.1.dev1.tar.gz (20.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page