Skip to content

Commit

Permalink
added exercise TB_9 (bound states)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Nov 10, 2023
1 parent 402ff96 commit 6eff4d9
Show file tree
Hide file tree
Showing 5 changed files with 328 additions and 19 deletions.
8 changes: 4 additions & 4 deletions TB_04/run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"outputs": [],
"source": [
"device = elec.tile(15, axis=1)\n",
"center = device.center(what=\"xyz\")\n",
"device = device.remove(\n",
" device.close(\n",
" device.center(what='cell'), R=10.)\n",
" device.close(center, R=10.)\n",
")"
]
},
Expand All @@ -70,11 +70,11 @@
"metadata": {},
"outputs": [],
"source": [
"dangling = [ia for ia in device.close(device.center(what='cell'), R=14.)\n",
"dangling = [ia for ia in device.close(center, R=14.)\n",
" if len(device.close(ia, R=1.43)) < 3]\n",
"device = device.remove(dangling)\n",
"edge = []\n",
"for ia in device.close(device.center(what='cell'), R=14.):\n",
"for ia in device.close(center, R=14.):\n",
" if len(device.close(ia, R=1.43)) < 4:\n",
" edge.append(ia)\n",
"edge = np.array(edge)\n",
Expand Down
38 changes: 25 additions & 13 deletions TB_05/run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outputs": [],
"source": [
"import sisl\n",
"import sisl.viz\n",
"import numpy as np\n",
"from matplotlib import animation\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -18,11 +19,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this example, you will learn how to make use of the periodicity of the electrodes.\n",
"In this example, you will learn how to find and calculate properties of *bound states* in NEGF calculations.\n",
"\n",
"As seen in [TB 4](../TB_04/run.ipynb) the transmission calculation takes a considerable amount of time. In this example, we will redo the *same* calculation, but speed it up (no approximations made).\n",
"**NOTE**: Please complete exercise [TB 5](../TB_05/run.ipynb) before doing this exercise. \n",
"\n",
"A large computational effort is made on calculating the self-energies which basically is inverting, multiplying and adding matrices, roughly 10–20 times per $k$-point, per energy point, per electrode. \n",
"This example is very similar to [TB 5](../TB_05/run.ipynb), with the small change that some atoms are retained in the middle of the hole.\n",
"You should again use the self-energies which basically is inverting, multiplying and adding matrices, roughly 10–20 times per $k$-point, per energy point, per electrode. Please ensure \n",
"For systems with large electrodes compared to the full device, this becomes more demanding than calculating the Green function for the system. \n",
"When there is periodicity in electrodes along the transverse semi-infinite direction (not along the transport direction) one can utilize Bloch's theorem to reduce the computational cost of calculating the self-energy.\n",
"\n",
Expand Down Expand Up @@ -72,21 +74,30 @@
"metadata": {},
"outputs": [],
"source": [
"H = H_elec.repeat(25, axis=0).tile(15, axis=1)\n",
"H = H.remove(\n",
" H.geometry.close(\n",
" H.geometry.center(what='cell'), R=10.)\n",
"H = H_elec.tile(25, axis=0).tile(15, axis=1)\n",
"\n",
"center = H.geometry.center(what=\"xyz\")\n",
"\n",
"bound_idx, ring_idx = H.geometry.close(\n",
" center,\n",
" R=[5., 10.]\n",
")\n",
"H = H.remove(ring_idx)\n",
"\n",
"dangling = [ia for ia in H.geometry.close(H.geometry.center(what='cell'), R=14.)\n",
"dangling = [ia for ia in H.geometry.close(center, R=14.)\n",
" if len(H.edges(ia)) < 3]\n",
"H = H.remove(dangling)\n",
"edge = [ia for ia in H.geometry.close(H.geometry.center(what='cell'), R=14.)\n",
"plot = H.geometry.plot(axes=\"xy\")\n",
"edge = [ia for ia in H.geometry.close(center, R=14.)\n",
" if len(H.edges(ia)) < 4]\n",
"edge = np.array(edge)\n",
"\n",
"# Pretty-print the list of atoms\n",
"print(sisl.utils.list2str(edge + 1))\n",
"# Pretty-print the list of atoms on the edges\n",
"bound_idx = H.geometry.close(center, R=5)\n",
"# Make sure the edge atoms are only on the hole\n",
"edge = np.setdiff1d(edge, bound_idx)\n",
"print(\"All bound-state atoms: \", sisl.utils.list2str(bound_idx + 1))\n",
"print(\"All edge atoms: \", sisl.utils.list2str(edge + 1))\n",
"\n",
"H.geometry.write('device.xyz')\n",
"H.write('DEVICE.nc')"
Expand All @@ -98,9 +109,9 @@
"source": [
"# Exercises\n",
"\n",
"Instead of analysing the same thing as in [TB 4](../TB_04/run.ipynb) you should perform the following actions to explore the available data-analysis capabilities of TBtrans. Please note the difference in run-time between example 04 and this example. Always use Bloch's theorem when applicable!\n",
"Instead of analysing the same thing as in [TB 5](../TB_05/run.ipynb) you should perform the following actions to explore the available data-analysis capabilities of TBtrans. *Remember*: always use Bloch's theorem when applicable!\n",
"\n",
"*HINT* please copy as much as you like from example 04 to simplify the following tasks.\n",
"*HINT* please copy as much as you like from example 04/05 to simplify the following tasks.\n",
"\n",
"1. Read in the resulting file into a variable called `tbt`.\n",
"2. In the following, we will concentrate on *only* looking at $\\Gamma$-point related quantities. I.e. all quantities should only be plotted for this $k$-point. \n",
Expand All @@ -113,6 +124,7 @@
"3. Plot the transmission ($\\Gamma$-point only). To extract a subset $k$-point you should read the documentation for the functions (*hint: `kavg` is the keyword you are looking for*).\n",
" - Full transmission\n",
" - Bulk transmission\n",
" How does it compare to example 05, should it be different?\n",
"4. Plot the DOS with normalization according to the number of atoms ($\\Gamma$ only) \n",
" You may decide which atoms you examine.\n",
" - The Green function DOS\n",
Expand Down
35 changes: 35 additions & 0 deletions TB_09/RUN.fdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
TBT.HS DEVICE.nc

# Play with this number to get a converged result
TBT.k [5 1 1]

# Define which physical quantites to calculate.
# Each of these flags will decide what to calculate
# in the calculation.
# If you look these flags up in the manual you will
# find the physical quantities they correspond to.
TBT.DOS.Gf true
TBT.DOS.Elecs true
TBT.DOS.A true
TBT.DOS.A.All true
TBT.T.All true
TBT.T.Bulk true
TBT.T.Eig 5
TBT.Current.Orb true

# This flag is necessary to obtain the "correct"
# bond-currents
TBT.Symmetry.TimeReversal false

%block TBT.Elec.Left
HS ELEC.nc
semi-inf-direction -A2
electrode-position 1
bloch-a1 25
%endblock TBT.Elec.Left
%block TBT.Elec.Right
HS ELEC.nc
semi-inf-direction +A2
electrode-position end -1
bloch-a1 25
%endblock TBT.Elec.Right
Loading

0 comments on commit 6eff4d9

Please sign in to comment.