(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' 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[ 26973, 903]*) (*NotebookOutlinePosition[ 27981, 937]*) (* CellTagsIndexPosition[ 27851, 930]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["The package VQM`ArgColorPlot", "Title"], Cell["\<\ Bernd Thaller Institute of Mathematics University of Graz Austria 04-10-2004\ \>", "Subsubtitle"], Cell[CellGroupData[{ Cell["Abstract", "Subsection"], Cell[TextData[{ "The package VQM`ArgColorPlot provides methods to visualize complex-valued \ functions of one real variable. This package is part of the VQM packages \ which can be obtained here: ", ButtonBox["http://www.uni-graz.at/imawww/vqm/software.html", ButtonData:>{ URL[ "http://www.uni-graz.at/imawww/vqm/software.html"], None}, ButtonStyle->"Hyperlink"], " (free download). The VQM packages are part of the Visual Quantum \ Mechanics project, see ", ButtonBox["http://www.uni-graz.at/imawww/vqm/", ButtonData:>{ URL[ "http://www.uni-graz.at/imawww/vqm/"], None}, ButtonStyle->"Hyperlink"], ". In particular, these packages are distributed with the book ", StyleBox["Advanced Visual Quantum Mechanics", FontSlant->"Italic"], ", Springer-Verlag New York, 2004." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Introduction and implementation", "Section"], Cell["\<\ Here we describe theoretical background and the practical \ implementation of the main function in the package VQM`ArgColorPlot`.\ \>", \ "Text"], Cell[CellGroupData[{ Cell["FilledPlot", "Subsection"], Cell[TextData[{ "Special packages enhance the capabilities of ", StyleBox["Mathematica", FontSlant->"Italic"], ". For example, the package Graphics`FilledPlot` allows to plot a function \ such that the space between the graph of the function and the horizontal axis \ is filled with a color" }], "Text", FontFamily->"Times"], Cell["<All]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ In that way one can produce neat looking graphs. See the package \ documentation for details.\ \>", "Text", FontFamily->"Times"], Cell[CellGroupData[{ Cell["\<\ FilledPlot[{x^2/18, Cos[x], Sin[x]}, {x, 0, 2 Pi}, Fills -> {{{1, Axis}, GrayLevel[.7]}, {{2, 3}, GrayLevel[.3]}}, Curves -> Front]\ \>", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[TextData[StyleBox[ "Again, it is only possible to print real-valued functions.", FontSlant->"Plain"]], "Text", FontFamily->"Times", FontSlant->"Italic"] }, Open ]], Cell[CellGroupData[{ Cell["Filling with an x-dependent color", "Subsection"], Cell[TextData[ "In order to visualize a complex-valued function f[x] of one real variable, \ we use the following idea. We plot the curve Abs[f[x]] and fill the space \ between the curve and the horizontal axis with a color determined by \ Arg[f[x]]. Since the argument of a complex number is a real number modulo 2\ \[Pi], it appears natural to choose Hue[Arg[f[x]]/(2\[Pi])]."], "Text", FontFamily->"Times"], Cell[TextData[{ "Unfortunately, there is no built-in ", StyleBox["Mathematica", FontSlant->"Italic"], " routine for performing this task. The command FilledPlot does not allow \ to fill the space between the curve and the x-axis with a color that depends \ on x. Therefore we have to define an appropriate command by ourselves." }], "Text"], Cell["In order to be specific, we define a sample function", "Text"], Cell["f[x_] := Exp[-x^2 + 2 I x]", "Input"], Cell["\<\ We proceed as follows. First, we define a set of positions on the \ x-axis and calculate a table of function values at these positions.\ \>", "Text"], Cell["xvalues = Table[x,{x,-3.,3.,.1}];", "Input"], Cell[TextData[{ "(The semicolon serves to suppress the lengthy output). Observe that the \ boundary values and the increment are given as real numbers. This guarantees \ that all generated values are real numbers. and when we calculate the value \ of f for one of these x-values, then ", StyleBox["Mathematica", FontSlant->"Italic"], " will return a numeric expression. The function values at these points can \ be calculated just by applying the function f to the list xvalues:" }], "Text"], Cell["yvalues = f[xvalues];", "Input"], Cell["\<\ As long as we know what we are doing, we can ignore the warning \ concerning a possible spelling error. One can also turn these messages off by \ invoking the command Off[General::spell1].\ \>", "Text"], Cell["\<\ The variable yvalues now contains a one-dimensional array of \ complex numbers. With the command Short we can look at an abbreviated form of \ this expression (The parameter in the command Short describes the desired \ length of the abbreviated expression). :\ \>", "Text"], Cell[CellGroupData[{ Cell["Short[yvalues,2]", "Input"], Cell[BoxData[ TagBox[\({\(\(0.00011849442696537262`\)\(\[InvisibleSpace]\)\) + 0.000034482611891511404`\ \[ImaginaryI], \[LeftSkeleton]59\ \[RightSkeleton], \(\(0.00011849442696537222`\)\(\[InvisibleSpace]\)\) - 0.000034482611891511173`\ \[ImaginaryI]}\), (Short[ #, 2]&)]], "Output"] }, Open ]], Cell["Next we generate a table of absolute values", "Text"], Cell["absvals = Abs[yvalues];", "Input"], Cell["and a table of arguments", "Text", FormatType->InputForm], Cell["args = Arg[yvalues];", "Input"], Cell["\<\ From this we want to determine a table of color values. We could \ try to apply Hue to the list args, but this does not work because Hue is not \ \"listable\"\ \>", "Text"], Cell[CellGroupData[{ Cell["Hue[args/(2 Pi)] //Short", "Input"], Cell[BoxData[ TagBox[\(Hue[{0.04507034144862798`, 0.07690133006700708`, \[LeftSkeleton]58\[RightSkeleton], \ \(-0.04507034144862785`\)}]\), Short]], "Output"] }, Open ]], Cell["\<\ We have to use the command Map in order to apply Hue to each of the \ values in the list. Map has the shortcut /@\ \>", "Text"], Cell[CellGroupData[{ Cell["Hue /@ (args/(2 Pi)) //Short", "Input"], Cell[BoxData[ TagBox[\({Hue[0.04507034144862798`], Hue[0.07690133006700708`], \[LeftSkeleton]58\[RightSkeleton], Hue[\(-0.04507034144862785`\)]}\), Short]], "Output"] }, Open ]], Cell["We can achieve this in one step by writing", "Text"], Cell["huevals = Hue[Arg[#]/(2 Pi)]& /@ yvalues;", "Input"], Cell["\<\ Next, we are going to plot a graph of the function f. Let us first \ plot the graph of the absolute value, which is represented by the list \ absvals. We shall convert this into a list of points which can then be joined \ to form a line. The coordinates of these points can be obtained from the \ lists xvalues and absvals. We just apply the command Transpose in order to \ obtain the list of (x.y) pairs. \ \>", "Text"], Cell["graphline = Line[{xvalues,absvals}//Transpose];", "Input"], Cell["\<\ We can look at this by converting the graphics primitive graphline \ into a graphics object and by applying the command Show:\ \>", "Text"], Cell[CellGroupData[{ Cell["Show[Graphics[graphline]]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ In fact, this line is a polygonal curve, but the corners are too \ close to be visible at this magnification.\ \>", "Text"], Cell[TextData[{ "The colors will be obtained by generating polygons which are filled with \ the appropriate color. Assume that we are given n+1 function values f[", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], "], f[", Cell[BoxData[ \(TraditionalForm\`\(\(x\_1]\), \ \( ... \ \(f[x\_n] . \)\)\ \)\)]], "From these n+1 values we can generate n polygons, where the k-th polygon \ is given by the points ", Cell[BoxData[ \(TraditionalForm\`x\_k\)]], ", f[", Cell[BoxData[ \(TraditionalForm\`x\_k\)]], "], f[", Cell[BoxData[ \(TraditionalForm\`x\_\(k + 1\)\)]], "], and ", Cell[BoxData[ \(TraditionalForm\`x\_\(k + 1\)\)]], "(k=0,..n-1). In a conventional programming language, one would think to \ generate the list of polygons with a sort of do-loop. In ", StyleBox["Mathematica", FontSlant->"Italic"], " it is much more effective to apply list operations. We first generate an \ auxiliary list of zero values" }], "Text"], Cell["nullv = Table[0,{Length[xvalues]}];", "Input"], Cell[TextData[{ "The n-1 points (", Cell[BoxData[ \(TraditionalForm\`x\_k\)]], ",0) for k=0 .. n on the x-axis are obtained by" }], "Text"], Cell["xpoints = {xvalues, nullv}//Transpose;", "Input"], Cell[TextData[{ "Next we form the list of points with coordinates (", Cell[BoxData[ \(TraditionalForm\`x\_k\)]], ",f[", Cell[BoxData[ \(TraditionalForm\`x\_k\)]], "])" }], "Text"], Cell["ypoints = {xvalues, absvals}//Transpose;", "Input"], Cell[TextData[ "Now, this is a list of corner points for the polygons. The command \ Drop[list,\[PlusMinus]1] removes either the first or the last element of a \ list."], "Text"], Cell["\<\ cornerpoints = {Drop[xpoints,-1], Drop[ypoints,-1], \ Drop[ypoints,1], Drop[xpoints,1]}//Transpose;\ \>", "Input"], Cell[CellGroupData[{ Cell["Short[cornerpoints,3]", "Input"], Cell[BoxData[ TagBox[\({{{\(-3.`\), 0}, {\(-3.`\), 0.00012340980408667956`}, {\(-2.9`\), 0.00022262985691888894`}, {\(-2.9`\), 0}}, {\[LeftSkeleton]1\[RightSkeleton]}, \[LeftSkeleton]56\ \[RightSkeleton], {\[LeftSkeleton]1\[RightSkeleton], \[LeftSkeleton]3\ \[RightSkeleton]}, {{2.9000000000000004`, 0}, {2.9000000000000004`, 0.0002226298569188886`}, {\[LeftSkeleton]1\[RightSkeleton]}, \ {3.0000000000000004`, 0}}}\), (Short[ #, 3]&)]], "Output"] }, Open ]], Cell["\<\ The list of polygons is formed by mapping the command Polygon on \ the list of corner points.\ \>", "Text"], Cell["polylist = Map[Polygon, cornerpoints];", "Input"], Cell["\<\ Finally, we combine the color directives from the list hue with \ each polygon\ \>", "Text"], Cell["coloredpolys = {Drop[huevals,-1],polylist}//Transpose;", "Input"], Cell["Lets have a look at this:", "Text", FormatType->InputForm], Cell[CellGroupData[{ Cell["Show[Graphics[coloredpolys]]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["We can combine this with the line of the curve:", "Text"], Cell[CellGroupData[{ Cell["Show[Graphics[{coloredpolys,graphline}]]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ We combine everything into a single command. This can be done using \ a Module.\ \>", "Text"], Cell[BoxData[ \(\(\(fillit[xvars_, hues_, values_]\ := \n\ \ \ Module[{nullv, xpts, valpts, lines, fills}, \n\ \ \ \ \ \ nullv\ = \ Table[0, {Length[xvars]}]; \n\t\txpts\ = \ {xvars, nullv} // Transpose; \n\ \ \ \ \ \ valpts\ = \ {xvars, values} // Transpose; \n\t\tlines\ = \ Line[valpts]; \n\ \ \ \ \ \ fills\ = \n\ \ \ \ \ \ \ \ \ {Drop[ hues, \(-1\)], \n\ \ \ \ \ \ \ \ \ \ \ \ \ Map[ Polygon, \n\t\t\t\t\t\ \ \ \ {\ Drop[xpts, \(-1\)], \ Drop[valpts, \(-1\)], \ Drop[valpts, \ 1], Drop[xpts, \ 1]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } // Transpose\n\ \ \ \ \ \ \ \ \ \ \ \ \ ]\n\ \ \ \ \ \ \ \ \ } // Transpose; \n\ \ \ \ \ \ Show[ Graphics[\ {fills, lines}\ ]]\n\ \ \ ]\)\(\n\) \)\)], "Input"], Cell["Let us test this command with a small list:", "Text"], Cell[CellGroupData[{ Cell["fillit[{1,2,3,4,5}, Hue/@{0,.25,.5,.75,1}, {0,1,2,1,0}]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Phase-colored plot", "Subsection"], Cell["\<\ We can easily use the command fillit to define a useful plot \ command for a list of complex numbers:\ \>", "Text"], Cell["\<\ ListArgColorPlot[list_List] := Module[{xvars,hues,values}, xvars\t= Range[Length[list]]; hues\t= Hue[Arg[#]/(2 Pi)]& /@ list; values\t= Abs[list]; fillit[xvars,hues,values] ] \ \>", "Input"], Cell["f[x_] := Tan[x + 0.3 I]", "Input"], Cell["yvalues = Table[f[x],{x,-5.,5.,0.1}];", "Input"], Cell[CellGroupData[{ Cell["ListArgColorPlot[yvalues]//Timing", "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{\(0.019999999999999574`\ Second\), ",", TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]}], "}"}]], "Output"] }, Open ]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["The package VQM`ArgColorPlot", "Section"], Cell[TextData[{ "The (non-standard) package ", StyleBox["VQM`ArgColorPlot", "InlineInput"], " provides additional functionality" }], "Text"], Cell["<True, Axes->{True,False}, PlotRange->{-.5,4}]\ \>", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["There is a variant which corresponds to Plot", "Text"], Cell[CellGroupData[{ Cell["\<\ QArgColorPlot[Tan[x + 0.3 I], {x,-5,5}, Frame->True, \ Axes->{True,False}, PlotRange->{-.5,4}]\ \>", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[TextData[{ "Further documemtation is available via ", StyleBox["Mathematica", FontSlant->"Italic"], "'s Help Browser, provided the VQM packages are properly installed." }], "Text"], Cell["Moreover, you can get help in the usual way:", "Text"], Cell[CellGroupData[{ Cell["?QArgColorPlot", "Input"], Cell[BoxData[ \("QArgColorPlot[f[x],{x,x0,x1},opts] is used like the usual Plot \ command. It gives a two-dimensional plot of a complex-valued function f of a \ single real variable x in the range {x0,x1}. The plot shows the curve Abs[f] \ with area between the curve and the x-axis colored by Hue[Arg[f[x]]/(2 Pi)]. \ The default options of Plot are changed to Axes->{True,None}, Fame->True. \ Package: VQM`ArgColorPlot`"\)], "Print", CellTags->"Info3291132417-3695763"] }, Open ]], Cell[CellGroupData[{ Cell["Options[QArgColorPlot]", "Input"], Cell[BoxData[ \({AspectRatio \[Rule] 1\/GoldenRatio, Axes \[Rule] Automatic, AxesLabel \[Rule] None, AxesOrigin \[Rule] Automatic, AxesStyle \[Rule] Automatic, Background \[Rule] Automatic, ColorOutput \[Rule] Automatic, Compiled \[Rule] True, DefaultColor \[Rule] Automatic, DefaultFont \[RuleDelayed] $DefaultFont, DisplayFunction \[RuleDelayed] $DisplayFunction, Epilog \[Rule] {}, FormatType \[RuleDelayed] $FormatType, Frame \[Rule] False, FrameLabel \[Rule] None, FrameStyle \[Rule] Automatic, FrameTicks \[Rule] Automatic, GridLines \[Rule] None, ImageSize \[Rule] Automatic, MaxBend \[Rule] 10.`, PlotDivision \[Rule] 30.`, PlotLabel \[Rule] None, PlotPoints \[Rule] 25, PlotRange \[Rule] Automatic, PlotRegion \[Rule] Automatic, PlotStyle \[Rule] Automatic, Prolog \[Rule] {}, RotateLabel \[Rule] True, TextStyle \[RuleDelayed] $TextStyle, Ticks \[Rule] Automatic, AxesFront \[Rule] True, QSaturation \[Rule] 1, QBrightness \[Rule] 1, QBottomLine \[Rule] 0, QShiftPlot \[Rule] 0, QPlotDown \[Rule] False, QSquared \[Rule] False}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["?QSaturation", "Input"], Cell[BoxData[ \("Option for QArgColorPlot. QSaturation->s causes the colors in the plot \ to appear at saturation s. Default value is 1. Package: \ VQM`ArgColorPlot`"\)], "Print", CellTags->"Info3291132451-5724114"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Examples for using the ArgColorPlot package", "Section"], Cell["\<\ We turn off error messages that occur whenever one of the complex \ values to be plotted is zero (because the argument of that number is not \ defined):\ \>", "Text"], Cell[BoxData[ \(\(Off[Arg::"\"];\)\)], "Input"], Cell["This example shows a complex-valued Gaussian function.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(QArgColorPlot[\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ 6\ x - x\^2\/2\), \ {x, \(-4\), 4}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ Most of the options for Plot can be used also for QArgColorPlot. In \ addition, we can influence the Saturation and the Brightness of the colors \ for the complex phase:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(QArgColorPlot[\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ 6\ x - x\^2\/2\), \ {x, \(-4\), 4}, PlotStyle \[Rule] {Thickness[0.025], GrayLevel[0.5]}, QSaturation \[Rule] 0.5, QBrightness \[Rule] 0.7, PlotRange \[Rule] {\(-0.2\), 1.2}, Frame \[Rule] True, Axes \[Rule] {True, False}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ Next, we illustrate the usage of QListArgColorPlot. First, we \ create a list of complex numbers.\ \>", "Text"], Cell[BoxData[ \(\(mytab = Table[Sin[\[Pi]\ x]\ \[ExponentialE]\^\(2\ \[ImaginaryI]\ \[Pi]\ x\), \ {x, \(-2\), 2, 0.1}];\)\)], "Input"], Cell[CellGroupData[{ Cell["QListArgColorPlot[mytab]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ If, like here, the complex values come from the discretization of a \ function of a real variable x, we want to have x-values on the horizontal \ axis, and not the index of the complex list. This can be done with the option \ QHorizontalRange which specifies the range of x-values on the horizontal \ axis:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(QListArgColorPlot[mytab, Axes \[Rule] True, QHorizontalRange \[Rule] {\(-2\), 2}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["Here is another method to achieve a similar result:", "Text"], Cell[CellGroupData[{ Cell["\<\ QListArgColorPlot[mytab, Axes\[Rule]True, \ Ticks->{QNiceTicks[-2.,2.,0.1],Automatic}]\ \>", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ We can also plot a part of the list, corresponding, for example, to \ the values in the sub-interval {-1,0} of the horizontal range {-2,2}:\ \>", \ "Text"], Cell[BoxData[ \(\(QListArgColorPlot[mytab, Axes \[Rule] True, QHorizontalRange \[Rule] {{\(-2\), 2}, {\(-1\), 0}}];\)\)], "Input"], Cell["\<\ If the \"sub-interval\" is larger than the horizontal range, the \ list will be padded with zeros:\ \>", "Text"], Cell[BoxData[ \(\(QListArgColorPlot[mytab, Axes \[Rule] True, QHorizontalRange \[Rule] {{\(-2\), 2}, {\(-4\), 4}}];\)\)], "Input"], Cell["\<\ If you want to combine a phase-colored plot with an ordinary plot \ of another function, you can use QCombinedPlot:\ \>", "Text"], Cell[BoxData[ \(\(QCombinedPlot[{Exp[\(-x^2\)/2], x^2/2 - 1/2}, {x, \(-4\), 4}];\)\)], "Input"], Cell["\<\ There is also a \"ListPlot\"-version of QCombinedPlot, where a list \ of complex values is plotted together with an ordinary function:\ \>", "Text"], Cell[BoxData[{ \(\(mytab = Table[Exp[\(-x^2\)/2], {x, \(-4\), 4, 0.1}];\)\), "\n", \(\(QListCombinedPlot[{mytab, x^2/2 - 1/2}, {x, \(-4\), 4}];\)\)}], "Input"], Cell[BoxData[ \(\(QListCombinedPlot[{mytab, x^2/2 - 1/2}, {x, 0, 2}];\)\)], "Input"], Cell[BoxData[ \(\(QListCombinedPlot[{mytab, x^2/2 - 1/2}, {x, 0, 2}, QHorizontalRange \[Rule] {\(-4\), 4}];\)\)], "Input"], Cell[BoxData[ \(\(QListCombinedPlot[{mytab, x^2/2 - 1/2}, {x, 0, 2}, QHorizontalRange \[Rule] {{\(-4\), 4}, {\(-1\)/2, 3/2}}];\)\)], "Input"], Cell["\<\ Normally, in QArgColorPlot, the range between the x-axis and the \ graph of the function is filled with a color corresponding to the phase. But \ we can also use another horizontal line at height y=y0 by using the option \ QBottomLine->y0:\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ QArgColorPlot[Exp[I x - x^2],{x,-3,3}, QBottomLine\[Rule]1/3]\ \>", \ "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ This is useful, if we want to combine several ArgColorPlots in the \ same graphics:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ QArgColorPlot[Sin[x + \[ImaginaryI]], {x, \(-3\), 3}, QBottomLine \[Rule] 1, Epilog \[Rule] Line[{{\(-3\), 1}, {3, 1}}], DisplayFunction \[Rule] Identity], QArgColorPlot[ Cos[x + \[ImaginaryI]] - \[ExponentialE]\^\(\[ImaginaryI]\ Arg[Cos[x \ + \[ImaginaryI]]]\), {x, \(-3\), 3}, DisplayFunction \[Rule] Identity], PlotRange \[Rule] {\(-0.2\), 1.7}, Frame \[Rule] True, DisplayFunction \[Rule] $DisplayFunction]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["Some more options for use with QArgColorPlot:", "Text"], Cell["\<\ QSquared->True plots the square of the curve instead of the \ absolute value:\ \>", "Text"], Cell[CellGroupData[{ Cell["QArgColorPlot[Sin[x],{x,-2Pi,Pi}, QSquared->True]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ QShiftPlot->number performs a vertical shift of the whole plot by \ number.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ QArgColorPlot[Sin[x],{x,-2Pi,Pi}, QShiftPlot->1, \ PlotRange->{0,2}]\ \>", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["QPlotDown->True lets the whole plot appear uside down.", "Text"], Cell[CellGroupData[{ Cell["QArgColorPlot[Sin[x],{x,-2Pi,Pi}, QPlotDown->True]", "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[TextData[{ "In quantum mechanics, a ", Cell[BoxData[ \(\[DoubleStruckCapitalC]\^2\)]], "-valued functions is called a spinor function. The ArgColorPlot has a \ method to plot such functions by combining QArgColorPlots of the two \ component-functions. By default, the second component is plotted upside down \ and with less saturation:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(spinorfunction[ x_] := {Cos[ 3\ x]\ \[ExponentialE]\^\(\(-\(1\/3\)\)\ \((x - 1\/4)\)\^2 + \ \[ImaginaryI]\ x\), Sin[4\ x]\ \[ExponentialE]\^\(\(-\(1\/2\)\)\ \((x + 1\/4)\)\^2 + 2\ \ \[ImaginaryI]\ x\)};\)\), "\n", \(QSpinorPlot[Evaluate[spinorfunction[x]], {x, \(-3. \), 3. }, PlotRange \[Rule] All, Frame \[Rule] True, Axes \[Rule] {True, False}]\)}], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ Like the other commands, this command accepts options and allows a \ combination with an ordinary plot\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(spinorlist = Table[{x, spinorfunction[x]}, {x, \(-3\), 3, 0.1}];\)\), "\n", \(QListSpinorCombinedPlot[{spinorlist, Sin[4\ x]}, {x, \(-2\), 3}, PlotRange \[Rule] All, QCurveStyle \[Rule] {RGBColor[0, 0.7, 0.9], Thickness[0.03]}, PlotStyle \[Rule] {RGBColor[0.2, 0.2, 0.5], Thickness[0.02]}]\)}], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]] }, FrontEndVersion->"5.0 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 710}}, WindowSize->{772, 693}, WindowMargins->{{77, Automatic}, {Automatic, 0}}, Magnification->1, StyleDefinitions -> "Report.nb" ] (******************************************************************* 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->{ "Info3291132417-3695763"->{ Cell[16431, 558, 477, 7, 102, "Print", CellTags->"Info3291132417-3695763"]}, "Info3291132451-5724114"->{ Cell[18237, 598, 221, 4, 54, "Print", CellTags->"Info3291132451-5724114"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3291132417-3695763", 27623, 920}, {"Info3291132451-5724114", 27740, 923} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 45, 0, 74, "Title"], Cell[1824, 55, 107, 6, 100, "Subsubtitle"], Cell[CellGroupData[{ Cell[1956, 65, 30, 0, 40, "Subsection"], Cell[1989, 67, 828, 18, 76, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2854, 90, 50, 0, 67, "Section"], Cell[2907, 92, 155, 4, 28, "Text"], Cell[CellGroupData[{ Cell[3087, 100, 32, 0, 40, "Subsection"], Cell[3122, 102, 336, 8, 44, "Text"], Cell[3461, 112, 39, 0, 32, "Input"], Cell[CellGroupData[{ Cell[3525, 116, 66, 0, 32, "Input"], Cell[3594, 118, 130, 3, 47, "Output"] }, Open ]], Cell[3739, 124, 140, 4, 28, "Text"], Cell[CellGroupData[{ Cell[3904, 132, 160, 6, 92, "Input"], Cell[4067, 140, 130, 3, 47, "Output"] }, Open ]], Cell[4212, 146, 163, 4, 28, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4412, 155, 55, 0, 40, "Subsection"], Cell[4470, 157, 411, 6, 60, "Text"], Cell[4884, 165, 350, 7, 44, "Text"], Cell[5237, 174, 68, 0, 28, "Text"], Cell[5308, 176, 43, 0, 32, "Input"], Cell[5354, 178, 162, 4, 28, "Text"], Cell[5519, 184, 50, 0, 32, "Input"], Cell[5572, 186, 501, 9, 60, "Text"], Cell[6076, 197, 38, 0, 32, "Input"], Cell[6117, 199, 212, 4, 44, "Text"], Cell[6332, 205, 283, 5, 44, "Text"], Cell[CellGroupData[{ Cell[6640, 214, 33, 0, 32, "Input"], Cell[6676, 216, 316, 5, 47, "Output"] }, Open ]], Cell[7007, 224, 59, 0, 28, "Text"], Cell[7069, 226, 40, 0, 32, "Input"], Cell[7112, 228, 65, 1, 28, "Text"], Cell[7180, 231, 37, 0, 32, "Input"], Cell[7220, 233, 182, 4, 44, "Text"], Cell[CellGroupData[{ Cell[7427, 241, 44, 0, 32, "Input"], Cell[7474, 243, 179, 4, 47, "Output"] }, Open ]], Cell[7668, 250, 137, 3, 28, "Text"], Cell[CellGroupData[{ Cell[7830, 257, 48, 0, 32, "Input"], Cell[7881, 259, 194, 4, 47, "Output"] }, Open ]], Cell[8090, 266, 58, 0, 28, "Text"], Cell[8151, 268, 58, 0, 32, "Input"], Cell[8212, 270, 430, 7, 60, "Text"], Cell[8645, 279, 64, 0, 32, "Input"], Cell[8712, 281, 149, 3, 28, "Text"], Cell[CellGroupData[{ Cell[8886, 288, 42, 0, 32, "Input"], Cell[8931, 290, 130, 3, 47, "Output"] }, Open ]], Cell[9076, 296, 133, 3, 28, "Text"], Cell[9212, 301, 988, 27, 76, "Text"], Cell[10203, 330, 52, 0, 32, "Input"], Cell[10258, 332, 151, 5, 28, "Text"], Cell[10412, 339, 55, 0, 32, "Input"], Cell[10470, 341, 201, 8, 28, "Text"], Cell[10674, 351, 57, 0, 32, "Input"], Cell[10734, 353, 178, 3, 28, "Text"], Cell[10915, 358, 124, 3, 47, "Input"], Cell[CellGroupData[{ Cell[11064, 365, 38, 0, 32, "Input"], Cell[11105, 367, 509, 9, 63, "Output"] }, Open ]], Cell[11629, 379, 117, 3, 28, "Text"], Cell[11749, 384, 55, 0, 32, "Input"], Cell[11807, 386, 102, 3, 28, "Text"], Cell[11912, 391, 71, 0, 32, "Input"], Cell[11986, 393, 66, 1, 28, "Text"], Cell[CellGroupData[{ Cell[12077, 398, 45, 0, 32, "Input"], Cell[12125, 400, 130, 3, 47, "Output"] }, Open ]], Cell[12270, 406, 63, 0, 28, "Text"], Cell[CellGroupData[{ Cell[12358, 410, 57, 0, 32, "Input"], Cell[12418, 412, 130, 3, 47, "Output"] }, Open ]], Cell[12563, 418, 103, 3, 28, "Text"], Cell[12669, 423, 920, 16, 288, "Input"], Cell[13592, 441, 59, 0, 28, "Text"], Cell[CellGroupData[{ Cell[13676, 445, 72, 0, 32, "Input"], Cell[13751, 447, 130, 3, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[13930, 456, 40, 0, 40, "Subsection"], Cell[13973, 458, 125, 3, 28, "Text"], Cell[14101, 463, 248, 9, 137, "Input"], Cell[14352, 474, 40, 0, 32, "Input"], Cell[14395, 476, 54, 0, 32, "Input"], Cell[CellGroupData[{ Cell[14474, 480, 50, 0, 32, "Input"], Cell[14527, 482, 224, 5, 47, "Output"] }, Open ]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[14812, 494, 47, 0, 41, "Section"], Cell[14862, 496, 146, 4, 28, "Text"], Cell[15011, 502, 36, 0, 32, "Input"], Cell[15050, 504, 368, 8, 60, "Text"], Cell[15421, 514, 64, 0, 32, "Input"], Cell[CellGroupData[{ Cell[15510, 518, 104, 3, 47, "Input"], Cell[15617, 523, 130, 3, 47, "Output"] }, Open ]], Cell[15762, 529, 60, 0, 28, "Text"], Cell[CellGroupData[{ Cell[15847, 533, 119, 4, 47, "Input"], Cell[15969, 539, 130, 3, 47, "Output"] }, Open ]], Cell[16114, 545, 195, 5, 28, "Text"], Cell[16312, 552, 60, 0, 28, "Text"], Cell[CellGroupData[{ Cell[16397, 556, 31, 0, 32, "Input"], Cell[16431, 558, 477, 7, 102, "Print", CellTags->"Info3291132417-3695763"] }, Open ]], Cell[CellGroupData[{ Cell[16945, 570, 39, 0, 32, "Input"], Cell[16987, 572, 1181, 19, 200, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[18205, 596, 29, 0, 32, "Input"], Cell[18237, 598, 221, 4, 54, "Print", CellTags->"Info3291132451-5724114"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[18507, 608, 62, 0, 41, "Section"], Cell[18572, 610, 176, 4, 44, "Text"], Cell[18751, 616, 59, 1, 32, "Input"], Cell[18813, 619, 70, 0, 28, "Text"], Cell[CellGroupData[{ Cell[18908, 623, 121, 2, 45, "Input"], Cell[19032, 627, 130, 3, 47, "Output"] }, Open ]], Cell[19177, 633, 193, 4, 44, "Text"], Cell[CellGroupData[{ Cell[19395, 641, 329, 5, 82, "Input"], Cell[19727, 648, 130, 3, 47, "Output"] }, Open ]], Cell[19872, 654, 121, 3, 28, "Text"], Cell[19996, 659, 147, 3, 37, "Input"], Cell[CellGroupData[{ Cell[20168, 666, 41, 0, 32, "Input"], Cell[20212, 668, 130, 3, 47, "Output"] }, Open ]], Cell[20357, 674, 330, 6, 60, "Text"], Cell[CellGroupData[{ Cell[20712, 684, 121, 2, 32, "Input"], Cell[20836, 688, 130, 3, 47, "Output"] }, Open ]], Cell[20981, 694, 67, 0, 28, "Text"], Cell[CellGroupData[{ Cell[21073, 698, 111, 3, 32, "Input"], Cell[21187, 703, 130, 3, 47, "Output"] }, Open ]], Cell[21332, 709, 165, 4, 28, "Text"], Cell[21500, 715, 143, 2, 32, "Input"], Cell[21646, 719, 122, 3, 28, "Text"], Cell[21771, 724, 143, 2, 32, "Input"], Cell[21917, 728, 139, 3, 28, "Text"], Cell[22059, 733, 110, 2, 32, "Input"], Cell[22172, 737, 158, 3, 28, "Text"], Cell[22333, 742, 179, 3, 48, "Input"], Cell[22515, 747, 88, 1, 32, "Input"], Cell[22606, 750, 135, 2, 32, "Input"], Cell[22744, 754, 169, 3, 48, "Input"], Cell[22916, 759, 263, 5, 44, "Text"], Cell[CellGroupData[{ Cell[23204, 768, 88, 3, 32, "Input"], Cell[23295, 773, 130, 3, 47, "Output"] }, Open ]], Cell[23440, 779, 107, 3, 28, "Text"], Cell[CellGroupData[{ Cell[23572, 786, 502, 9, 91, "Input"], Cell[24077, 797, 130, 3, 47, "Output"] }, Open ]], Cell[24222, 803, 61, 0, 28, "Text"], Cell[24286, 805, 101, 3, 28, "Text"], Cell[CellGroupData[{ Cell[24412, 812, 66, 0, 32, "Input"], Cell[24481, 814, 130, 3, 47, "Output"] }, Open ]], Cell[24626, 820, 99, 3, 28, "Text"], Cell[CellGroupData[{ Cell[24750, 827, 93, 3, 32, "Input"], Cell[24846, 832, 130, 3, 47, "Output"] }, Open ]], Cell[24991, 838, 70, 0, 28, "Text"], Cell[CellGroupData[{ Cell[25086, 842, 67, 0, 32, "Input"], Cell[25156, 844, 130, 3, 47, "Output"] }, Open ]], Cell[25301, 850, 365, 8, 60, "Text"], Cell[CellGroupData[{ Cell[25691, 862, 438, 9, 77, "Input"], Cell[26132, 873, 130, 3, 47, "Output"] }, Open ]], Cell[26277, 879, 126, 3, 28, "Text"], Cell[CellGroupData[{ Cell[26428, 886, 372, 7, 80, "Input"], Cell[26803, 895, 130, 3, 47, "Output"] }, Open ]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)