(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 9293, 258]*) (*NotebookOutlinePosition[ 10020, 283]*) (* CellTagsIndexPosition[ 9976, 279]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Quantum Scattering in 1D ", "Title", TextAlignment->Center, FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell["\<\ Mads Brandbyge, mbr@mic.dtu.dk Mikroelectronik Centret (MIC) Danish Technical University, Build. 345 east DK-2800 Lyngby, DENMARK\ \>", "Subsubtitle", TextAlignment->Center, FontColor->RGBColor[0, 0, 1]], Cell[CellGroupData[{ Cell["Some unimportant stuff - just run it once", "Section", InitializationCell->True], Cell[BoxData[{ \(Off[Inverse::"\"]; Off[PseudoInverse::"\"];\), "\[IndentingNewLine]", \(\(<< Graphics`FilledPlot`;\)\), "\[IndentingNewLine]", \(\(<< Graphics`Animation`;\)\)}], "Input", InitializationCell->True] }, Closed]] }, Closed]], Cell["Instruction:", "Section"], Cell["\<\ You do the following: [(0) Aswer \"Yes\" to initialize initial cells when asked in the beginning.] (1) First build your potential landscape by writing a list of potential jumps \ as shown below. (2) Then plot the potential. (4) Evaluate \"Calculate\" and see the Transmission function. (5) Plot the scattering wavefunction at a certain energy, see the animation. (6) Change energy, change potential, play! \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ StyleBox[\(Define\ the\ potential\ in\ terms\ of\ "jumps" : \ \ {x\_\(\(jump\)\(\ \)\), \ V\_jump}\), "Subsubsection"]], "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[CellGroupData[{ Cell["\<\ Define the part of the x-axis we want to consider: From L1 to L2\ \>", "Subsubsection"], Cell[BoxData[ \(L1 = \(-5\); L2 = 15;\)], "Input"] }, Open ]], Cell[BoxData[ \(potdiskont = {{0. , 1. }, {2, 0.1}, {4. , 1. }, {6, 0.1}, {8, 1. }, {10, 0. }}\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Plot the potential", "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[BoxData[ \(Clear[x]; rules = \({x > #[\([1]\)], #[\([2]\)]} &\) /@ Reverse[potdiskont]; rules = \ Append[rules, {1 \[Equal] 1, 0. }]; pot[x_] = Apply[Which[##] &, Flatten[rules]]; potplot = FilledPlot[pot[x], {x, L1, L2}, PlotPoints \[Rule] 50, AxesLabel \[Rule] {"\", "\"}, Fills \[Rule] {{{1, Axis}, GrayLevel[ .8]}}]\)], "Input"] }, Closed]], Cell[BoxData[ \(Show[potplot]\)], "Input"], Cell[CellGroupData[{ Cell["Calculate", "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[BoxData[{ \(LocE[en_] = Table[\ If[ i \[Equal] 0, \((en)\), \((en - potdiskont[\([i, 2]\)])\)], {i, 0, Length[potdiskont]}]; K[en_] := Sqrt[2*LocE[en]] // N; d[k1_, k2_, x_] = .5* DiagonalMatrix[{Exp[\(-I\)*k1*x], Exp[I*k1*x]}] . \[IndentingNewLine]{{1 + \((k2/k1)\), 1 - \((k2/k1)\)}, {1 - \((k2/k1)\), 1 + \((k2/k1)\)}} . \[IndentingNewLine]DiagonalMatrix[{Exp[ I*k2*x], Exp[\(-I\)*k2* x]}];\[IndentingNewLine]\), "\[IndentingNewLine]", \(Clear[TM]; Clear[TMList]; Clear[x];\[IndentingNewLine]\), "\n", \(\(getit[en_] := Module[{TM, TMList, xLst, solution, B, F, CoeffList, FPList, r, t, R, T, PsiIn, Psi}, \[IndentingNewLine]TM = IdentityMatrix[2]; \n TMList = {TM}; \n TM = d[\ \ \(K[en]\)[\([1]\)], \(K[en]\)[\([2]\)], potdiskont[\([1, 1]\)]\ \ \ ] // N; \nAppendTo[TMList, TM]; \n For[i = 1, i < Length[potdiskont], \(i++\), \[IndentingNewLine]TM = TM . d[\(K[en]\)[\([i + 1]\)], \(K[en]\)[\([i + 2]\)], \ potdiskont[\([i + 1, 1]\)]\ \ ] // N; \[IndentingNewLine]AppendTo[TMList, TM];\[IndentingNewLine]]; \[IndentingNewLine]Clear[xLst]; xLst = \(Transpose[potdiskont]\)[\([1]\)]; \nClear[B]; Clear[F]; solution = Solve[TM . {F, 0} \[Equal] {1, B}, {F, B}] // Flatten; \ B = B /. solution; \n invTMList = \(PseudoInverse[#] &\) /@ TMList; \n CoeffList = Table[Inverse[TMList[\([i]\)]] . {1, B}, {i, Length[TMList]}]; \n FPList = Table[{\ Exp[\ \ \ I*\((x*\(K[en]\)[\([i]\)])\)\ \ \ ]* If[i \[Equal] 1, 0, 1], \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Exp[\ \(-I\)*\((x*\(K[en]\)[\([i]\)]\ )\)\ \ ]} . CoeffList[\([i]\)], {i, 1, Length[K[en]]}] // N; \n\[IndentingNewLine]rules = \({x < \ #[\([1]\)], \ #[\([2]\)]} &\) /@ Transpose[\ {Append[xLst, 10000], FPList}]; \[IndentingNewLine]\[IndentingNewLine]PsiIn[x_] = If[x < xLst[\([1]\)], Exp[I*\((x\ *\(K[en]\)[\([1]\)])\)], 0. ]; \[IndentingNewLine]Psi[x_] = Apply[Which[##] &, Flatten[rules, 1]]; \[IndentingNewLine]\[IndentingNewLine]r = B /. solution; \ t = F /. solution; \nR = r*Conjugate[r] // Re; \n T = t*Conjugate[t]*Re[\(K[en]\)[\([\(-1\)]\)]/\(K[en]\)[\([1]\)]] // Re; \[IndentingNewLine]Return[{R, T, PsiIn[x], Psi[x]}];\[IndentingNewLine]\[IndentingNewLine]];\)\), "\ \[IndentingNewLine]", \(R[en_] := \(getit[en]\)[\([1]\)]; T[en_] := \(getit[en]\)[\([2]\)]; PsiIn[x] := \(getit[en]\)[\([3]\)]; Psi[x] := \(getit[en]\)[\([4]\)];\), "\[IndentingNewLine]", \(\(Tplot = Plot[T[en], {en, 0, 1.5}, PlotRange \[Rule] All, PlotStyle \[Rule] {{RGBColor[0, 0, 0], Thickness[0.01]}, {RGBColor[0, 0, 1], Thickness[0.01]}}, AxesLabel \[Rule] {"\", "\"}, DefaultFont \[Rule] {"\", 14}];\)\[IndentingNewLine]\[IndentingNewLine]\[IndentingNewLine]\ \), "\[IndentingNewLine]", \(\)}], "Input"] }, Closed]], Cell["Plot Transmission and Reflection for the potential", "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[BoxData[ \(Show[Tplot, PlotRange \[Rule] {{0.3, 1.2}, All}]\)], "Input"], Cell["Plot the wavefunction (time dependent) for a certain energy:", "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[BoxData[ \(\(energy = 0.503;\)\)], "Input"], Cell["\<\ Animation: After you have generated a time series select all images (outer \ tag) and press CLTR-Y for animation\ \>", "Subsubtitle"], Cell[CellGroupData[{ Cell["Plot generation: The incoming wave is blue.", "Section", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[BoxData[{ \(Clear[PP]; Clear[PPin];\), "\[IndentingNewLine]", \(PP[x_, t_] = 0.15*Re[\(getit[energy]\)[\([4]\)]*Exp[\(-I\)*2 Pi*t]]; PPin[x_, t_] = 0.15*Re[\(getit[energy]\)[\([3]\)]* Exp[\(-I\)*2 Pi*t]];\), "\[IndentingNewLine]", \(tmpplot = Table[FilledPlot[{pot[x], PP[x, t] + energy, PPin[x, t] + energy, energy}, {x, L1, L2}, PlotRange \[Rule] {\(-0.5\), 1.5}, PlotPoints \[Rule] 50, AxesLabel \[Rule] {"\", None}, Ticks \[Rule] {Automatic, None}, Fills \[Rule] {{{1, Axis}, GrayLevel[ .8]}}, Curves \[Rule] Front, PlotStyle \[Rule] {Thickness[0.012], RGBColor[1, 0, 0], RGBColor[0, 0, 1], Thickness[0.005]}], {t, 0, 1.9, .1}]\)}], "Input", AnimationDisplayTime->0.13, AnimationCycleOffset->1, AnimationCycleRepetitions->Infinity] }, Closed]], Cell[BoxData[ \(ShowAnimation[tmpplot]\)], "Input"] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, AutoGeneratedPackage->Automatic, WindowToolbars->"EditBar", CellGrouping->Manual, WindowSize->{846, 607}, WindowMargins->{{55, Automatic}, {14, Automatic}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1727, 52, 127, 3, 131, "Title"], Cell[1857, 57, 220, 8, 125, "Subsubtitle"], Cell[CellGroupData[{ Cell[2102, 69, 88, 1, 59, "Section", InitializationCell->True], Cell[2193, 72, 248, 5, 70, "Input", InitializationCell->True] }, Closed]] }, Closed]], Cell[2468, 81, 31, 0, 39, "Section"], Cell[2502, 83, 432, 10, 166, "Text"], Cell[CellGroupData[{ Cell[2959, 97, 215, 5, 70, "Section"], Cell[CellGroupData[{ Cell[3199, 106, 97, 2, 43, "Subsubsection"], Cell[3299, 110, 54, 1, 30, "Input"] }, Open ]], Cell[3368, 114, 122, 2, 30, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3527, 121, 97, 2, 75, "Section"], Cell[3627, 125, 397, 8, 90, "Input"] }, Closed]], Cell[4039, 136, 46, 1, 27, "Input"], Cell[CellGroupData[{ Cell[4110, 141, 88, 2, 75, "Section"], Cell[4201, 145, 3416, 62, 890, "Input"] }, Closed]], Cell[7632, 210, 129, 2, 55, "Section"], Cell[7764, 214, 81, 1, 30, "Input"], Cell[7848, 217, 139, 2, 75, "Section"], Cell[7990, 221, 52, 1, 30, "Input"], Cell[8045, 224, 143, 3, 53, "Subsubtitle"], Cell[CellGroupData[{ Cell[8213, 231, 122, 2, 75, "Section"], Cell[8338, 235, 881, 17, 150, "Input"] }, Closed]], Cell[9234, 255, 55, 1, 27, "Input"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)