Skip to content

Commit 3cc02f5

Browse files
committed
finished 02
Signed-off-by: Nick Papior <nickpapior@gmail.com>
1 parent 57bd908 commit 3cc02f5

7 files changed

Lines changed: 244 additions & 11 deletions

File tree

presentations/01/RUN.fdf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
TBT.k [ 3 1 1 ]
3+
4+
TBT.DOS.A
5+
TBT.Current.Orb
6+
7+
TBT.HS DEVICE.nc
8+
%block TBT.Elec.Left
9+
HS ELEC.nc
10+
semi-inf-direction -a2
11+
electrode-position 1
12+
%endblock
13+
%block TBT.Elec.Right
14+
HS ELEC.nc
15+
semi-inf-direction +a2
16+
electrode-position end -1
17+
%endblock
18+

presentations/01/run.ipynb

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from __future__ import print_function\n",
10+
"import sisl\n",
11+
"import numpy as np\n",
12+
"import matplotlib.pyplot as plt\n",
13+
"%matplotlib inline"
14+
]
15+
},
16+
{
17+
"cell_type": "markdown",
18+
"metadata": {},
19+
"source": [
20+
"Example of the $k$-point sampling for TBtrans."
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": null,
26+
"metadata": {},
27+
"outputs": [],
28+
"source": [
29+
"chain = sisl.Geometry([0]*3, sisl.Atom(1, R=1.), sc=[1, 1, 10])\n",
30+
"chain.set_nsc([3, 3, 1])\n",
31+
"\n",
32+
"# Transport along y-direction\n",
33+
"chain = chain.tile(20, 0)\n",
34+
"He = sisl.Hamiltonian(chain)\n",
35+
"He.construct(([0.1, 1.1], [0, -1]))\n",
36+
"Hd = He.tile(20, 1)\n",
37+
"He.write('ELEC.nc')\n",
38+
"Hd.write('DEVICE.nc')"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": null,
44+
"metadata": {},
45+
"outputs": [],
46+
"source": [
47+
"with open('RUN.fdf', 'w') as f:\n",
48+
" f.write(\"\"\"\n",
49+
"TBT.k [ 3 1 1 ]\n",
50+
"\n",
51+
"TBT.DOS.A\n",
52+
"TBT.Current.Orb\n",
53+
"\n",
54+
"TBT.HS DEVICE.nc\n",
55+
"%block TBT.Elec.Left\n",
56+
" HS ELEC.nc\n",
57+
" semi-inf-direction -a2\n",
58+
" electrode-position 1\n",
59+
"%endblock\n",
60+
"%block TBT.Elec.Right\n",
61+
" HS ELEC.nc\n",
62+
" semi-inf-direction +a2\n",
63+
" electrode-position end -1\n",
64+
"%endblock\n",
65+
" \"\"\")"
66+
]
67+
},
68+
{
69+
"cell_type": "markdown",
70+
"metadata": {},
71+
"source": [
72+
"Run these two executables:\n",
73+
"\n",
74+
" tbtrans -D TRS RUN.fdf\n",
75+
" tbtrans -D NO_TRS -fdf TBT.Symmetry.TimeReversal:f RUN.fdf"
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": null,
81+
"metadata": {},
82+
"outputs": [],
83+
"source": [
84+
"trs = sisl.get_sile('TRS/siesta.TBT.nc')\n",
85+
"no_trs = sisl.get_sile('NO_TRS/siesta.TBT.nc')"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": null,
91+
"metadata": {},
92+
"outputs": [],
93+
"source": [
94+
"def plot_bond(tbt, E):\n",
95+
" xy = tbt.geometry.xyz[:, :2]\n",
96+
" vector = tbt.vector_current(0, E)[:, :2]\n",
97+
" atom = tbt.atom_current(0, E)\n",
98+
" # Normalize atomic current\n",
99+
" atom += 1\n",
100+
" atom *= 10 / atom.max()\n",
101+
" plt.scatter(xy[:, 0], xy[:, 1], atom);\n",
102+
" plt.quiver(xy[:, 0], xy[:, 1], vector[:, 0], vector[:, 1]);\n",
103+
" plt.gca().get_xaxis().set_visible(False)\n",
104+
" plt.gca().get_yaxis().set_visible(False)\n",
105+
" plt.tight_layout()"
106+
]
107+
},
108+
{
109+
"cell_type": "code",
110+
"execution_count": null,
111+
"metadata": {},
112+
"outputs": [],
113+
"source": [
114+
"plot_bond(trs, 1.)\n",
115+
"plt.savefig('fig/trs.png')"
116+
]
117+
},
118+
{
119+
"cell_type": "code",
120+
"execution_count": null,
121+
"metadata": {},
122+
"outputs": [],
123+
"source": [
124+
"plot_bond(no_trs, 1.)\n",
125+
"plt.savefig('fig/no_trs.png')"
126+
]
127+
},
128+
{
129+
"cell_type": "code",
130+
"execution_count": null,
131+
"metadata": {},
132+
"outputs": [],
133+
"source": []
134+
}
135+
],
136+
"metadata": {
137+
"kernelspec": {
138+
"display_name": "Python 2",
139+
"language": "python",
140+
"name": "python2"
141+
},
142+
"language_info": {
143+
"codemirror_mode": {
144+
"name": "ipython",
145+
"version": 2
146+
},
147+
"file_extension": ".py",
148+
"mimetype": "text/x-python",
149+
"name": "python",
150+
"nbconvert_exporter": "python",
151+
"pygments_lexer": "ipython2",
152+
"version": "2.7.14"
153+
}
154+
},
155+
"nbformat": 4,
156+
"nbformat_minor": 2
157+
}

presentations/02/chemical.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ \subsection{Chemical potentials}
4848
%\node[fdf,ind] (NP-1) {contour.eq.pole.n $\langle \mathrm{int}\rangle_1$}; \\
4949
\node[fdf,ind] {contour.eq}; \\
5050
\node[fdf,iind] {begin}; \\
51+
\only<5->{
5152
\node[fdf,lmark,iiind] (C-chem-1) {C-chem-1}; \\
5253
\node[fdf,lmark,iiind] (L-chem-1) {L-chem-1}; \\
54+
}
55+
\only<1-4>{
56+
\node[fdf,iiind] (C-chem-1) {C-chem-1}; \\
57+
\node[fdf,iiind] (L-chem-1) {L-chem-1}; \\
58+
}
5359
\node[fdf,iind] {end}; \\
5460
\node[fdf] {\%endblock}; \\
5561
};

presentations/02/negf.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ \subsection{Numeric integration}
340340
xlabel={Energy [eV]},
341341
ylabel={Weight}]
342342
\only<1>{
343-
\addplot[gen,good,domain=-.3:.3,samples=25] {1./(exp((x-0.25)/0.01) + 1)-
344-
1./(exp((x+0.25)/0.01) + 1)};
345-
\addplot[gen,bad,domain=-.55:.55,samples=30] {1./(exp((x-0.5)/0.01)
343+
%\addplot[gen,bad,domain=-.3:.3,samples=25] {1./(exp((x-0.25)/0.01) + 1)-
344+
% 1./(exp((x+0.25)/0.01) + 1)};
345+
\addplot[gen,good,domain=-.55:.55,samples=30] {1./(exp((x-0.5)/0.01)
346346
+ 1)- 1./(exp((x+0.5)/0.01) + 1)};
347-
\draw[<->,good,very thick] (axis cs:-.25, 0.3) -- (axis cs:.25,0.3) node[midway,above]
348-
{$n_F(\E+0.25\,\mathrm{eV}) - n_F(\E-0.25\,\mathrm{eV})$};
349-
\draw[<->,bad,very thick] (axis cs:-.5, 1.3) -- (axis cs:.5,1.3) node[midway,above]
347+
%\draw[<->,bad,very thick] (axis cs:-.25, 0.3) -- (axis cs:.25,0.3) node[midway,above]
348+
%{$n_F(\E+0.25\,\mathrm{eV}) - n_F(\E-0.25\,\mathrm{eV})$};
349+
\draw[<->,good,very thick] (axis cs:-.5, 1.3) -- (axis cs:.5,1.3) node[midway,above]
350350
{$n_F(\E+0.5\,\mathrm{eV}) - n_F(\E-0.5\,\mathrm{eV})$};
351351
\node[below left] at (rel axis cs:.9,.9) {2 different $\mu$};
352352
}

presentations/02/summary.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ \section{Setup sequence summary}
3333

3434
\item Run TranSiesta on device at $V=0$
3535

36-
\item \textbf{ENSURE CONVERGENCE}
36+
\item !!! \textbf{ENSURE CONVERGENCE} !!!
3737

3838
\item Step-by-step increase/decrease the bias and copy the \texttt{siesta.TSDE} from
3939
the nearest lower bias to the folder for restart capability

presentations/02/talk.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
\tableofcontents
2424
\end{frame}
2525

26+
\input steps.tex
2627
\input negf.tex
2728
\input contour.tex
2829
\input chemical.tex
29-
\input steps.tex
3030
\input summary.tex
3131

3232
\end{document}

tutorial.ipynb

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
5+
"execution_count": 2,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -47,9 +47,54 @@
4747
},
4848
{
4949
"cell_type": "code",
50-
"execution_count": null,
50+
"execution_count": 3,
5151
"metadata": {},
52-
"outputs": [],
52+
"outputs": [
53+
{
54+
"name": "stdout",
55+
"output_type": "stream",
56+
"text": [
57+
"Help on method tile in module sisl.geometry:\n",
58+
"\n",
59+
"tile(self, reps, axis) unbound sisl.geometry.Geometry method\n",
60+
" Tile the geometry to create a bigger one\n",
61+
" \n",
62+
" The atomic indices are retained for the base structure.\n",
63+
" \n",
64+
" Parameters\n",
65+
" ----------\n",
66+
" reps : int\n",
67+
" number of tiles (repetitions)\n",
68+
" axis : int\n",
69+
" direction of tiling, 0, 1, 2 according to the cell-direction\n",
70+
" \n",
71+
" Examples\n",
72+
" --------\n",
73+
" >>> geom = Geometry([[0, 0, 0], [0.5, 0, 0]], sc=1.)\n",
74+
" >>> g = geom.tile(2,axis=0)\n",
75+
" >>> print(g.xyz)\n",
76+
" [[ 0. 0. 0. ]\n",
77+
" [ 0.5 0. 0. ]\n",
78+
" [ 1. 0. 0. ]\n",
79+
" [ 1.5 0. 0. ]]\n",
80+
" >>> g = geom.tile(2,0).tile(2,axis=1)\n",
81+
" >>> print(g.xyz)\n",
82+
" [[ 0. 0. 0. ]\n",
83+
" [ 0.5 0. 0. ]\n",
84+
" [ 1. 0. 0. ]\n",
85+
" [ 1.5 0. 0. ]\n",
86+
" [ 0. 1. 0. ]\n",
87+
" [ 0.5 1. 0. ]\n",
88+
" [ 1. 1. 0. ]\n",
89+
" [ 1.5 1. 0. ]]\n",
90+
" \n",
91+
" See Also\n",
92+
" --------\n",
93+
" repeat : equivalent but different ordering of final structure\n",
94+
"\n"
95+
]
96+
}
97+
],
5398
"source": [
5499
"%pdoc sisl.Geometry.tile\n",
55100
"help(sisl.Geometry.tile)"
@@ -167,6 +212,13 @@
167212
"- [Advanced 04](A04/run.ipynb) \n",
168213
" Create a 3rd nearest neighbour graphene model."
169214
]
215+
},
216+
{
217+
"cell_type": "code",
218+
"execution_count": null,
219+
"metadata": {},
220+
"outputs": [],
221+
"source": []
170222
}
171223
],
172224
"metadata": {

0 commit comments

Comments
 (0)