root / ase / transport / stm_test.py @ 7
Historique | Voir | Annoter | Télécharger (1,67 ko)
| 1 |
import numpy as np |
|---|---|
| 2 |
import pylab |
| 3 |
import ase.transport.stm as stm |
| 4 |
|
| 5 |
|
| 6 |
# Parameters for a simple model.
|
| 7 |
#
|
| 8 |
#
|
| 9 |
# * eps_a
|
| 10 |
# v_ts / \ v_a2
|
| 11 |
# ... * * * * * * * * * ...
|
| 12 |
# \/ \/
|
| 13 |
# t1 t2
|
| 14 |
#
|
| 15 |
# Tip Surface
|
| 16 |
# ----------------| |-----------------------
|
| 17 |
t1 = -1.0
|
| 18 |
t2 = -2.0
|
| 19 |
eps_a = 0.4
|
| 20 |
|
| 21 |
v_ts = 0.05
|
| 22 |
v_a2 = 1.0
|
| 23 |
|
| 24 |
#Tip
|
| 25 |
h1 = np.zeros([2, 2]) |
| 26 |
h1[0, 1] = t1 |
| 27 |
h1[1, 0] = t1 |
| 28 |
s1 = np.identity(2)
|
| 29 |
|
| 30 |
h10 = np.zeros([2,2]) |
| 31 |
h10[0, 1] = t1 |
| 32 |
h10[1, 0] = t1 |
| 33 |
s10 = np.identity(2)
|
| 34 |
|
| 35 |
|
| 36 |
#Surface with "molecule" a.
|
| 37 |
h2 = np.zeros([2,2]) |
| 38 |
h2[0, 1] = v_a2 |
| 39 |
h2[1, 0] = v_a2 |
| 40 |
h1[0, 0] = eps_a |
| 41 |
s2 = np.identity(2)
|
| 42 |
|
| 43 |
h20 = np.zeros([2,2]) |
| 44 |
h20[0, 1] = t2 |
| 45 |
h20[1, 0] = t2 |
| 46 |
s20 = np.identity(2)
|
| 47 |
|
| 48 |
|
| 49 |
#Tip Surface coupling
|
| 50 |
V_ts = np.zeros([2,2]) |
| 51 |
V_ts[1, 0] = v_ts |
| 52 |
|
| 53 |
eta1 = 0.0001
|
| 54 |
eta2 = 0.0001
|
| 55 |
|
| 56 |
stm = reload(stm)
|
| 57 |
stm_calc = stm.STM(h1, s1, h2, s2, h10, s10, h20, s20, eta1, eta2) |
| 58 |
energies = np.arange(-3.0, 3.0, 0.01) |
| 59 |
stm_calc.initialize(energies) |
| 60 |
|
| 61 |
|
| 62 |
T_stm = stm_calc.get_transmission(V_ts) |
| 63 |
|
| 64 |
|
| 65 |
#Perform the full calculation and compare
|
| 66 |
from ase.transport.calculators import TransportCalculator as TC |
| 67 |
|
| 68 |
h = np.zeros([4,4]) |
| 69 |
h[:2, :2] = h1 |
| 70 |
h[-2:, -2:] = h2 |
| 71 |
h[:2, -2:] = V_ts |
| 72 |
h[-2:, :2] = V_ts.T |
| 73 |
|
| 74 |
|
| 75 |
tc = TC(energies=energies, |
| 76 |
h=h, |
| 77 |
h1=h10, |
| 78 |
h2=h20, |
| 79 |
eta=eta1, eta1=eta1, eta2=eta2) |
| 80 |
|
| 81 |
T_full = tc.get_transmission() |
| 82 |
|
| 83 |
pylab.plot(stm_calc.energies, T_stm, 'b')
|
| 84 |
pylab.plot(tc.energies, T_full, 'r--')
|
| 85 |
pylab.show() |
| 86 |
|
| 87 |
|
| 88 |
#bias stuff
|
| 89 |
biass = np.arange(-2.0, 2.0, 0.2) |
| 90 |
Is = [stm_calc.get_current(bias, V_ts) for bias in biass] |
| 91 |
pylab.plot(biass, Is, '+')
|
| 92 |
pylab.show() |
| 93 |
|
| 94 |
|