From c3e8a07c41898f35bdebb298a788aed294e44369 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Tue, 13 Nov 2018 16:34:13 +0000 Subject: As presented at Princeton University on 2018-11-13 --- Jauslin_Princeton_2018b.tex | 271 +++++++++++++++++++++ Makefile | 50 ++++ README | 43 ++++ figs/Millikan-Lauritsen_current.png | Bin 0 -> 29963 bytes figs/animation/FN_base.jl | 170 +++++++++++++ figs/animation/Makefile | 13 + figs/animation/animate-positive.py | 130 ++++++++++ figs/animation/animate.py | 128 ++++++++++ figs/animation/animate_compute.jl | 66 +++++ figs/contour.fig/Makefile | 30 +++ figs/contour.fig/contour.py | 82 +++++++ figs/contour.fig/contour.tikz.tex | 34 +++ figs/emitter.jpg | Bin 0 -> 14324 bytes figs/fowler-nordheim.fig/FN_base.jl | 170 +++++++++++++ figs/fowler-nordheim.fig/Makefile | 29 +++ figs/fowler-nordheim.fig/asymptotic.gnuplot | 59 +++++ figs/fowler-nordheim.fig/asymptotic.jl | 46 ++++ figs/libs/Makefile | 28 +++ figs/potential.fig/Makefile | 1 + figs/potential.fig/potential.tikz.tex | 17 ++ figs/potential.fig/potential_square.tikz.tex | 17 ++ .../potential_square_photonic.tikz.tex | 22 ++ .../potential_square_thermal.tikz.tex | 17 ++ libs/ian-presentation.cls | 187 ++++++++++++++ 24 files changed, 1610 insertions(+) create mode 100644 Jauslin_Princeton_2018b.tex create mode 100644 Makefile create mode 100644 README create mode 100644 figs/Millikan-Lauritsen_current.png create mode 100644 figs/animation/FN_base.jl create mode 100644 figs/animation/Makefile create mode 100644 figs/animation/animate-positive.py create mode 100644 figs/animation/animate.py create mode 100644 figs/animation/animate_compute.jl create mode 100644 figs/contour.fig/Makefile create mode 100644 figs/contour.fig/contour.py create mode 100644 figs/contour.fig/contour.tikz.tex create mode 100644 figs/emitter.jpg create mode 100644 figs/fowler-nordheim.fig/FN_base.jl create mode 100644 figs/fowler-nordheim.fig/Makefile create mode 100644 figs/fowler-nordheim.fig/asymptotic.gnuplot create mode 100644 figs/fowler-nordheim.fig/asymptotic.jl create mode 100644 figs/libs/Makefile create mode 120000 figs/potential.fig/Makefile create mode 100644 figs/potential.fig/potential.tikz.tex create mode 100644 figs/potential.fig/potential_square.tikz.tex create mode 100644 figs/potential.fig/potential_square_photonic.tikz.tex create mode 100644 figs/potential.fig/potential_square_thermal.tikz.tex create mode 100644 libs/ian-presentation.cls diff --git a/Jauslin_Princeton_2018b.tex b/Jauslin_Princeton_2018b.tex new file mode 100644 index 0000000..83c3a1b --- /dev/null +++ b/Jauslin_Princeton_2018b.tex @@ -0,0 +1,271 @@ +\documentclass{ian-presentation} + +\usepackage[hidelinks]{hyperref} +\usepackage{graphicx} +\usepackage{array} + +\begin{document} +\pagestyle{empty} +\hbox{}\vfil +\bf\Large +\hfil Field electron emission\par +\smallskip +\hfil and the Fowler-Nordheim equation\par +\vfil +\large +\hfil Ian Jauslin +\normalsize +\vfil +\hfil\rm joint with {\bf Ovidiu Costin}, {\bf Rodica Costin}, and {\bf Joel L. Lebowitz}\par +\vfil +arXiv:{\tt \href{http://arxiv.org/abs/1808.00936}{1808.00936}}\hfill{\tt \href{http://ian.jauslin.org}{http://ian.jauslin.org}} +\eject + +\setcounter{page}1 +\pagestyle{plain} + +\title{Field emission} +\vfill +\hfil\includegraphics[height=5cm]{emitter.jpg} +\vfill +\eject + +\title{Field emission} +$$ + V(x)=U\Theta(x) + ,\quad + E_{\mathrm F}=k_{\mathrm F}^2U +$$ +\hfil\includegraphics[height=5cm]{potential_square_thermal.pdf} +\vfill +\eject + +\title{Photonic emission} +$$ + V_t(x)=\Theta(x)(U-E_tx) + ,\quad + E_t=\epsilon\omega\cos(\omega t) +$$ +\hfil\includegraphics[height=5cm]{potential_square_photonic.pdf} +\vfill +\eject + +\title{Field emission} +$$ + V(x)=\Theta(x)(U-Ex) +$$ +\hfil\includegraphics[height=5cm]{potential.pdf} +\vfill +\eject + +\title{Field emission} +\begin{itemize} + \item \href{https://doi.org/10.1073\%2Fpnas.14.1.45}{[Millikan, Lauritsen, 1928]}: experimental plot of the logarithm of the current against $1/E$ +\end{itemize} +\hfil\includegraphics[height=4.5cm]{Millikan-Lauritsen_current.png} +\vfill +\eject + +\title{Field emission through a triangular barrier} +\vfill +\begin{itemize} + \item \href{https://doi.org/10.1098/rspa.1928.0091}{[Fowler, Nordheim, 1928]}: predicted that the current is, for small $E$, + $$ + J\approx CE^2e^{-\frac aE} + $$ + \item (\href{https://doi.org/10.1088/1751-8113/44/5/05530@}{[Rokhlenko, 2011]}: studied the range of applicability of the approximation, and found more accurate approximations for larger fields.) +\end{itemize} +\vfill +\eject + +\title{Fowler-Nordheim equation} +\begin{itemize} + \item Schr\"odinger equation + $$ + i\partial_t\psi=-\Delta\psi+\Theta(x)(U-Ex)\psi + $$ + \item Fowler-Nordheim: stationary solution: $\psi_{\mathrm{FN}}(x,t)=e^{-ik^2t}\varphi_{\mathrm{FN}}(x)$ + $$ + \varphi_{\mathrm{FN}}(x)= + \left\{ \begin{array}{l@{\ }l} + e^{ikx}+R_Ee^{-ikx} & x<0\\ + T_E\mathrm{Ai}(e^{-\frac{i\pi}3}(E^{\frac13}x-E^{-\frac23}(U-k^2)) & x>0 + \end{array}\right. + $$ + $R_E$ and $T_E$ are chosen so that $\varphi_{\mathrm{FN}}$ and $\partial\varphi_{\mathrm{FN}}$ are continuous at $x=0$. +\end{itemize} +\vfill +\eject + +\title{Fowler-Nordheim equation} +\vfill +\hfil\includegraphics[height=5.5cm]{asymptotic.pdf} +\vfill +\eject + +\title{Initial value problem} +\begin{itemize} + \item Initial condition: + $$ + \psi(x,0)= + \left\{ \begin{array}{l@{\ }l} + e^{ikx}+R_0e^{-ikx} & x<0\\ + T_0 e^{-\sqrt{U-k^2}x} & x>0 + \end{array}\right. + $$ + $R_0$ and $T_0$ ensure that $\psi$ and $\partial\psi$ are continuous. + \item Behaves asymptotically like $\psi_{\mathrm{FN}}$: + $$ + \psi(x,t)e^{ik^2t}\mathop{\longrightarrow}_{t\to\infty}\varphi_{\mathrm{FN}}(x) + $$ +\end{itemize} +\vfill +\eject + +\title{Initial value problem} +\begin{itemize} + \item Laplace transform: + $$ + \hat\psi_p(x):=\int_0^\infty dt\ e^{-pt}\psi(x,t) + $$ + \item Schr\"odinger equation: + $$ + (-\Delta+\Theta(x)V(x)-ip)\psi_p(x)=-i\psi(x,0) + ,\quad + V(x):=U-Ex + $$ +\end{itemize} +\vfill +\eject + +\title{Solution in Laplace space} +\begin{itemize} + \item For simplicity, $R_0\equiv T_0\equiv0$. + \item Solution: + $$ + \hat\psi_p(x)= + \left\{\begin{array}{>\displaystyle l@{\ }l} + C_1(p)e^{\sqrt{-ip}x}-\frac{ie^{ikx}}{-ip+k^2} + &\mathrm{if\ }x<0\\[0.5cm] + C_2(p)\varphi_p(x) + &\mathrm{if\ }x> 0 + \end{array}\right. + $$ + with + $$ + (-\Delta+V(x)-ip)\varphi_p(x)=0 + $$ + $$ + \varphi_p(x)=\mathrm{Ai}\left(e^{-\frac{i\pi}3}\left(E^{\frac13}x-E^{-\frac23}(U-ip)\right)\right) + $$ +\end{itemize} +\vfill +\eject + +\title{Solution in Laplace space} +\begin{itemize} + \item $C_1$ and $C_2$ ensure that $\hat\psi_p(x)$ and $\partial\hat\psi_p(x)$ are continuous at $x=0$: + $$ + C_1(p)=\frac{i(ik\varphi_p(0)-\partial\varphi_p(0))}{(-ip+k^2)(\sqrt{-ip}\varphi_p(0)-\partial\varphi_p(0))} + $$ + $$ + C_2(p)=-\frac{i}{(\sqrt{-ip}+ik)(\sqrt{-ip}\varphi_p(0)-\partial\varphi_p(0))}. + $$ +\end{itemize} +\vfill +\eject + +\title{Poles in Laplace plane} +\vfill +\hfil\includegraphics[height=5.5cm]{contour.pdf} +\vfill +\eject + +\title{Asymptotic behavior} +\begin{itemize} + \item As $t\to\infty$: + $$ + \psi(x,t) + =\psi_{\mathrm{FN}}(x,t)+\left(\frac{t}{\tau_E(x)}\right)^{-\frac32}+O(t^{-\frac52}) + . + $$ + + \item If $k<0$ (reflected wave), then there is no pole on the imaginary axis, so there is no contribution as $t\to\infty$. + \item Similarly, the transmitted wave in the initial condition does not contribute. +\end{itemize} +\vfill +\eject + +\title{Laser field} +\begin{itemize} + \item Time dependent potential: + $$ + V_t(x)=\Theta(x)(U-\epsilon\omega\cos(\omega t)x) + $$ + \item Magnetic gauge: + $$ + \Psi(x,t) + :=\psi(x,t)e^{-ix\Theta(x)A(t)} + ,\quad + A(t):=\int_0^t ds\ \epsilon\omega\cos(\omega s) + = + \epsilon\sin(\omega t) + $$ + satisfies + $$ + i\partial_t\Psi(x,t)=\left((-i\nabla+\Theta(x)A(t))^2+\Theta(x)U\right)\Psi(x,t) + $$ +\end{itemize} +\vfill +\eject + +\title{Periodic solution} +\begin{itemize} + \item A solution: + $$ + \Psi(x,t)=\left\{\begin{array}{ll} + \Psi_I(x,t)+\Psi_R(x,t)&\mathrm{\ if\ }x<0\\ + \Psi_T(x,t)&\mathrm{\ if\ }x>0 + \end{array}\right. + $$ + $$ + \Psi_I(x,t)=e^{ikx}\exp\left(-ik^2t\right) + $$ + $$ + \Psi_R(x,t)=\sum_{M\in\mathbb Z}R_Me^{iq_Mx}\exp\left(-iq_M^2t\right) + $$ + $$ + \Psi_T(x,t)=\sum_{M\in\mathbb Z}T_Me^{ip_Mx}\exp\left(-iUt-i\int_0^td\tau\ (p_M+A(\tau))^2\right) + $$ +\end{itemize} +\vfill +\eject + +\title{Periodic solution} +\begin{itemize} + \item Choose $q_M$ and $p_M$ to make the solution periodic (up to the phase $e^{ik^2t}$): + $$ + q_M=\pm\sqrt{k^2+M\omega} + ,\quad + p_M=\pm\sqrt{k^2-U+M\omega-U_V} + $$ + and + $$ + U_V:=\frac\omega{2\pi}\int_0^{\frac{2\pi}\omega} d\tau\ A^2(\tau) + =\frac{\epsilon^2}2 + . + $$ +\end{itemize} + + +\end{document} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ed7b60 --- /dev/null +++ b/Makefile @@ -0,0 +1,50 @@ +PROJECTNAME=$(basename $(wildcard *.tex)) +LIBS=$(notdir $(wildcard libs/*)) +FIGS=$(notdir $(wildcard figs/*.fig)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) +SYNCTEXS=$(addsuffix .synctex.gz, $(PROJECTNAME)) + +all: $(PROJECTNAME) + +$(PROJECTNAME): $(LIBS) $(FIGS) images + pdflatex -file-line-error $@.tex + pdflatex -synctex=1 $@.tex + +$(SYNCTEXS): $(LIBS) $(FIGS) images + pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@) + + +$(LIBS): + ln -fs libs/$@ ./ + + +$(FIGS): + make -C figs/$@ + for pdf in $$(find figs/$@/ -name '*.pdf'); do ln -fs "$$pdf" ./ ; done + +images: + for jpg in figs/*.jpg; do ln -fs "$$jpg" ./ ; done + for png in figs/*.png; do ln -fs "$$png" ./ ; done + + +clean-aux: clean-figs-aux + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + rm -f $(addsuffix .out, $(PROJECTNAME)) + +clean-libs: + rm -f $(LIBS) + +clean-figs: + $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean; ) + rm -f $(notdir $(wildcard figs/*.fig/*.pdf)) + +clean-figs-aux: + $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean-aux; ) + + +clean-tex: + rm -f $(PDFS) $(SYNCTEXS) + +clean: clean-aux clean-tex clean-libs clean-figs diff --git a/README b/README new file mode 100644 index 0000000..a76fdd5 --- /dev/null +++ b/README @@ -0,0 +1,43 @@ +This directory contains the source files to typeset the presentation, and +generate the figures. This can be accomplished by running + make + +An animation was prepared for this talk. It represents the time evolution of +the density and the current. The source files for the animation are located in +the 'figs/animation' directory. To run the animation, run + cd figs/animation + make run +This can take a while the first time it is run. + + +This document uses a custom class file, located in the 'libs' directory, which +defines a number of commands. + + +* Dependencies: + + pdflatex + TeXlive packages: + amsfonts + array + graphics + hyperref + latex + pgf + standalone + GNU make + julia + python3 + gnuplot + +* Files: + + Jauslin_Princeton_2018b.tex: + main LaTeX file + + libs: + custom LaTeX class file + + figs: + source code for the figures + diff --git a/figs/Millikan-Lauritsen_current.png b/figs/Millikan-Lauritsen_current.png new file mode 100644 index 0000000..5645be8 Binary files /dev/null and b/figs/Millikan-Lauritsen_current.png differ diff --git a/figs/animation/FN_base.jl b/figs/animation/FN_base.jl new file mode 100644 index 0000000..af2a1ee --- /dev/null +++ b/figs/animation/FN_base.jl @@ -0,0 +1,170 @@ +# fractional power with an arbitrary branch cut +function pow(x,a,cut) + if(angle(x)/cut<=1) + return(abs(x)^a*exp(1im*angle(x)*a)) + else + return(abs(x)^a*exp(1im*(angle(x)-sign(cut)*2*pi)*a)) + end +end + +# asymptotic airy functions +# specify a branch cut for the fractional power +function airyai_asym(x,cut) + if(abs(real(pow(x,3/2,cut)))=0 + C2=-1im*T/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*((sqrt(V-k0*k0)+pow(-1im*p,1/2,pi/2))/(-1im*p+k0*k0)-2im*E^(-1/3)*pi*quadgk(y -> (pow(-1im*p,1/2,pi/2)*eta(p,0,E,V)-deta(p,0,E,V))*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + FT=2*E^(-1/3)*pi*(quadgk(y -> phi(p,x,E,V)*eta(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2))),0,x)[1]+quadgk(y -> eta(p,x,E,V)*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2))),x,Inf)[1]) + main=C2*phi(p,x,E,V)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2)))+T*FT + + # subtract the contribution of the pole, which will be added back in after the integration + pole=psi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + else + C1=-1im*T*((sqrt(V-k0*k0)*phi(p,0,E,V)+dphi(p,0,E,V))/(-1im*p+k0*k0)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))+E^(-1/3)*quadgk(y -> phi(p,y,E,V)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + FI=-1im*exp(1im*k0*x)/(-1im*p+k0*k0) + FR=-1im*exp(-1im*k0*x)/(-1im*p+k0*k0) + main=C1*exp(pow(-1im*p,1/2,pi/2)*x)+FI+R*FR + + # subtract the contribution of the pole, which will be added back in after the integration + pole=psi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + end +end +# its derivative +function df(p,x,k0,E,V) + T=2im*k0/(1im*k0-sqrt(V-k0*k0)) + R=T-1 + + if x>=0 + C2=-1im*T/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*((sqrt(V-k0*k0)+pow(-1im*p,1/2,pi/2))/(-1im*p+k0*k0)-2im*E^(-1/3)*pi*quadgk(y -> (pow(-1im*p,1/2,pi/2)*eta(p,0,E,V)-deta(p,0,E,V))*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + dFT=2*E^(-1/3)*pi*(quadgk(y -> dphi(p,x,E,V)*eta(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2))),0,x)[1]+quadgk(y -> deta(p,x,E,V)*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2))),x,Inf)[1]) + main=C2*dphi(p,x,E,V)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2)))+T*dFT + + # subtract the contribution of the pole, which will be added back in after the integration + pole=dpsi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + else + C1=-1im*T*((sqrt(V-k0*k0)*phi(p,0,E,V)+dphi(p,0,E,V))/(-1im*p+k0*k0)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))+E^(-1/3)*quadgk(y -> phi(p,y,E,V)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + dFI=k0*exp(1im*k0*x)/(-1im*p+k0*k0) + dFR=-k0*exp(-1im*k0*x)/(-1im*p+k0*k0) + main=C1*pow(-1im*p,1/2,pi/2)*exp(pow(-1im*p,1/2,pi/2)*x)+dFI+R*dFR + + # subtract the contribution of the pole, which will be added back in after the integration + pole=dpsi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + end +end + +# psi (returns t,psi(x,t)) +function psi(x,k0,E,V,p_npoints,p_cutoff) + fft=fourier_fft(f,x,k0,E,V,p_npoints,p_cutoff) + # add the contribution of the pole + for i in 1:p_npoints + fft[2][i]=fft[2][i]+psi_pole(x,k0,E,V)*exp(-1im*k0*k0*fft[1][i]) + end + return(fft) +end +# its derivative +function dpsi(x,k0,E,V,p_npoints,p_cutoff) + fft=fourier_fft(df,x,k0,E,V,p_npoints,p_cutoff) + # add the contribution of the pole + for i in 1:p_npoints + fft[2][i]=fft[2][i]+dpsi_pole(x,k0,E,V)*exp(-1im*k0*k0*fft[1][i]) + end + return(fft) +end + +# compute Fourier transform by sampling and fft +function fourier_fft(A,x,k0,E,V,p_npoints,p_cutoff) + fun=zeros(Complex{Float64},p_npoints) + times=zeros(p_npoints) + + # prepare fft + for i in 1:p_npoints + fun[i]=p_cutoff/pi*A(1im*(-p_cutoff+2*p_cutoff*(i-1)/p_npoints),x,k0,E,V) + times[i]=(i-1)*pi/p_cutoff + end + + ifft!(fun) + + # correct the phase + for i in 2:2:p_npoints + fun[i]=-fun[i] + end + return([times,fun]) +end + +# asymptotic value of psi +function psi_pole(x,k0,E,V) + if x>=0 + return(1im*phi(-1im*k0*k0,x,E,V)*2*k0/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(k0*k0-V),3/2,-pi/2)-E^(-1)*pow(k0*k0-V,3/2,-pi/2)))) + else + return((1im*k0*phi(-1im*k0*k0,0,E,V)-dphi(-1im*k0*k0,0,E,V))/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(-1im*k0*x)+exp(1im*k0*x)) + end +end +function dpsi_pole(x,k0,E,V) + if x>=0 + return(1im*dphi(-1im*k0*k0,x,E,V)*2*k0/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(k0*k0-V),3/2,-pi/2)-E^(-1)*pow(k0*k0-V,3/2,-pi/2)))) + else + return(-1im*k0*(1im*k0*phi(-1im*k0*k0,0,E,V)-dphi(-1im*k0*k0,0,E,V))/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(-1im*k0*x)+1im*k0*exp(1im*k0*x)) + end +end + +# current +function J(ps,dps) + return(2*imag(conj(ps)*dps)) +end + +# complete computation of the current +function current(x,k0,E,V,p_npoints,p_cutoff) + ps=psi(x,k0,E,V,p_npoints,p_cutoff) + dps=dpsi(x,k0,E,V,p_npoints,p_cutoff) + Js=zeros(Complex{Float64},p_npoints) + for i in 1:p_npoints + Js[i]=J(ps[2][i],dps[2][i]) + end + return(Js) +end diff --git a/figs/animation/Makefile b/figs/animation/Makefile new file mode 100644 index 0000000..19696f8 --- /dev/null +++ b/figs/animation/Makefile @@ -0,0 +1,13 @@ +PROJECTNAME=animate + +all: animate.dat + +run: animate.dat + python3 animate.py animate.dat & + python3 animate-positive.py animate.dat & + +animate.dat: + julia animate_compute.jl > animate.dat + +clean: + rm -f animate.dat diff --git a/figs/animation/animate-positive.py b/figs/animation/animate-positive.py new file mode 100644 index 0000000..3a78f66 --- /dev/null +++ b/figs/animation/animate-positive.py @@ -0,0 +1,130 @@ +from matplotlib import pyplot as pl +from matplotlib import animation +import sys + +# read data +# time dependent data +frames=[] +# asymptotic data (located in the first block) +asym=[] +infile=open(sys.argv[1],'r') +row=[] +for line in infile: + # read first block + if len(asym)==0: + if line=='\n': + asym=row + row=[] + else: + dat=[] + for n in line.split(): + dat.append(float(n)) + if(dat[0]>0): + row.append(dat) + # read other blocks + else: + if line=='\n': + frames.append(row) + row=[] + else: + dat=[] + for n in line.split(): + dat.append(float(n)) + if(dat[1]>0): + row.append(dat) +infile.close() + + +# set up plot +fig = pl.figure() +pl.subplot(211) +axr=fig.gca() +asym_rho, = axr.plot([],[],linewidth=3.5,color='#00FF00') +rho, = axr.plot([],[],color='red') + +pl.subplot(212) +axJ=fig.gca() +asym_J, = axJ.plot([],[],linewidth=3.5,color='#00FF00') +J, = axJ.plot([],[],color='red') + +# plot ranges +xmax=0 +maxyr=0 +maxyJ=0 +for frame in frames: + for i in range(len(frame)): + if frame[i][1]>xmax: + xmax=frame[i][1] + if frame[i][2]>maxyr: + maxyr=frame[i][2] + if frame[i][3]>maxyJ: + maxyJ=frame[i][3] +for i in range(len(asym)): + if asym[i][0]>xmax: + xmax=asym[i][0] + if asym[i][1]>maxyr: + maxyr=asym[i][1] + if asym[i][2]>maxyJ: + maxyJ=asym[i][2] +xmin=0 +minyr=0 +minyJ=0 +for frame in frames: + for i in range(len(frame)): + if frame[i][1]xmax: + xmax=frame[i][1] + if frame[i][2]>maxyr: + maxyr=frame[i][2] + if frame[i][3]>maxyJ: + maxyJ=frame[i][3] +for i in range(len(asym)): + if asym[i][0]>xmax: + xmax=asym[i][0] + if asym[i][1]>maxyr: + maxyr=asym[i][1] + if asym[i][2]>maxyJ: + maxyJ=asym[i][2] +xmin=0 +minyr=0 +minyJ=0 +for frame in frames: + for i in range(len(frame)): + if frame[i][1] poles.tikz.tex + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +$(LIBS): + ln -fs libs/$@ ./ + +clean-libs: + rm -f $(LIBS) + +clean-aux: + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + rm -f poles.tikz.tex + +clean-tex: + rm -f $(PDFS) + +clean: clean-libs clean-aux clean-tex diff --git a/figs/contour.fig/contour.py b/figs/contour.fig/contour.py new file mode 100644 index 0000000..102df86 --- /dev/null +++ b/figs/contour.fig/contour.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 + +import cmath +import math +import scipy.special as sp +from scipy import optimize as op +import random +import sys + +# number of roots +nr_roots=4 + +# size of plot +plotsize_x=3 +plotsize_y=3 +# rescale plot (so roots are not too close together) +plotsize_scale_x=1 +plotsize_scale_y=6 + +# numerical values +hbar=6.58e-16 # eV.s +m=9.11e-31 # kg +Vn=9 # eV +En=20e9 # V/m + +V=1 +E=En*hbar/(Vn**1.5*m**0.5)*math.sqrt(1.60e-19) + +# sqrt with branch cut along iR_+ +def sqrt_p(x): + r,p=cmath.polar(x) + if(pplotsize_y): + return(False) + for x in roots: + if(abs(root-x)<1e-12): + return(False) + return(True) + +# find roots +roots=[] +while len(roots)=0 + C2=-1im*T/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*((sqrt(V-k0*k0)+pow(-1im*p,1/2,pi/2))/(-1im*p+k0*k0)-2im*E^(-1/3)*pi*quadgk(y -> (pow(-1im*p,1/2,pi/2)*eta(p,0,E,V)-deta(p,0,E,V))*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + FT=2*E^(-1/3)*pi*(quadgk(y -> phi(p,x,E,V)*eta(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2))),0,x)[1]+quadgk(y -> eta(p,x,E,V)*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2))),x,Inf)[1]) + main=C2*phi(p,x,E,V)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2)))+T*FT + + # subtract the contribution of the pole, which will be added back in after the integration + pole=psi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + else + C1=-1im*T*((sqrt(V-k0*k0)*phi(p,0,E,V)+dphi(p,0,E,V))/(-1im*p+k0*k0)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))+E^(-1/3)*quadgk(y -> phi(p,y,E,V)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + FI=-1im*exp(1im*k0*x)/(-1im*p+k0*k0) + FR=-1im*exp(-1im*k0*x)/(-1im*p+k0*k0) + main=C1*exp(pow(-1im*p,1/2,pi/2)*x)+FI+R*FR + + # subtract the contribution of the pole, which will be added back in after the integration + pole=psi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + end +end +# its derivative +function df(p,x,k0,E,V) + T=2im*k0/(1im*k0-sqrt(V-k0*k0)) + R=T-1 + + if x>=0 + C2=-1im*T/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*((sqrt(V-k0*k0)+pow(-1im*p,1/2,pi/2))/(-1im*p+k0*k0)-2im*E^(-1/3)*pi*quadgk(y -> (pow(-1im*p,1/2,pi/2)*eta(p,0,E,V)-deta(p,0,E,V))*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + dFT=2*E^(-1/3)*pi*(quadgk(y -> dphi(p,x,E,V)*eta(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2))),0,x)[1]+quadgk(y -> deta(p,x,E,V)*phi(p,y,E,V)*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2))),x,Inf)[1]) + main=C2*dphi(p,x,E,V)*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2)))+T*dFT + + # subtract the contribution of the pole, which will be added back in after the integration + pole=dpsi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + else + C1=-1im*T*((sqrt(V-k0*k0)*phi(p,0,E,V)+dphi(p,0,E,V))/(-1im*p+k0*k0)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))+E^(-1/3)*quadgk(y -> phi(p,y,E,V)/(pow(-1im*p,1/2,pi/2)*phi(p,0,E,V)-dphi(p,0,E,V))*exp(-sqrt(V-k0*k0)*y)*exp(2im/3*(pow(E^(1/3)*y+E^(-2/3)*(1im*p-V),3/2,-pi/2)-E^(-1)*pow(1im*p-V,3/2,-pi/2))),0,Inf)[1]) + dFI=k0*exp(1im*k0*x)/(-1im*p+k0*k0) + dFR=-k0*exp(-1im*k0*x)/(-1im*p+k0*k0) + main=C1*pow(-1im*p,1/2,pi/2)*exp(pow(-1im*p,1/2,pi/2)*x)+dFI+R*dFR + + # subtract the contribution of the pole, which will be added back in after the integration + pole=dpsi_pole(x,k0,E,V)/(p+1im*k0*k0) + return(main-pole) + end +end + +# psi (returns t,psi(x,t)) +function psi(x,k0,E,V,p_npoints,p_cutoff) + fft=fourier_fft(f,x,k0,E,V,p_npoints,p_cutoff) + # add the contribution of the pole + for i in 1:p_npoints + fft[2][i]=fft[2][i]+psi_pole(x,k0,E,V)*exp(-1im*k0*k0*fft[1][i]) + end + return(fft) +end +# its derivative +function dpsi(x,k0,E,V,p_npoints,p_cutoff) + fft=fourier_fft(df,x,k0,E,V,p_npoints,p_cutoff) + # add the contribution of the pole + for i in 1:p_npoints + fft[2][i]=fft[2][i]+dpsi_pole(x,k0,E,V)*exp(-1im*k0*k0*fft[1][i]) + end + return(fft) +end + +# compute Fourier transform by sampling and fft +function fourier_fft(A,x,k0,E,V,p_npoints,p_cutoff) + fun=zeros(Complex{Float64},p_npoints) + times=zeros(p_npoints) + + # prepare fft + for i in 1:p_npoints + fun[i]=p_cutoff/pi*A(1im*(-p_cutoff+2*p_cutoff*(i-1)/p_npoints),x,k0,E,V) + times[i]=(i-1)*pi/p_cutoff + end + + ifft!(fun) + + # correct the phase + for i in 2:2:p_npoints + fun[i]=-fun[i] + end + return([times,fun]) +end + +# asymptotic value of psi +function psi_pole(x,k0,E,V) + if x>=0 + return(1im*phi(-1im*k0*k0,x,E,V)*2*k0/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(k0*k0-V),3/2,-pi/2)-E^(-1)*pow(k0*k0-V,3/2,-pi/2)))) + else + return((1im*k0*phi(-1im*k0*k0,0,E,V)-dphi(-1im*k0*k0,0,E,V))/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(-1im*k0*x)+exp(1im*k0*x)) + end +end +function dpsi_pole(x,k0,E,V) + if x>=0 + return(1im*dphi(-1im*k0*k0,x,E,V)*2*k0/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(2im/3*(pow(E^(1/3)*x+E^(-2/3)*(k0*k0-V),3/2,-pi/2)-E^(-1)*pow(k0*k0-V,3/2,-pi/2)))) + else + return(-1im*k0*(1im*k0*phi(-1im*k0*k0,0,E,V)-dphi(-1im*k0*k0,0,E,V))/(1im*k0*phi(-1im*k0*k0,0,E,V)+dphi(-1im*k0*k0,0,E,V))*exp(-1im*k0*x)+1im*k0*exp(1im*k0*x)) + end +end + +# current +function J(ps,dps) + return(2*imag(conj(ps)*dps)) +end + +# complete computation of the current +function current(x,k0,E,V,p_npoints,p_cutoff) + ps=psi(x,k0,E,V,p_npoints,p_cutoff) + dps=dpsi(x,k0,E,V,p_npoints,p_cutoff) + Js=zeros(Complex{Float64},p_npoints) + for i in 1:p_npoints + Js[i]=J(ps[2][i],dps[2][i]) + end + return(Js) +end diff --git a/figs/fowler-nordheim.fig/Makefile b/figs/fowler-nordheim.fig/Makefile new file mode 100644 index 0000000..a6e5e53 --- /dev/null +++ b/figs/fowler-nordheim.fig/Makefile @@ -0,0 +1,29 @@ +PROJECTNAME=asymptotic + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) +TEXS=$(addsuffix .tikz.tex, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(addsuffix .dat, $(PROJECTNAME)) + gnuplot $(patsubst %.pdf, %.gnuplot, $@) > $(patsubst %.pdf, %.tikz.tex, $@) + pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@) + +asymptotic.dat: + julia asymptotic.jl > asymptotic.dat + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +clean-aux: + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + +clean-dat: + rm -f $(addsuffix .tikz.tex, $(PROJECTNAME)) + rm -f short-time.dat + +clean-tex: + rm -f $(PDFS) + +clean: clean-dat clean-aux clean-tex diff --git a/figs/fowler-nordheim.fig/asymptotic.gnuplot b/figs/fowler-nordheim.fig/asymptotic.gnuplot new file mode 100644 index 0000000..3296380 --- /dev/null +++ b/figs/fowler-nordheim.fig/asymptotic.gnuplot @@ -0,0 +1,59 @@ +datafile="asymptotic.dat" + +## can also set the following options +#set title "" +set ylabel "$|\\psi_{\\mathrm{FN}}|^2$" tc ls 1 #norotate +set y2label "$J_{\\mathrm{FN}}$" tc ls 2 #norotate +set xlabel "$x$" +# +#set xrange[:] +#set yrange [:] +set y2range [0:0.004] +# +## start ticks at 0, then every x +#set xtics 0,x +#set ytics 0,x +## puts 4 minor tics between tics (5 intervals, i.e. every 0.01) +set mxtics 5 +set mytics 5 +set my2tics 5 + +# default output canvas size: 12.5cm x 8.75cm +set term lua tikz size 12.5,8.75 standalone +# run +## gnuplot gnuplots && gnuplot_tikz out/latext/minimizer.tex + +set key off + +# 3=1+2 draw bottom and left sides of the box +#set border 3 +# don't show tics on opposite sides +set xtics nomirror +set ytics nomirror tc ls 1 +set y2tics nomirror tc ls 2 + +# Mathematica colors: +## 3f3d99 (dark blue) +## 9c4275 (dark pink) +## 9a8d3f (dark yellow) +## 3d9956 (dark green) +# My colors +## 4169E1 (pastel blue) +## DC143C (bright red) +## 32CD32 (bright green) +## 4B0082 (deep purple) +## DAA520 (ochre) + +# set linestyle +set style line 1 linetype rgbcolor "#4169E1" linewidth 3 +set style line 2 linetype rgbcolor "#DC143C" linewidth 3 +set style line 3 linetype rgbcolor "#32CD32" linewidth 3 +set style line 4 linetype rgbcolor "#4B0082" linewidth 3 +set style line 5 linetype rgbcolor "#DAA520" linewidth 3 + +set pointsize 0.6 + +set arrow to 0, graph 1 nohead lt 0 + +plot datafile using 1:2 with lines linestyle 1 ,\ + datafile using 1:3 with lines linestyle 2 axes x1y2 diff --git a/figs/fowler-nordheim.fig/asymptotic.jl b/figs/fowler-nordheim.fig/asymptotic.jl new file mode 100644 index 0000000..fd1d492 --- /dev/null +++ b/figs/fowler-nordheim.fig/asymptotic.jl @@ -0,0 +1,46 @@ +using QuadGK +using SpecialFunctions +using FFTW + +# numerical values +hbar=6.58e-16 # eV.s +m=9.11e-31 # kg +Vn=9 # eV +En=14e9 # V/m +Kn=4.5 # eV + +V=1 +E=En*hbar/(2*Vn^1.5*m^0.5)*sqrt(1.60e-19) +k0=sqrt(Kn/Vn) + +# rescale x to nm +nm_scale=sqrt(2*m*Vn)/hbar*1e9*sqrt(1.60e-19) + +# cutoffs +p_cutoff=20*k0 +p_npoints=256 + +# airy approximations +airy_threshold=30 +airy_order=5 + +# xbounds +xmax=10 +xmin=-10 +x_npoints=200 + +include("FN_base.jl") + +# compute asymptotic values +ps_asym=Array{Complex{Float64}}(undef,x_npoints) +dps_asym=Array{Complex{Float64}}(undef,x_npoints) +for i in 1:x_npoints + x=xmin+(xmax-xmin)*i/x_npoints + ps_asym[i]=psi_pole(x,k0,E,V) + dps_asym[i]=dpsi_pole(x,k0,E,V) +end + +# print asymptotic values +for i in 1:x_npoints + print((xmin+(xmax-xmin)*i/x_npoints)*nm_scale,' ',abs(ps_asym[i])^2,' ',J(ps_asym[i],dps_asym[i]),'\n') +end diff --git a/figs/libs/Makefile b/figs/libs/Makefile new file mode 100644 index 0000000..33b81e2 --- /dev/null +++ b/figs/libs/Makefile @@ -0,0 +1,28 @@ +PROJECTNAME=$(basename $(basename $(wildcard *.tikz.tex))) +LIBS=$(notdir $(wildcard libs/*)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(LIBS) + echo $(LIBS) + pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@) + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +$(LIBS): + ln -fs libs/$@ ./ + +clean-libs: + rm -f $(LIBS) + +clean-aux: + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + +clean-tex: + rm -f $(PDFS) + +clean: clean-libs clean-aux clean-tex diff --git a/figs/potential.fig/Makefile b/figs/potential.fig/Makefile new file mode 120000 index 0000000..704310e --- /dev/null +++ b/figs/potential.fig/Makefile @@ -0,0 +1 @@ +../libs/Makefile \ No newline at end of file diff --git a/figs/potential.fig/potential.tikz.tex b/figs/potential.fig/potential.tikz.tex new file mode 100644 index 0000000..ac1ba36 --- /dev/null +++ b/figs/potential.fig/potential.tikz.tex @@ -0,0 +1,17 @@ +\documentclass{standalone} + +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + +\draw(-3,0)--(3,0); +\draw(0,-1.5)--(0,3); + +\draw[color=gray,line width=1pt, densely dotted](-2.5,1.25)--++(2.5,0); + +\draw[line width=1.5pt](-2.5,0)--(0,0)--(0,2.5)--(1.975,-1.25); + +\end{tikzpicture} +\end{document} + diff --git a/figs/potential.fig/potential_square.tikz.tex b/figs/potential.fig/potential_square.tikz.tex new file mode 100644 index 0000000..bd13467 --- /dev/null +++ b/figs/potential.fig/potential_square.tikz.tex @@ -0,0 +1,17 @@ +\documentclass{standalone} + +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + +\draw(-3,0)--(3,0); +\draw(0,-1.5)--(0,3); + +\draw[color=gray,line width=1pt, densely dotted](-2.5,1.25)--++(2.5,0); + +\draw[line width=1.5pt](-2.5,0)--(0,0)--(0,2.5)--(2.5,2.5); + +\end{tikzpicture} +\end{document} + diff --git a/figs/potential.fig/potential_square_photonic.tikz.tex b/figs/potential.fig/potential_square_photonic.tikz.tex new file mode 100644 index 0000000..8a35fb4 --- /dev/null +++ b/figs/potential.fig/potential_square_photonic.tikz.tex @@ -0,0 +1,22 @@ +\documentclass{standalone} + +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + +\draw(-3,0)--(3,0); +\draw(0,-1.5)--(0,3); + +\draw[color=gray,line width=1pt, densely dotted](-2.5,1.25)--++(2.5,0); +\draw[color=gray,line width=1pt, densely dotted](-1,2.00)--++(1,0); +\draw[color=gray,line width=1pt, densely dotted](-1,2.75)--++(3.5,0); + +\draw[->,line width=0.75pt,color=red](-0.5,1.25)--++(0,0.75); +\draw[->,line width=0.75pt,color=red](-0.5,2.00)--++(0,0.75); + +\draw[line width=1.5pt](-2.5,0)--(0,0)--(0,2.5)--(2.5,2.5); + +\end{tikzpicture} +\end{document} + diff --git a/figs/potential.fig/potential_square_thermal.tikz.tex b/figs/potential.fig/potential_square_thermal.tikz.tex new file mode 100644 index 0000000..3e8fd22 --- /dev/null +++ b/figs/potential.fig/potential_square_thermal.tikz.tex @@ -0,0 +1,17 @@ +\documentclass{standalone} + +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + +\draw(-3,0)--(3,0); +\draw(0,-1.5)--(0,3); + +\draw[color=gray,line width=1pt, densely dotted](-2.5,2.75)--++(5,0); + +\draw[line width=1.5pt](-2.5,0)--(0,0)--(0,2.5)--(2.5,2.5); + +\end{tikzpicture} +\end{document} + diff --git a/libs/ian-presentation.cls b/libs/ian-presentation.cls new file mode 100644 index 0000000..91bd487 --- /dev/null +++ b/libs/ian-presentation.cls @@ -0,0 +1,187 @@ +%% +%% Ian's presentation class +%% + +%% TeX format +\NeedsTeXFormat{LaTeX2e}[1995/12/01] + +%% class name +\ProvidesClass{ian-presentation}[2017/09/29] + +\def\ian@defaultoptions{ + \pagestyle{plain} + \RequirePackage{color} + \RequirePackage{amssymb} +} + +%% paper dimensions +\setlength\paperheight{240pt} +\setlength\paperwidth{427pt} + +%% fonts +\input{size11.clo} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} + +%% text dimensions +\textheight=208pt +\textwidth=370pt +\hoffset=-1in +\voffset=-1in +\oddsidemargin=24pt +\evensidemargin=24pt +\topmargin=8pt +\headheight=0pt +\headsep=0pt +\marginparsep=0pt +\marginparwidth=0pt +\footskip=16pt + + +%% remove default skips +\parindent=0pt +\parskip=0pt +\baselineskip=0pt + +%% something is wrong with \thepage, redefine it +\gdef\thepage{\the\c@page} + +%% correct vertical alignment at the end of a document +\AtEndDocument{ + % save total slide count + \immediate\write\@auxout{\noexpand\gdef\noexpand\slidecount{\thepage}} + \vfill + \eject +} + + +%% footer +\def\ps@plain{ + \def\@oddhead{} + \def\@evenhead{\@oddhead} + \def\@oddfoot{\tiny\hfill\thepage/\safe\slidecount\hfill} + \def\@evenfoot{\@oddfoot} +} +\def\ps@empty{ + \def\@oddhead{} + \def\@evenhead{\@oddhead} + \def\@oddfoot{} + \def\@evenfoot{\@oddfoot} +} + + +%% title of slide +\def\title#1{ + \hfil{\bf\large #1}\par + \hfil\vrule width0.75\textwidth height0.3pt\par + \vskip5pt +} + + +%% hyperlinks +% hyperlinkcounter +\newcounter{lncount} +% hyperref anchor +\def\hrefanchor{% +\stepcounter{lncount}% +\hypertarget{ln.\thelncount}{}% +} + +%% define a command and write it to aux file +\def\outdef#1#2{% + % define command% + \expandafter\xdef\csname #1\endcsname{#2}% + % hyperlink number% + \expandafter\xdef\csname #1@hl\endcsname{\thelncount}% + % write command to aux% + \immediate\write\@auxout{\noexpand\expandafter\noexpand\gdef\noexpand\csname #1\endcsname{\csname #1\endcsname}}% + \immediate\write\@auxout{\noexpand\expandafter\noexpand\gdef\noexpand\csname #1@hl\endcsname{\thelncount}}% +} + +%% can call commands even when they are not defined +\def\safe#1{% + \ifdefined#1% + #1% + \else% + {\color{red}\bf?}% + \fi% +} + + +%% itemize +\newlength\itemizeskip +% left margin for items +\setlength\itemizeskip{20pt} +\newlength\itemizeseparator +% space between the item symbol and the text +\setlength\itemizeseparator{5pt} +% penalty preceding an itemize +\def\itemizepenalty{0} +% counter counting the itemize level +\newcounter{itemizecount} + +% item symbol +\def\itemizept#1{ + \ifnum#1=1 + \textbullet + \else + $\scriptstyle\blacktriangleright$ + \fi +} + +\newlength\current@itemizeskip +\setlength\current@itemizeskip{0pt} +\def\itemize{ + \par\penalty\itemizepenalty\medskip\penalty\itemizepenalty + \addtocounter{itemizecount}{1} + \addtolength\current@itemizeskip{\itemizeskip} + \leftskip\current@itemizeskip +} +\def\enditemize{ + \addtocounter{itemizecount}{-1} + \addtolength\current@itemizeskip{-\itemizeskip} + \par\leftskip\current@itemizeskip + \medskip +} +\newlength\itempt@total +\def\item{ + \settowidth\itempt@total{\itemizept\theitemizecount} + \addtolength\itempt@total{\itemizeseparator} + \par + \medskip + \hskip-\itempt@total\itemizept\theitemizecount\hskip\itemizeseparator +} + +%% enumerate +\newcounter{enumerate@count} +\def\enumerate{ + \setcounter{enumerate@count}0 + \let\olditem\item + \let\olditemizept\itemizept + \def\item{ + % counter + \stepcounter{enumerate@count} + % set header + \def\itemizept{\theenumerate@count.} + % hyperref anchor + \hrefanchor + % define tag (for \label) + \xdef\tag{\theenumerate@count} + \olditem + } + \itemize +} +\def\endenumerate{ + \enditemize + \let\item\olditem + \let\itemizept\olditemizept +} + + +%% end +\ian@defaultoptions + +\endinput -- cgit v1.2.3-54-g00ecf