In [1]:
%matplotlib notebook

In [2]:
from pyeels import *
from pyeels.atom import Oxygen, Zinc
from pyeels.tightbinding import WursiteSP3

import hyperspy.api as hspy
import matplotlib.pyplot as plt
import numpy as np


WARNING:hyperspy.api:The traitsui GUI elements are not available, probably because the hyperspy_gui_traitui package is not installed.

In [3]:
ZnO = Crystal(lattice = np.array([
        [ np.sqrt(3)/2, -0.5, 0.0],
        [ 0.0, 1.0,  0.0],
        [ 0.0, 0.0, 1.65]])*3.28)

ZnO.add_atom(Oxygen([0,0,0]))
ZnO.add_atom(Oxygen([2/3, 1/3, 1/2]))
ZnO.add_atom(Zinc([2/3, 1/3, 1/8]))
ZnO.add_atom(Zinc([0.0, 0.0, 5/8]))


Out[3]:
'Placed atom at [ 0.     0.     0.625]'

In [4]:
ZnO.spacegroup


Out[4]:
'P6_3mc (186)'

In [5]:
# Tight Binding Model
ZnO_tb = WursiteSP3(ZnO)

Vss   = -6.043
Vxx   =  7.157
Vxy   = 10.578
Vsapc =  4.703
Vpasc =  8.634

ZnO_tb.set_hopping_parameters(Vss, Vxx, Vxy, Vsapc, Vpasc)

In [59]:
ZnO_tb.bandstructure(bands=(7,9), ylim=(None,None),color="black")
plt.axhline(1.65)
plt.show()



In [60]:
ZnO_tb.setGrid(mesh=45)
ZnO_tb.calculate(eig_vectors=False)

In [61]:
len(ZnO.brillouinZone.bands)


Out[61]:
16

In [44]:
eels = EELS(ZnO)

eels.setMeta(name="Parabolic multithread test", authors="Sindre R. Bilden", title="Test title", notes="First run with parabolic")

eels.setDiffractionZone()

In [45]:
s = eels.multiCalculateScatteringCrossSection(energyBins=np.linspace(2,6,80),bands=(5,9),fermiEnergy=1.65,temperature=0)


WARNING:hyperspy.signal:<Signal1D, title: Test title, dimensions: (45, 45, 45|80)> data is replaced by its optimized copy

In [56]:
s.plot()


/home/sindrerb/anaconda3/envs/hySpy2/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  warnings.warn(message, mplDeprecation, stacklevel=1)
/home/sindrerb/anaconda3/envs/hySpy2/lib/python3.6/site-packages/matplotlib/axes/_base.py:3239: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=0.0, top=0.0
  'bottom=%s, top=%s') % (bottom, top))
/home/sindrerb/anaconda3/envs/hySpy2/lib/python3.6/site-packages/matplotlib/axes/_base.py:3239: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=0.0, top=0.0
  'bottom=%s, top=%s') % (bottom, top))

In [41]:
plt.savefig("../Figures/ZnO_test_wave.png")

In [ ]: