Getting started¶
The QEH python package implements a simple command line interface (CLI) to make QEH calculations without writing python scripts. This is very useful when investigating standard properties of heterostructures. However, QEH calculations can also be performed in Python scripts which is useful if the CLI is not sufficient. This tutorial first introduces the QEH CLI and ends with a description of writing Python scripts that call the QEH code.
Command line interface¶
To see the help for the CLI do
$ qeh -h
usage: qeh [-h] [--thicknesses [THICKNESSES ...]]
[--buildingblockpath [BUILDINGBLOCKPATH ...]] [--plasmons]
[--eigenvalues] [--potential] [--density]
[--plasmonfile PLASMONFILE] [--eels EELS] [--plot]
[--save-plots SAVE_PLOTS] [--substrate SUBSTRATE]
[--omega OMEGA OMEGA OMEGA] [--q Q Q Q] [--list]
[layers ...]
QEH Model command line interface
...
There are many options for the CLI but most important is the
layers
argument which describes the layers that make up the
heterostructure. For example to build a heterostructure consisting of
doped graphene on 3 layers of boron nitride do:
$ qeh graphene+doping=0.5 3BN
For example the plasmons of a doped graphene on three layers of boron nitride can be calculated and saved as:
$ qeh graphene+doping=0.5 3BN --plasmons --save-plots "_g-3BN"
which creates a figure loss_g-3BN.png
containing the loss spectrum
and a figure plasmon_modes_g-3BN.png
which traces the plasmon
modes:
Here we introduced a couple of key concepts. You can modify layers
with the +
syntax. For example, the example above used the layer
modifier doping=0.5
which doped graphene. See the doping section
for details about this modifier. Because boron nitride is polar there
will be an additional contribution to the dielectric properties from
its phonons. These have been calculated as well and can be included
with the phonons modifier
Available monolayers¶
To find a list of the monolayers that are available for the QEH model:
$ qeh --list
In this list you can see if any default layer thickness is available, if there exists a phonon building block and whether any effective masses exist to be used for the doping modifier. By default, the effective electron mass is used for doped semiconductors.
Default thicknesses¶
The default thicknesses of a monolayer is derived from its
corresponding bulk phase in ICSD if it exists. Use $ qeh --list
to
show the default thickness of a monolayer.
Doped semiconductors and graphene¶
The doping modifier can be used to dope graphene or a semi-conducting monolayer. The doping modifier takes additional arguments which can be providided using a comma separated list:
$ qeh H-MoS2+doping=0.1,T=25e-3,eta=1e-3,em=0.43
Here we dope MoS2 in the H phase with at a finite temperature
of 25 meV (T=25e-3
), a relaxation rate of 3 meV (eta=1e-3
) and
with an effective mass of 0.43 electron masses em=0.43
.
If no default mass is specified, QEH will use default parameters
obtained from [1] . Use $ qeh --list
to show the default
effective masses (marked with (d)
).
Phonons and isotopes¶
For some polar semi conductors the QEH code implements the lattice
polarization response due to polar optical phonons. To see whether
this is a available for a given monolayer use $ qeh --list
and
look for +phonons available
which means that the phonon modifier
is available. The phonon modifier can be used as:
$ qeh 10BN+phonons
which could construct a heterostructure of 10 BN layers including the lattice response.
Note
Note that if the phonon modifier is not present:
$ qeh 10BN
then the calculated results will only inlude the electronic response.
When calculating the lattice response it is possible to manually specify the isotopic mass of the atoms that constitute the monolayer. Similar to supplying arguments for the doping modifier if we can to specify the isotopic mass of boron in BN we can do:
$ qeh 5BN+phonons,m_B=10 5BN+phonons,m_B=11
which creates a heterostructure consisting of 5 B 10 N monolayers on 5 B 11 N monolayers.
Scripting¶
Sometimes the command line interface to the QEH package is not flexible enough for you needs. QEH therefore also provides an easy-to-use Python API which allows you to programmatically customize your QEH calculation. For example to calculate the optical response of graphene a graphene multilayer stack we can do
from matplotlib import pyplot as plt
from qeh import make_heterostructure
import numpy as np
layers = ['3graphene+doping=0.1,eta=1e-3']
het = make_heterostructure(layers, frequencies=[1e-5, 0.2, 500],
momenta=[0.0001, 0.02, 300])
het.get_plasmon_eigenmodes(filename='graphenemodes.npz')
data = np.load('graphenemodes.npz')
q_q = data['q_q']
w_w = data['omega_w']
eig_qwl = data['eig']
inveig_qw = - np.sum(1 / eig_qwl, axis=-1).imag
plt.figure(figsize=(3.4, 2.5))
plt.pcolor(q_q, w_w, inveig_qw.T)
ax = plt.gca()
plt.xlabel(r'$q$ (Å$^{-1}$)')
plt.ylabel(r'$\hbar\omega$ (eV)')
plt.tight_layout()
plt.savefig('graphene-multilayer-modes.png', dpi=600)
The main function to call is
make_heterostructure
which takes a layers
keyword which is a
list of layer descriptions identical to the layer descriptions of
the CLI.