├── .gitignore ├── LICENSE.md ├── README.md ├── ToPython.wl ├── ToPython_examples.nb └── ToPython_tests.nb /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2018 Gustavo Wiederhecker 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MathematicaToPython 2 | 3 | Mathematica package to convert [MATHEMATICA](https://www.wolfram.com/mathematica/) expressions to Python [Numpy](http://www.numpy.org/) 4 | 5 | ## Quick usage 6 | 7 | The quickest way to use the package is to directly load it from the master branch of this 8 | repository by running the following code in a Mathematica notebook: 9 | 10 | ```Mathematica 11 | Import["https://raw.githubusercontent.com/zwicker-group/MathematicaToPython/master/ToPython.wl"] 12 | ``` 13 | 14 | ## Installation 15 | 16 | To install the package permanently, do the following 17 | 18 | 1. Download it from this repository 19 | 2. Click on `Mathematica`' `File menu-> Install->From file...` 20 | 3. Select the file on your disk 21 | 22 | You should be ready to go. 23 | 24 | ## Usage 25 | 26 | The package mainly provides the `ToPython` function, which takes a Mathematica expression 27 | and tries to convert it to a python expression. It can handle a lot of expressions 28 | already, but it is obviously limited. 29 | 30 | Beside the actual expression the `ToPython` function also supports two options: 31 | 32 | * `NumpyPrefix`, which determines the name under which numpy is imported. The default is 33 | to prefix all numpy call with `np.`, but you can also set `NumpyPrefix` to `"numpy"` to 34 | enforce `numpy.` as a prefix. If you supply an empty string, no prefix is added, which 35 | might be useful if you use the wildcard import `from numpy import *` 36 | * `Copy`, which when enabled copies the formatted expression to the clipboard 37 | 38 | Taken together, a simple example call is 39 | 40 | ```Mathematica 41 | ToPython[Sin[x], NumpyPrefix->"numpy", Copy->True] 42 | ``` 43 | 44 | which should copy `numpy.sin(x)` to your clipboard. 45 | 46 | ## Disclaimer 47 | 48 | This has not been tested for every possible combinations of all the things, use at your own risks. 49 | 50 | ## License 51 | 52 | [MIT](LICENSE.md) © [Gustavo Wiederhecker](https://github.com/gwiederhecker) with modifications from our group 53 | -------------------------------------------------------------------------------- /ToPython.wl: -------------------------------------------------------------------------------- 1 | (* ::Package:: *) 2 | 3 | (*This package provides a function to convert a Mathematica expression to numpy 4 | ----------------------------------------------------; 5 | INPUT ARGUMENTS; 6 | expression: your mathematica expression, it can be numbers, literals, complexes or lists; 7 | numpy\[LetterSpace]prefix: string defining your Numpy import prefix, e.g.: 8 | if your used "import numpy as np", your prefix should be the string "np" 9 | if your used "from numpy import *", your prefix should be the empty string "" 10 | ; 11 | OUTPUT; 12 | the Numpy python-ready expression (to be copied as a string); 13 | !The formatted expression will be copied ot your clipboard, ready to paste on Python!; 14 | ------------------------------------------------------; 15 | Not tested for every possible combination; use at your risk, by Gustavo Wiederhecker with 16 | modifications by David Zwicker 17 | *) 18 | 19 | BeginPackage["ToPython`"] 20 | 21 | ToPython::usage = "ToPython[expression, NumpyPrefix->\"np\", Copy->False] 22 | converts Mathematica expression to a Numpy compatible expression. Because Numpy can 23 | be imported in several ways, you can specify the name of the numpy module using the 24 | NumpyPrefix option. The additional option Copy allows you to copy the result to the clipboard" 25 | 26 | ToPythonEquation::usage = "ToPythonEquation[equation, NumpyPrefix->\"np\", Copy->False] 27 | converts a Mathematica equation to a Numpy compatible expression." 28 | 29 | Begin["Private`"] 30 | 31 | (* list of function heads that do not need to be enclosed in brackets *) 32 | 33 | singleFunctions = {Log, Sin, Cos, Tan, Sinh, Cosh, Tanh}; 34 | 35 | Options[ToPython] = {NumpyPrefix -> "np", Copy -> False}; 36 | 37 | ToPython[expression_, OptionsPattern[]] := 38 | Module[ 39 | {numpyprefix = OptionValue[NumpyPrefix], copy = OptionValue[Copy 40 | ], result, greekrule, format, PythonForm, np, br, brackets, a, b, l, 41 | m, args} 42 | , 43 | (* determine the correct numpy prefix *) 44 | If[numpyprefix == "", 45 | np = numpyprefix 46 | , 47 | np = numpyprefix <> "." 48 | ]; 49 | (* general function for formating output *) 50 | format[pattern_String, args__] := 51 | Module[{s}, 52 | s = StringReplace[pattern, "numpy." -> np]; 53 | ToString @ StringForm[s, Sequence @@ PythonForm /@ List[ 54 | args]] 55 | ]; 56 | (* helper function deciding when to use brackets *) 57 | br[a_] := 58 | If[AtomQ[a] || MemberQ[singleFunctions, Head[a]], 59 | a 60 | , 61 | brackets[a] 62 | ]; 63 | PythonForm[brackets[a_]] := format["(``)", a]; 64 | (* special forms that are recognized *) 65 | PythonForm[Times[-1, a_]] := format["-``", br[a]]; 66 | PythonForm[Power[a_, Rational[1, 2]]] := format["numpy.sqrt(``)", 67 | a]; 68 | PythonForm[Times[a_, Power[b_, -1]]] := format["`` / ``", br[ 69 | a], br[b]]; 70 | (* special forms that are not supported *) 71 | ToPython::hasDerivative = "Dervatives are not supported"; 72 | PythonForm[Derivative[___]] := 73 | ( 74 | Message[ToPython::hasDerivative]; 75 | Abort[] 76 | ); 77 | (* Simple math *) 78 | PythonForm[Rational[a_, b_]] := ToString[N[a / b, $MachinePrecision 79 | ], FortranForm]; 80 | PythonForm[a_Rational] := ToString[N[a, $MachinePrecision], FortranForm 81 | ]; 82 | PythonForm[Complex[a_, b_]] := format["complex(``, ``)", a, b 83 | ]; 84 | PythonForm[a_ * b__] := 85 | Module[{fs, bl = {b}}, 86 | fs = StringRiffle[ConstantArray["``", 1 + Length @ bl 87 | ], " * "]; 88 | format[fs, br @ a, Sequence @@ br /@ bl] 89 | ]; 90 | PythonForm[a_ + b_] := format["`` + ``", a, b]; 91 | PythonForm[Power[a_, b_]] := format["`` ** ``", br[a], br[b]] 92 | ; 93 | PythonForm[Exp[a_]] := format["numpy.exp(``)", a]; 94 | (* Some basic functions *) 95 | PythonForm[Max[a_, b_]] := format["numpy.maximum(`1`, `2`)", 96 | a, b]; 97 | PythonForm[Min[a_, b_]] := format["numpy.minimum(`1`, `2`)", 98 | a, b]; 99 | (* Some special functions *) 100 | PythonForm[Arg[a_]] := format["numpy.angle(``)", a]; 101 | PythonForm[SphericalHarmonicY[l_, m_, a_, b_]] := format["special.sph_harm(``, ``, (``) % (2 * numpy.pi), (``) % numpy.pi)", 102 | m, l, b, a]; 103 | PythonForm[Gamma[a_]] := format["special.gamma(``)", a]; 104 | PythonForm[Gamma[a_, b_]] := format["special.gamma(`1`) * special.gammaincc(`1`, `2`)", 105 | a, b]; 106 | PythonForm[BesselI[0, b_]] := format["special.i0(``)", b]; 107 | PythonForm[BesselJ[0, b_]] := format["special.j0(``)", b]; 108 | PythonForm[BesselK[0, b_]] := format["special.k0(``)", b]; 109 | PythonForm[BesselY[0, b_]] := format["special.y0(``)", b]; 110 | PythonForm[BesselI[1, b_]] := format["special.i1(``)", b]; 111 | PythonForm[BesselJ[1, b_]] := format["special.j1(``)", b]; 112 | PythonForm[BesselK[1, b_]] := format["special.k1(``)", b]; 113 | PythonForm[BesselY[1, b_]] := format["special.y1(``)", b]; 114 | PythonForm[BesselI[a_, b_]] := format["special.iv(``, ``)", a, 115 | b]; 116 | PythonForm[BesselJ[a_, b_]] := format["special.jv(``, ``)", a, 117 | b]; 118 | PythonForm[BesselK[a_, b_]] := format["special.kn(``, ``)", a, 119 | b]; 120 | PythonForm[BesselY[a_, b_]] := format["special.yn(``, ``)", a, 121 | b]; 122 | (* Some functions that are not defined in numpy *) 123 | PythonForm[Csc[a_]] := format["1 / numpy.sin(``)", a]; 124 | PythonForm[Sec[a_]] := format["1 / numpy.cos(``)", a]; 125 | PythonForm[Cot[a_]] := format["1 / numpy.tan(``)", a]; 126 | PythonForm[Csch[a_]] := format["1 / numpy.sinh(``)", a]; 127 | PythonForm[Sech[a_]] := format["1 / numpy.cosh(``)", a]; 128 | PythonForm[Coth[a_]] := format["1 / numpy.tanh(``)", a]; 129 | (* Handling arrays *) 130 | PythonForm[a_NumericArray] := np <> "array(" <> StringReplace[ 131 | ToString @ Normal @ a, {"{" -> "[", "}" -> "]"}] <> ")"; 132 | PythonForm[List[args__]] := np <> "array([" <> StringRiffle[PythonForm 133 | /@ List[args], ", "] <> "])"; 134 | (* Constants *) 135 | PythonForm[\[Pi]] = np <> "pi"; 136 | PythonForm[E] = np <> "e"; 137 | (* Greek characters *) 138 | greekrule = {"\[Alpha]" -> "alpha", "\[Beta]" -> "beta", "\[Gamma]" 139 | -> "gamma", "\[Delta]" -> "delta", "\[Epsilon]" -> "epsilon", "\[CurlyEpsilon]" 140 | -> "curlyepsilon", "\[Zeta]" -> "zeta", "\[Eta]" -> "eta", "\[Theta]" 141 | -> "theta", "\[Iota]" -> "iota", "\[Kappa]" -> "kappa", "\[Lambda]" 142 | -> "lamb", "\[Mu]" -> "mu", "\[Nu]" -> "nu", "\[Xi]" -> "xi", "\[Omicron]" 143 | -> "omicron", "\[Pi]" -> "pi", "\[Rho]" -> "rho", "\[FinalSigma]" -> 144 | "finalsigma", "\[Sigma]" -> "sigma", "\[Tau]" -> "tau", "\[Upsilon]" 145 | -> "upsilon", "\[CurlyPhi]" -> "curlyphi", "\[Chi]" -> "chi", "\[Phi]" 146 | -> "phi", "\[Psi]" -> "psi", "\[Omega]" -> "omega", "\[CapitalAlpha]" 147 | -> "Alpha", "\[CapitalBeta]" -> "Beta", "\[CapitalGamma]" -> "Gamma", 148 | "\[CapitalDelta]" -> "Delta", "\[CapitalEpsilon]" -> "CurlyEpsilon", 149 | "\[CapitalZeta]" -> "Zeta", "\[CapitalEta]" -> "Eta", "\[CapitalTheta]" 150 | -> "Theta", "\[CapitalIota]" -> "Iota", "\[CapitalKappa]" -> "Kappa", 151 | "\[CapitalLambda]" -> "Lambda", "\[CapitalMu]" -> "Mu", "\[CapitalNu]" 152 | -> "Nu", "\[CapitalXi]" -> "Xi", "\[CapitalOmicron]" -> "Omicron", "\[CapitalPi]" 153 | -> "Pi", "\[CapitalRho]" -> "Rho", "\[CapitalSigma]" -> "Sigma", "\[CapitalTau]" 154 | -> "Tau", "\[CapitalUpsilon]" -> "Upsilon", "\[CapitalPhi]" -> "CurlyPhi", 155 | "\[CapitalChi]" -> "Chi", "\[CapitalPsi]" -> "Psi", "\[CapitalOmega]" 156 | -> "Omega"}; 157 | plusminusrule = {"+ -" -> "-"}; 158 | (* Everything else *) 159 | PythonForm[h_[args__]] := np <> ToLowerCase[PythonForm[h]] <> 160 | "(" <> PythonForm[args] <> ")"; 161 | PythonForm[allOther_] := StringReplace[ToString[allOther, FortranForm 162 | ], greekrule]; 163 | result = StringReplace[PythonForm[expression], greekrule ~ Join 164 | ~ plusminusrule]; 165 | (* Copy results to clipboard *) 166 | If[copy, 167 | CopyToClipboard[result] 168 | ]; 169 | result 170 | ] 171 | 172 | Options[ToPythonEquation] = {NumpyPrefix -> "np", Copy -> False}; 173 | 174 | ToPythonEquation[Equal[a_, b_], opts : OptionsPattern[]] := 175 | ToPython[a - b, opts] 176 | 177 | End[] 178 | 179 | EndPackage[] 180 | -------------------------------------------------------------------------------- /ToPython_examples.nb: -------------------------------------------------------------------------------- 1 | (* Content-type: application/vnd.wolfram.mathematica *) 2 | 3 | (*** Wolfram Notebook File ***) 4 | 5 | (* http://www.wolfram.com/nb *) 6 | 7 | (* CreatedBy='Mathematica 11.0' *) 8 | 9 | (*CacheID: 234*) 10 | 11 | (* Internal cache information: 12 | NotebookFileLineBreakTest 13 | NotebookFileLineBreakTest 14 | NotebookDataPosition[ 158, 7] 15 | NotebookDataLength[ 76949, 1652] 16 | NotebookOptionsPosition[ 72110, 1573] 17 | NotebookOutlinePosition[ 72506, 1589] 18 | CellTagsIndexPosition[ 72463, 1586] 19 | WindowFrame->Normal*) 20 | 21 | (* Beginning of Notebook Content *) 22 | 23 | Notebook[ 24 | { 25 | Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{RowBox[{"loads", " ", 26 | "the", " ", "package"}], " ", "-", " ", RowBox[{"after", " ", "installation" 27 | }]}], "*)"}], "\[IndentingNewLine]", RowBox[{"Get", "@", RowBox[{"FileNameJoin", 28 | "[", RowBox[{"{", RowBox[{RowBox[{"NotebookDirectory", "[", "]"}], ",", 29 | "\"\\""}], "}"}], "]"}]}]}]], "Input", CellChangeTimes 30 | -> {{3.70181767476367*^9, 3.701817694205203*^9}, {3.7018181976937943`*^9, 31 | 3.701818211998588*^9}, {3.817007877025469*^9, 3.81700790447239*^9}, 32 | {3.8172214865707483`*^9, 3.81722149743857*^9}}, CellLabel -> "In[47]:=", 33 | ExpressionUUID -> "ee6242fe-5738-42d7-927d-12c3be9f45f8"] 34 | , 35 | Cell[ 36 | CellGroupData[ 37 | { 38 | Cell[BoxData[RowBox[{"?", "ToPython"}]], "Input", CellChangeTimes 39 | -> {{3.70181815383568*^9, 3.7018181578773003`*^9}, 3.701818214459565*^9, 40 | {3.817118303280854*^9, 3.817118304890544*^9}, {3.8171204416196833`*^9, 41 | 3.8171204422649813`*^9}, {3.846041124797001*^9, 3.846041134384152*^9 42 | }}, CellLabel -> "In[48]:=", ExpressionUUID -> "e8858397-83ae-4bb9-9a33-1b677626ef0c" 43 | ] 44 | , 45 | Cell[BoxData[TemplateBox[{"StringForm", "string", "\"String expected at position StandardForm[Short[Shallow[HoldForm[1], {10, 50}], 5]] in StandardForm[Short[Shallow[HoldForm[StringForm[Private`s, Sequence @@ Private`PythonForm /@ {Private`args}]], {10, 50}], 5]].\"", 46 | 2, 48, 1, 27837000086921606047, "Local"}, "MessageTemplate"]], "Message", 47 | "MSG", CellChangeTimes -> {{3.846041131173876*^9, 3.8460411348863487`*^9 48 | }, 3.846041288298971*^9, 3.846041712287074*^9, {3.84604174243005*^9, 49 | 3.846041755722417*^9}, 3.8460418725700493`*^9, 3.84604234575531*^9, 3.8464081244260674`*^9, 50 | 3.846408252278989*^9}, CellLabel -> "During evaluation of In[48]:=", 51 | ExpressionUUID -> "8547ffc5-678a-4925-92f6-8ad83246e2a7"] 52 | , 53 | Cell[ 54 | BoxData[ 55 | InterpretationBox[ 56 | StyleBox[FrameBox[DynamicModuleBox[{System`InformationDump`open$$ 57 | = False, System`InformationDump`mouseOver$$ = False}, PaneSelectorBox[ 58 | {True -> TagBox[GridBox[{{ItemBox[PaneBox[StyleBox["\<\" Symbol\"\>", 59 | "InformationTitleText", StripOnInput -> False, BaseStyle -> None], FrameMargins 60 | -> {{4, 0}, {-1, 1}}], BaseStyle -> "InformationTitleBackground", StripOnInput 61 | -> False], ItemBox["\<\"\"\>", BaseStyle -> "InformationTitleBackground", 62 | StripOnInput -> False]}, {ItemBox[PaneBox[StyleBox["\<\"ToPython[expression, NumpyPrefix->\\\"np\\\", Copy->False]\\n\\tconverts Mathematica expression to a Numpy compatible expression. Because Numpy can\\n\\tbe imported in several ways, you can specify the name of the numpy module using the\\n NumpyPrefix option. The additional option Copy allows you to copy the result to the clipboard\"\>", 63 | "InformationUsageText", StripOnInput -> False, LineSpacing -> {1.5, 64 | 1.5, 3.}], FrameMargins -> {{10, 10}, {8, 10}}], BaseStyle -> "InformationUsageSubtitleBackground", 65 | StripOnInput -> False], ItemBox["\<\"\"\>", BaseStyle -> "InformationUsageSubtitleBackground", 66 | StripOnInput -> False]}, {PaneBox[GridBox[{{DynamicModuleBox[{System`InformationDump`open$$ 67 | = {False, False, False, False, False, False, False, False, False, False, 68 | False, False}}, StyleBox[GridBox[{{TagBox[TooltipBox[StyleBox["\<\" Definitions\"\>", 69 | "InformationRowLabel", StripOnInput -> False], "\"Definitions\"", TooltipStyle 70 | -> "TextStyling"], Annotation[#, "Definitions", "Tooltip"]&], GridBox[ 71 | {{RowBox[{RowBox[{"ToPython", "[", RowBox[{"Private`expression_", ",", 72 | RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", RowBox[{"Module", 73 | "[", RowBox[{RowBox[{"{", RowBox[{RowBox[{"Private`numpyprefix", "=", 74 | RowBox[{"OptionValue", "[", "Private`NumpyPrefix", "]"}]}], ",", RowBox[ 75 | {"Private`copy", "=", RowBox[{"OptionValue", "[", "Private`Copy", "]" 76 | }]}], ",", "Private`result", ",", "Private`greekrule", ",", "Private`format", 77 | ",", "Private`PythonForm", ",", "Private`np", ",", "Private`br", ",", 78 | "Private`brackets", ",", "Private`a", ",", "Private`b", ",", "Private`l", 79 | ",", "Private`m", ",", "Private`args"}], "}"}], ",", RowBox[{RowBox[ 80 | {"If", "[", RowBox[{RowBox[{"Private`numpyprefix", "\[Equal]", "\<\"\"\>" 81 | }], ",", RowBox[{"Private`np", "=", "Private`numpyprefix"}], ",", RowBox[ 82 | {"Private`np", "=", RowBox[{"Private`numpyprefix", "<>", "\<\".\"\>"} 83 | ]}]}], "]"}], ";", RowBox[{RowBox[{"Private`format", "[", RowBox[{"Private`pattern_String", 84 | ",", "Private`args__"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[ 85 | {RowBox[{"{", "Private`s", "}"}], ",", RowBox[{RowBox[{"Private`s", "=", 86 | RowBox[{"StringReplace", "[", RowBox[{"Private`pattern", ",", RowBox[ 87 | {"\<\"numpy.\"\>", "\[Rule]", "Private`np"}]}], "]"}]}], ";", RowBox[ 88 | {"ToString", "[", RowBox[{"StringForm", "[", RowBox[{"Private`s", ",", 89 | RowBox[{"Sequence", "@@", RowBox[{"Private`PythonForm", "/@", RowBox[ 90 | {"{", "Private`args", "}"}]}]}]}], "]"}], "]"}]}]}], "]"}]}], ";", RowBox[ 91 | {RowBox[{"Private`br", "[", "Private`a_", "]"}], ":=", RowBox[{"If", 92 | "[", RowBox[{RowBox[{RowBox[{"AtomQ", "[", "Private`a", "]"}], "||", 93 | RowBox[{"MemberQ", "[", RowBox[{"Private`singleFunctions", ",", RowBox[ 94 | {"Head", "[", "Private`a", "]"}]}], "]"}]}], ",", "Private`a", ",", RowBox[ 95 | {"Private`brackets", "[", "Private`a", "]"}]}], "]"}]}], ";", RowBox[ 96 | {RowBox[{"Private`PythonForm", "[", RowBox[{"Private`brackets", "[", 97 | "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[ 98 | {"\<\"(``)\"\>", ",", "Private`a"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 99 | "[", RowBox[{"-", "Private`a_"}], "]"}], ":=", RowBox[{"Private`format", 100 | "[", RowBox[{"\<\"-``\"\>", ",", RowBox[{"Private`br", "[", "Private`a", 101 | "]"}]}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", SuperscriptBox[ 102 | "Private`a_", RowBox[{"Rational", "[", RowBox[{"1", ",", "2"}], "]"}] 103 | ], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"numpy.sqrt(``)\"\>", 104 | ",", "Private`a"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 105 | "[", FractionBox["Private`a_", "Private`b_"], "]"}], ":=", RowBox[{"Private`format", 106 | "[", RowBox[{"\<\"`` / ``\"\>", ",", RowBox[{"Private`br", "[", "Private`a", 107 | "]"}], ",", RowBox[{"Private`br", "[", "Private`b", "]"}]}], "]"}]}], 108 | ";", RowBox[{StyleBox[RowBox[{"ToPython", "::", "hasDerivative"}], "MessageName" 109 | ], "=", "\<\"Dervatives are not supported\"\>"}], ";", RowBox[{RowBox[ 110 | {"Private`PythonForm", "[", RowBox[{"Derivative", "[", "___", "]"}], 111 | "]"}], ":=", RowBox[{"(", RowBox[{RowBox[{"Message", "[", StyleBox[RowBox[ 112 | {"ToPython", "::", "hasDerivative"}], "MessageName"], "]"}], ";", RowBox[ 113 | {"Abort", "[", "]"}]}], ")"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 114 | "[", RowBox[{"Rational", "[", RowBox[{"Private`a_", ",", "Private`b_" 115 | }], "]"}], "]"}], ":=", RowBox[{"ToString", "[", RowBox[{RowBox[{"N", 116 | "[", RowBox[{FractionBox["Private`a", "Private`b"], ",", "$MachinePrecision" 117 | }], "]"}], ",", "FortranForm"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 118 | "[", "Private`a_Rational", "]"}], ":=", RowBox[{"ToString", "[", RowBox[ 119 | {RowBox[{"N", "[", RowBox[{"Private`a", ",", "$MachinePrecision"}], "]" 120 | }], ",", "FortranForm"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 121 | "[", RowBox[{"Complex", "[", RowBox[{"Private`a_", ",", "Private`b_" 122 | }], "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"complex(``, ``)\"\>", 123 | ",", "Private`a", ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{ 124 | "Private`PythonForm", "[", RowBox[{"Private`a_", " ", "Private`b__"}], 125 | "]"}], ":=", RowBox[{"Module", "[", RowBox[{RowBox[{"{", RowBox[{"Private`fs", 126 | ",", RowBox[{"Private`bl", "=", RowBox[{"{", "Private`b", "}"}]}]}], 127 | "}"}], ",", RowBox[{RowBox[{"Private`fs", "=", RowBox[{"StringRiffle", 128 | "[", RowBox[{RowBox[{"ConstantArray", "[", RowBox[{"\<\"``\"\>", ",", 129 | RowBox[{"1", "+", RowBox[{"Length", "[", "Private`bl", "]"}]}]}], "]" 130 | }], ",", "\<\" * \"\>"}], "]"}]}], ";", RowBox[{"Private`format", "[", 131 | RowBox[{"Private`fs", ",", RowBox[{"Private`br", "[", "Private`a", "]" 132 | }], ",", RowBox[{"Sequence", "@@", RowBox[{"Private`br", "/@", "Private`bl" 133 | }]}]}], "]"}]}]}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 134 | "[", RowBox[{"Private`a_", "+", "Private`b_"}], "]"}], ":=", RowBox[ 135 | {"Private`format", "[", RowBox[{"\<\"`` + ``\"\>", ",", "Private`a", 136 | ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 137 | "[", SuperscriptBox["Private`a_", "Private`b_"], "]"}], ":=", RowBox[ 138 | {"Private`format", "[", RowBox[{"\<\"`` ** ``\"\>", ",", RowBox[{"Private`br", 139 | "[", "Private`a", "]"}], ",", RowBox[{"Private`br", "[", "Private`b", 140 | "]"}]}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[ 141 | {"Exp", "[", "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", 142 | "[", RowBox[{"\<\"numpy.exp(``)\"\>", ",", "Private`a"}], "]"}]}], ";", 143 | RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"Max", "[", RowBox[ 144 | {"Private`a_", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 145 | "[", RowBox[{"\<\"numpy.maximum(`1`, `2`)\"\>", ",", "Private`a", ",", 146 | "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", 147 | RowBox[{"Min", "[", RowBox[{"Private`a_", ",", "Private`b_"}], "]"}], 148 | "]"}], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"numpy.minimum(`1`, `2`)\"\>", 149 | ",", "Private`a", ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{ 150 | "Private`PythonForm", "[", RowBox[{"Arg", "[", "Private`a_", "]"}], "]" 151 | }], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"numpy.angle(``)\"\>", 152 | ",", "Private`a"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 153 | "[", RowBox[{"SphericalHarmonicY", "[", RowBox[{"Private`l_", ",", "Private`m_", 154 | ",", "Private`a_", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{ 155 | "Private`format", "[", RowBox[{"\<\"special.sph_harm(``, ``, (``) % (2 * numpy.pi), (``) % numpy.pi)\"\>", 156 | ",", "Private`m", ",", "Private`l", ",", "Private`b", ",", "Private`a" 157 | }], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{ 158 | "Gamma", "[", "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", 159 | "[", RowBox[{"\<\"special.gamma(``)\"\>", ",", "Private`a"}], "]"}]} 160 | ], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"Gamma", "[", 161 | RowBox[{"Private`a_", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[ 162 | {"Private`format", "[", RowBox[{"\<\"special.gamma(`1`) * special.gammaincc(`1`, `2`)\"\>", 163 | ",", "Private`a", ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{ 164 | "Private`PythonForm", "[", RowBox[{"BesselI", "[", RowBox[{"0", ",", 165 | "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[ 166 | {"\<\"special.i0(``)\"\>", ",", "Private`b"}], "]"}]}], ";", RowBox[{ 167 | RowBox[{"Private`PythonForm", "[", RowBox[{"BesselJ", "[", RowBox[{"0", 168 | ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", "[", 169 | RowBox[{"\<\"special.j0(``)\"\>", ",", "Private`b"}], "]"}]}], ";", 170 | RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselK", "[", RowBox[ 171 | {"0", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 172 | "[", RowBox[{"\<\"special.k0(``)\"\>", ",", "Private`b"}], "]"}]}], 173 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselY", "[", 174 | RowBox[{"0", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 175 | "[", RowBox[{"\<\"special.y0(``)\"\>", ",", "Private`b"}], "]"}]}], 176 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselI", "[", 177 | RowBox[{"1", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 178 | "[", RowBox[{"\<\"special.i1(``)\"\>", ",", "Private`b"}], "]"}]}], 179 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselJ", "[", 180 | RowBox[{"1", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 181 | "[", RowBox[{"\<\"special.j1(``)\"\>", ",", "Private`b"}], "]"}]}], 182 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselK", "[", 183 | RowBox[{"1", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 184 | "[", RowBox[{"\<\"special.k1(``)\"\>", ",", "Private`b"}], "]"}]}], 185 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselY", "[", 186 | RowBox[{"1", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", 187 | "[", RowBox[{"\<\"special.y1(``)\"\>", ",", "Private`b"}], "]"}]}], 188 | ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"BesselI", "[", 189 | RowBox[{"Private`a_", ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[ 190 | {"Private`format", "[", RowBox[{"\<\"special.iv(``, ``)\"\>", ",", "Private`a", 191 | ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 192 | "[", RowBox[{"BesselJ", "[", RowBox[{"Private`a_", ",", "Private`b_" 193 | }], "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"special.jv(``, ``)\"\>", 194 | ",", "Private`a", ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{ 195 | "Private`PythonForm", "[", RowBox[{"BesselK", "[", RowBox[{"Private`a_", 196 | ",", "Private`b_"}], "]"}], "]"}], ":=", RowBox[{"Private`format", "[", 197 | RowBox[{"\<\"special.kn(``, ``)\"\>", ",", "Private`a", ",", "Private`b" 198 | }], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{ 199 | "BesselY", "[", RowBox[{"Private`a_", ",", "Private`b_"}], "]"}], "]" 200 | }], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"special.yn(``, ``)\"\>", 201 | ",", "Private`a", ",", "Private`b"}], "]"}]}], ";", RowBox[{RowBox[{ 202 | "Private`PythonForm", "[", RowBox[{"Csc", "[", "Private`a_", "]"}], "]" 203 | }], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"1 / numpy.sin(``)\"\>", 204 | ",", "Private`a"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 205 | "[", RowBox[{"Sec", "[", "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", 206 | "[", RowBox[{"\<\"1 / numpy.cos(``)\"\>", ",", "Private`a"}], "]"}]} 207 | ], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{"Cot", "[", 208 | "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[ 209 | {"\<\"1 / numpy.tan(``)\"\>", ",", "Private`a"}], "]"}]}], ";", RowBox[ 210 | {RowBox[{"Private`PythonForm", "[", RowBox[{"Csch", "[", "Private`a_", 211 | "]"}], "]"}], ":=", RowBox[{"Private`format", "[", RowBox[{"\<\"1 / numpy.sinh(``)\"\>", 212 | ",", "Private`a"}], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 213 | "[", RowBox[{"Sech", "[", "Private`a_", "]"}], "]"}], ":=", RowBox[{ 214 | "Private`format", "[", RowBox[{"\<\"1 / numpy.cosh(``)\"\>", ",", "Private`a" 215 | }], "]"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", RowBox[{ 216 | "Coth", "[", "Private`a_", "]"}], "]"}], ":=", RowBox[{"Private`format", 217 | "[", RowBox[{"\<\"1 / numpy.tanh(``)\"\>", ",", "Private`a"}], "]"}] 218 | }], ";", RowBox[{RowBox[{"Private`PythonForm", "[", "Private`a_NumericArray", 219 | "]"}], ":=", RowBox[{"Private`np", "<>", "\<\"array(\"\>", "<>", RowBox[ 220 | {"StringReplace", "[", RowBox[{RowBox[{"ToString", "[", RowBox[{"Normal", 221 | "[", "Private`a", "]"}], "]"}], ",", RowBox[{"{", RowBox[{RowBox[{"\<\"{\"\>", 222 | "\[Rule]", "\<\"[\"\>"}], ",", RowBox[{"\<\"}\"\>", "\[Rule]", "\<\"]\"\>" 223 | }]}], "}"}]}], "]"}], "<>", "\<\")\"\>"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 224 | "[", RowBox[{"{", "Private`args__", "}"}], "]"}], ":=", RowBox[{"Private`np", 225 | "<>", "\<\"array([\"\>", "<>", RowBox[{"StringRiffle", "[", RowBox[{ 226 | RowBox[{"Private`PythonForm", "/@", RowBox[{"{", "Private`args", "}"} 227 | ]}], ",", "\<\", \"\>"}], "]"}], "<>", "\<\"])\"\>"}]}], ";", RowBox[ 228 | {RowBox[{"Private`PythonForm", "[", "\[Pi]", "]"}], "=", RowBox[{"Private`np", 229 | "<>", "\<\"pi\"\>"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", "[", 230 | "\[ExponentialE]", "]"}], "=", RowBox[{"Private`np", "<>", "\<\"e\"\>" 231 | }]}], ";", RowBox[{"Private`greekrule", "=", RowBox[{"{", RowBox[{RowBox[ 232 | {"\<\"\[Alpha]\"\>", "\[Rule]", "\<\"alpha\"\>"}], ",", RowBox[{"\<\"\[Beta]\"\>", 233 | "\[Rule]", "\<\"beta\"\>"}], ",", RowBox[{"\<\"\[Gamma]\"\>", "\[Rule]", 234 | "\<\"gamma\"\>"}], ",", RowBox[{"\<\"\[Delta]\"\>", "\[Rule]", "\<\"delta\"\>" 235 | }], ",", RowBox[{"\<\"\[CurlyEpsilon]\"\>", "\[Rule]", "\<\"curlyepsilon\"\>" 236 | }], ",", RowBox[{"\<\"\[Zeta]\"\>", "\[Rule]", "\<\"zeta\"\>"}], ",", 237 | RowBox[{"\<\"\[Eta]\"\>", "\[Rule]", "\<\"eta\"\>"}], ",", RowBox[{"\<\"\[Theta]\"\>", 238 | "\[Rule]", "\<\"theta\"\>"}], ",", RowBox[{"\<\"\[Iota]\"\>", "\[Rule]", 239 | "\<\"iota\"\>"}], ",", RowBox[{"\<\"\[Kappa]\"\>", "\[Rule]", "\<\"kappa\"\>" 240 | }], ",", RowBox[{"\<\"\[Lambda]\"\>", "\[Rule]", "\<\"lambda\"\>"}], 241 | ",", RowBox[{"\<\"\[Mu]\"\>", "\[Rule]", "\<\"mu\"\>"}], ",", RowBox[ 242 | {"\<\"\[Nu]\"\>", "\[Rule]", "\<\"nu\"\>"}], ",", RowBox[{"\<\"\[Xi]\"\>", 243 | "\[Rule]", "\<\"xi\"\>"}], ",", RowBox[{"\<\"\[Omicron]\"\>", "\[Rule]", 244 | "\<\"omicron\"\>"}], ",", RowBox[{"\<\"\[Pi]\"\>", "\[Rule]", "\<\"pi\"\>" 245 | }], ",", RowBox[{"\<\"\[Rho]\"\>", "\[Rule]", "\<\"rho\"\>"}], ",", RowBox[ 246 | {"\<\"\[FinalSigma]\"\>", "\[Rule]", "\<\"finalsigma\"\>"}], ",", RowBox[ 247 | {"\<\"\[Sigma]\"\>", "\[Rule]", "\<\"sigma\"\>"}], ",", RowBox[{"\<\"\[Tau]\"\>", 248 | "\[Rule]", "\<\"tau\"\>"}], ",", RowBox[{"\<\"\[Upsilon]\"\>", "\[Rule]", 249 | "\<\"upsilon\"\>"}], ",", RowBox[{"\<\"\[CurlyPhi]\"\>", "\[Rule]", 250 | "\<\"curlyphi\"\>"}], ",", RowBox[{"\<\"\[Chi]\"\>", "\[Rule]", "\<\"chi\"\>" 251 | }], ",", RowBox[{"\<\"\[Phi]\"\>", "\[Rule]", "\<\"phi\"\>"}], ",", RowBox[ 252 | {"\<\"\[Psi]\"\>", "\[Rule]", "\<\"psi\"\>"}], ",", RowBox[{"\<\"\[Omega]\"\>", 253 | "\[Rule]", "\<\"omega\"\>"}], ",", RowBox[{"\<\"\[CapitalAlpha]\"\>", 254 | "\[Rule]", "\<\"Alpha\"\>"}], ",", RowBox[{"\<\"\[CapitalBeta]\"\>", 255 | "\[Rule]", "\<\"Beta\"\>"}], ",", RowBox[{"\<\"\[CapitalGamma]\"\>", 256 | "\[Rule]", "\<\"Gamma\"\>"}], ",", RowBox[{"\<\"\[CapitalDelta]\"\>", 257 | "\[Rule]", "\<\"Delta\"\>"}], ",", RowBox[{"\<\"\[CapitalEpsilon]\"\>", 258 | "\[Rule]", "\<\"CurlyEpsilon\"\>"}], ",", RowBox[{"\<\"\[CapitalZeta]\"\>", 259 | "\[Rule]", "\<\"Zeta\"\>"}], ",", RowBox[{"\<\"\[CapitalEta]\"\>", "\[Rule]", 260 | "\<\"Eta\"\>"}], ",", RowBox[{"\<\"\[CapitalTheta]\"\>", "\[Rule]", 261 | "\<\"Theta\"\>"}], ",", RowBox[{"\<\"\[CapitalIota]\"\>", "\[Rule]", 262 | "\<\"Iota\"\>"}], ",", RowBox[{"\<\"\[CapitalKappa]\"\>", "\[Rule]", 263 | "\<\"Kappa\"\>"}], ",", RowBox[{"\<\"\[CapitalLambda]\"\>", "\[Rule]", 264 | "\<\"Lambda\"\>"}], ",", RowBox[{"\<\"\[CapitalMu]\"\>", "\[Rule]", 265 | "\<\"Mu\"\>"}], ",", RowBox[{"\<\"\[CapitalNu]\"\>", "\[Rule]", "\<\"Nu\"\>" 266 | }], ",", RowBox[{"\<\"\[CapitalXi]\"\>", "\[Rule]", "\<\"Xi\"\>"}], ",", 267 | RowBox[{"\<\"\[CapitalOmicron]\"\>", "\[Rule]", "\<\"Omicron\"\>"}], 268 | ",", RowBox[{"\<\"\[CapitalPi]\"\>", "\[Rule]", "\<\"Pi\"\>"}], ",", 269 | RowBox[{"\<\"\[CapitalRho]\"\>", "\[Rule]", "\<\"Rho\"\>"}], ",", RowBox[ 270 | {"\<\"\[CapitalSigma]\"\>", "\[Rule]", "\<\"Sigma\"\>"}], ",", RowBox[ 271 | {"\<\"\[CapitalTau]\"\>", "\[Rule]", "\<\"Tau\"\>"}], ",", RowBox[{"\<\"\[CapitalUpsilon]\"\>", 272 | "\[Rule]", "\<\"Upsilon\"\>"}], ",", RowBox[{"\<\"\[CapitalPhi]\"\>", 273 | "\[Rule]", "\<\"CurlyPhi\"\>"}], ",", RowBox[{"\<\"\[CapitalChi]\"\>", 274 | "\[Rule]", "\<\"Chi\"\>"}], ",", RowBox[{"\<\"\[CapitalPsi]\"\>", "\[Rule]", 275 | "\<\"Psi\"\>"}], ",", RowBox[{"\<\"\[CapitalOmega]\"\>", "\[Rule]", 276 | "\<\"Omega\"\>"}]}], "}"}]}], ";", RowBox[{RowBox[{"Private`PythonForm", 277 | "[", RowBox[{"Private`h_", "[", "Private`args__", "]"}], "]"}], ":=", 278 | RowBox[{"Private`np", "<>", RowBox[{"ToLowerCase", "[", RowBox[{"Private`PythonForm", 279 | "[", "Private`h", "]"}], "]"}], "<>", "\<\"(\"\>", "<>", RowBox[{"Private`PythonForm", 280 | "[", "Private`args", "]"}], "<>", "\<\")\"\>"}]}], ";", RowBox[{RowBox[ 281 | {"Private`PythonForm", "[", "Private`allOther_", "]"}], ":=", RowBox[ 282 | {"StringReplace", "[", RowBox[{RowBox[{"ToString", "[", RowBox[{"Private`allOther", 283 | ",", "FortranForm"}], "]"}], ",", "Private`greekrule"}], "]"}]}], ";", 284 | RowBox[{"Private`result", "=", RowBox[{"StringReplace", "[", RowBox[ 285 | {RowBox[{"Private`PythonForm", "[", "Private`expression", "]"}], ",", 286 | "Private`greekrule"}], "]"}]}], ";", RowBox[{"If", "[", RowBox[{"Private`copy", 287 | ",", RowBox[{"CopyToClipboard", "[", "Private`result", "]"}]}], "]"} 288 | ], ";", "Private`result"}]}], "]"}]}]}}, DefaultBaseStyle -> "Column", 289 | GridBoxAlignment -> {"Columns" -> {{Left}}}, GridBoxItemSize -> {"Columns" 290 | -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, {TagBox[TooltipBox[StyleBox[ 291 | "\<\" Options\"\>", "InformationRowLabel", StripOnInput -> False], "\"Options\"", 292 | TooltipStyle -> "TextStyling"], Annotation[#, "Options", "Tooltip"]& 293 | ], RowBox[{"{", RowBox[{RowBox[{"Private`NumpyPrefix", "\[Rule]", "\<\"np\"\>" 294 | }], ",", RowBox[{"Private`Copy", "\[Rule]", "False"}]}], "}"}]}, {TagBox[ 295 | TooltipBox[StyleBox["\<\" Full Name\"\>", "InformationRowLabel", StripOnInput 296 | -> False], "\"FullName\"", TooltipStyle -> "TextStyling"], Annotation[ 297 | #, "FullName", "Tooltip"]&], "\<\"ToPython`ToPython\"\>"}}, AutoDelete 298 | -> False, GridBoxAlignment -> {"Columns" -> {Right, Left}}, GridBoxDividers 299 | -> None, GridBoxItemSize -> {"Columns" -> {Automatic, Automatic}}, GridBoxSpacings 300 | -> {"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999 301 | ]}, Offset[0.27999999999999997`]}, "Rows" -> {Offset[0.2], {Offset[0.8 302 | ]}, Offset[0.2]}}], "DialogStyle", StripOnInput -> False], DynamicModuleValues 303 | :> {}]}}, DefaultBaseStyle -> "Column", GridBoxAlignment -> {"Columns" 304 | -> {{Left}}}, GridBoxDividers -> {"Columns" -> {{False}}, "Rows" -> 305 | {{False}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> 306 | {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {Offset[0.27999999999999997` 307 | ], {Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "Rows" 308 | -> {Offset[0.2], {Offset[3.6]}, Offset[0.2]}}], FrameMargins -> 6], 309 | ""}, {ItemBox[TagBox[ButtonBox[PaneSelectorBox[{False -> DynamicBox[FEPrivate`FrontEndResource[ 310 | "FEBitmaps", "UpPointerOpener"]], True -> DynamicBox[FEPrivate`FrontEndResource[ 311 | "FEBitmaps", "UpPointerOpenerHot"]]}, Dynamic[System`InformationDump`mouseOver$$ 312 | ]], Alignment -> Left, Appearance -> {"Default" -> None}, ButtonFunction 313 | :> FEPrivate`Set[System`InformationDump`open$$, False], Evaluator -> 314 | Automatic, FrameMargins -> {{9, 0}, {0, 0}}, ImageMargins -> 0, ImageSize 315 | -> Full, Method -> "Preemptive"], EventHandlerTag[{"MouseEntered" :> 316 | FEPrivate`Set[System`InformationDump`mouseOver$$, True], "MouseExited" 317 | :> FEPrivate`Set[System`InformationDump`mouseOver$$, False], Method 318 | -> "Preemptive", PassEventsDown -> Automatic, PassEventsUp -> True}]], 319 | BaseStyle -> "InformationTitleBackground", StripOnInput -> False], "\[SpanFromLeft]" 320 | }}, AutoDelete -> False, FrameStyle -> Directive[GrayLevel[0.8], Thickness[ 321 | Tiny]], GridBoxAlignment -> {"Columns" -> {Left, Right}, "Rows" -> {{ 322 | Center}}}, GridBoxDividers -> {"Columns" -> {{None}}, "Rows" -> {False, 323 | {True}, False}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" 324 | -> {{Automatic}}}], "Grid"], False -> TagBox[GridBox[{{ItemBox[PaneBox[ 325 | StyleBox["\<\" Symbol\"\>", "InformationTitleText", StripOnInput -> False 326 | ], FrameMargins -> {{4, 0}, {-1, 1}}], BaseStyle -> "InformationTitleBackground", 327 | StripOnInput -> False], ItemBox["\<\"\"\>", BaseStyle -> "InformationTitleBackground", 328 | StripOnInput -> False]}, {ItemBox[PaneBox[StyleBox["\<\"ToPython[expression, NumpyPrefix->\\\"np\\\", Copy->False]\\n\\tconverts Mathematica expression to a Numpy compatible expression. Because Numpy can\\n\\tbe imported in several ways, you can specify the name of the numpy module using the\\n NumpyPrefix option. The additional option Copy allows you to copy the result to the clipboard\"\>", 329 | "InformationUsageText", StripOnInput -> False, LineSpacing -> {1.5, 330 | 1.5, 3.}], FrameMargins -> {{10, 10}, {8, 10}}], BaseStyle -> "InformationUsageSubtitleBackground", 331 | StripOnInput -> False], ItemBox["\<\"\"\>", BaseStyle -> "InformationUsageSubtitleBackground", 332 | StripOnInput -> False]}, {ItemBox[TagBox[ButtonBox[PaneSelectorBox[{ 333 | False -> DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "DownPointerOpener" 334 | ], ImageSizeCache -> {10., {2., 8.}}], True -> DynamicBox[FEPrivate`FrontEndResource[ 335 | "FEBitmaps", "DownPointerOpenerHot"], ImageSizeCache -> {10., {2., 8. 336 | }}]}, Dynamic[System`InformationDump`mouseOver$$]], Alignment -> Left, 337 | Appearance -> {"Default" -> None}, ButtonFunction :> FEPrivate`Set[System`InformationDump`open$$, 338 | True], Evaluator -> Automatic, FrameMargins -> {{9, 0}, {0, 0}}, ImageMargins 339 | -> 0, ImageSize -> Full, Method -> "Preemptive"], EventHandlerTag[{"MouseEntered" 340 | :> FEPrivate`Set[System`InformationDump`mouseOver$$, True], "MouseExited" 341 | :> FEPrivate`Set[System`InformationDump`mouseOver$$, False], Method 342 | -> "Preemptive", PassEventsDown -> Automatic, PassEventsUp -> True}]], 343 | BaseStyle -> "InformationTitleBackground", StripOnInput -> False], "\[SpanFromLeft]" 344 | }}, AutoDelete -> False, FrameStyle -> Directive[GrayLevel[0.8], Thickness[ 345 | Tiny]], GridBoxAlignment -> {"Columns" -> {Left, Right}, "Rows" -> {{ 346 | Center}}}, GridBoxDividers -> {"Columns" -> {{None}}, "Rows" -> {False, 347 | {True}, False}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" 348 | -> {{Automatic}}}], "Grid"]}, Dynamic[System`InformationDump`open$$], 349 | BaselinePosition -> Baseline, FrameMargins -> 0, ImageSize -> Automatic 350 | ], DynamicModuleValues :> {}], BaseStyle -> "InformationGridFrame", StripOnInput 351 | -> False], "InformationGridPlain", StripOnInput -> False] 352 | , 353 | InformationData[ 354 | Association[ 355 | "ObjectType" -> "Symbol" 356 | , 357 | "Usage" -> "ToPython[expression, NumpyPrefix->\"np\", Copy->False]\n\tconverts Mathematica expression to a Numpy compatible expression. Because Numpy can\n\tbe imported in several ways, you can specify the name of the numpy module using the\n NumpyPrefix option. The additional option Copy allows you to copy the result to the clipboard" 358 | 359 | , 360 | "Documentation" -> None 361 | , 362 | "OwnValues" -> None 363 | , 364 | "UpValues" -> None 365 | , 366 | "DownValues" -> 367 | Information`InformationValueForm[ 368 | DownValues 369 | , 370 | ToPython`ToPython 371 | , 372 | { 373 | ToPython`ToPython[Pattern[Private`expression, 374 | Blank[]], OptionsPattern[]] :> 375 | Module[{Private`numpyprefix = OptionValue[ 376 | Private`NumpyPrefix], Private`copy = OptionValue[Private`Copy], Private`result, 377 | Private`greekrule, Private`format, Private`PythonForm, Private`np, Private`br, 378 | Private`brackets, Private`a, Private`b, Private`l, Private`m, Private`args 379 | }, 380 | If[Private`numpyprefix == "", 381 | Private`np = Private`numpyprefix 382 | , 383 | Private`np = StringJoin[Private`numpyprefix, 384 | "."] 385 | ]; 386 | Private`format[Pattern[Private`pattern, 387 | Blank[String]], Pattern[Private`args, BlankSequence[]]] := 388 | Module[{Private`s}, 389 | Private`s = StringReplace[Private`pattern, 390 | "numpy." -> Private`np]; 391 | ToString[StringForm[Private`s, Apply[ 392 | Sequence, Map[Private`PythonForm, {Private`args}]]]] 393 | ]; 394 | Private`br[Pattern[Private`a, Blank[]]] 395 | := 396 | If[Or[AtomQ[Private`a], MemberQ[Private`singleFunctions, 397 | Head[Private`a]]], 398 | Private`a 399 | , 400 | Private`brackets[Private`a] 401 | ]; 402 | Private`PythonForm[Private`brackets[Pattern[ 403 | Private`a, Blank[]]]] := Private`format["(``)", Private`a]; 404 | Private`PythonForm[-Pattern[Private`a, 405 | Blank[]]] := Private`format["-``", Private`br[Private`a]]; 406 | Private`PythonForm[Pattern[Private`a, Blank[ 407 | ]] ^ Rational[1, 2]] := Private`format["numpy.sqrt(``)", Private`a]; 408 | Private`PythonForm[Pattern[Private`a, Blank[ 409 | ]] / Pattern[Private`b, Blank[]]] := Private`format["`` / ``", Private`br[ 410 | Private`a], Private`br[Private`b]]; 411 | MessageName[ToPython`ToPython, "hasDerivative" 412 | ] = "Dervatives are not supported"; 413 | Private`PythonForm[Derivative[BlankNullSequence[ 414 | ]]] := 415 | ( 416 | Message[MessageName[ToPython`ToPython, 417 | "hasDerivative"]]; 418 | Abort[] 419 | ); 420 | Private`PythonForm[Rational[Pattern[Private`a, 421 | Blank[]], Pattern[Private`b, Blank[]]]] := ToString[N[Private`a / Private`b, 422 | $MachinePrecision], FortranForm]; 423 | Private`PythonForm[Pattern[Private`a, Blank[ 424 | Rational]]] := ToString[N[Private`a, $MachinePrecision], FortranForm] 425 | ; 426 | Private`PythonForm[Complex[Pattern[Private`a, 427 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["complex(``, ``)", 428 | Private`a, Private`b]; 429 | Private`PythonForm[Pattern[Private`a, Blank[ 430 | ]] Pattern[Private`b, BlankSequence[]]] := 431 | Module[{Private`fs, Private`bl = {Private`b 432 | }}, 433 | Private`fs = StringRiffle[ConstantArray[ 434 | "``", 1 + Length[Private`bl]], " * "]; 435 | Private`format[Private`fs, Private`br[ 436 | Private`a], Apply[Sequence, Map[Private`br, Private`bl]]] 437 | ]; 438 | Private`PythonForm[Pattern[Private`a, Blank[ 439 | ]] + Pattern[Private`b, Blank[]]] := Private`format["`` + ``", Private`a, 440 | Private`b]; 441 | Private`PythonForm[Pattern[Private`a, Blank[ 442 | ]] ^ Pattern[Private`b, Blank[]]] := Private`format["`` ** ``", Private`br[ 443 | Private`a], Private`br[Private`b]]; 444 | Private`PythonForm[Exp[Pattern[Private`a, 445 | Blank[]]]] := Private`format["numpy.exp(``)", Private`a]; 446 | Private`PythonForm[Max[Pattern[Private`a, 447 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["numpy.maximum(`1`, `2`)", 448 | Private`a, Private`b]; 449 | Private`PythonForm[Min[Pattern[Private`a, 450 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["numpy.minimum(`1`, `2`)", 451 | Private`a, Private`b]; 452 | Private`PythonForm[Arg[Pattern[Private`a, 453 | Blank[]]]] := Private`format["numpy.angle(``)", Private`a]; 454 | Private`PythonForm[SphericalHarmonicY[Pattern[ 455 | Private`l, Blank[]], Pattern[Private`m, Blank[]], Pattern[Private`a, 456 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.sph_harm(``, ``, (``) % (2 * numpy.pi), (``) % numpy.pi)", 457 | Private`m, Private`l, Private`b, Private`a]; 458 | Private`PythonForm[Gamma[Pattern[Private`a, 459 | Blank[]]]] := Private`format["special.gamma(``)", Private`a]; 460 | Private`PythonForm[Gamma[Pattern[Private`a, 461 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.gamma(`1`) * special.gammaincc(`1`, `2`)", 462 | Private`a, Private`b]; 463 | Private`PythonForm[BesselI[0, Pattern[Private`b, 464 | Blank[]]]] := Private`format["special.i0(``)", Private`b]; 465 | Private`PythonForm[BesselJ[0, Pattern[Private`b, 466 | Blank[]]]] := Private`format["special.j0(``)", Private`b]; 467 | Private`PythonForm[BesselK[0, Pattern[Private`b, 468 | Blank[]]]] := Private`format["special.k0(``)", Private`b]; 469 | Private`PythonForm[BesselY[0, Pattern[Private`b, 470 | Blank[]]]] := Private`format["special.y0(``)", Private`b]; 471 | Private`PythonForm[BesselI[1, Pattern[Private`b, 472 | Blank[]]]] := Private`format["special.i1(``)", Private`b]; 473 | Private`PythonForm[BesselJ[1, Pattern[Private`b, 474 | Blank[]]]] := Private`format["special.j1(``)", Private`b]; 475 | Private`PythonForm[BesselK[1, Pattern[Private`b, 476 | Blank[]]]] := Private`format["special.k1(``)", Private`b]; 477 | Private`PythonForm[BesselY[1, Pattern[Private`b, 478 | Blank[]]]] := Private`format["special.y1(``)", Private`b]; 479 | Private`PythonForm[BesselI[Pattern[Private`a, 480 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.iv(``, ``)", 481 | Private`a, Private`b]; 482 | Private`PythonForm[BesselJ[Pattern[Private`a, 483 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.jv(``, ``)", 484 | Private`a, Private`b]; 485 | Private`PythonForm[BesselK[Pattern[Private`a, 486 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.kn(``, ``)", 487 | Private`a, Private`b]; 488 | Private`PythonForm[BesselY[Pattern[Private`a, 489 | Blank[]], Pattern[Private`b, Blank[]]]] := Private`format["special.yn(``, ``)", 490 | Private`a, Private`b]; 491 | Private`PythonForm[Csc[Pattern[Private`a, 492 | Blank[]]]] := Private`format["1 / numpy.sin(``)", Private`a]; 493 | Private`PythonForm[Sec[Pattern[Private`a, 494 | Blank[]]]] := Private`format["1 / numpy.cos(``)", Private`a]; 495 | Private`PythonForm[Cot[Pattern[Private`a, 496 | Blank[]]]] := Private`format["1 / numpy.tan(``)", Private`a]; 497 | Private`PythonForm[Csch[Pattern[Private`a, 498 | Blank[]]]] := Private`format["1 / numpy.sinh(``)", Private`a]; 499 | Private`PythonForm[Sech[Pattern[Private`a, 500 | Blank[]]]] := Private`format["1 / numpy.cosh(``)", Private`a]; 501 | Private`PythonForm[Coth[Pattern[Private`a, 502 | Blank[]]]] := Private`format["1 / numpy.tanh(``)", Private`a]; 503 | Private`PythonForm[Pattern[Private`a, Blank[ 504 | NumericArray]]] := StringJoin[Private`np, "array(", StringReplace[ToString[ 505 | Normal[Private`a]], {"{" -> "[", "}" -> "]"}], ")"]; 506 | Private`PythonForm[{Pattern[Private`args, 507 | BlankSequence[]]}] := StringJoin[Private`np, "array([", StringRiffle[ 508 | Map[Private`PythonForm, {Private`args}], ", "], "])"]; 509 | Private`PythonForm[Pi] = StringJoin[Private`np, 510 | "pi"]; 511 | Private`PythonForm[E] = StringJoin[Private`np, 512 | "e"]; 513 | Private`greekrule = {"\[Alpha]" -> "alpha", 514 | "\[Beta]" -> "beta", "\[Gamma]" -> "gamma", "\[Delta]" -> "delta", "\[CurlyEpsilon]" 515 | -> "curlyepsilon", "\[Zeta]" -> "zeta", "\[Eta]" -> "eta", "\[Theta]" 516 | -> "theta", "\[Iota]" -> "iota", "\[Kappa]" -> "kappa", "\[Lambda]" 517 | -> "lambda", "\[Mu]" -> "mu", "\[Nu]" -> "nu", "\[Xi]" -> "xi", "\[Omicron]" 518 | -> "omicron", "\[Pi]" -> "pi", "\[Rho]" -> "rho", "\[FinalSigma]" -> 519 | "finalsigma", "\[Sigma]" -> "sigma", "\[Tau]" -> "tau", "\[Upsilon]" 520 | -> "upsilon", "\[CurlyPhi]" -> "curlyphi", "\[Chi]" -> "chi", "\[Phi]" 521 | -> "phi", "\[Psi]" -> "psi", "\[Omega]" -> "omega", "\[CapitalAlpha]" 522 | -> "Alpha", "\[CapitalBeta]" -> "Beta", "\[CapitalGamma]" -> "Gamma", 523 | "\[CapitalDelta]" -> "Delta", "\[CapitalEpsilon]" -> "CurlyEpsilon", 524 | "\[CapitalZeta]" -> "Zeta", "\[CapitalEta]" -> "Eta", "\[CapitalTheta]" 525 | -> "Theta", "\[CapitalIota]" -> "Iota", "\[CapitalKappa]" -> "Kappa", 526 | "\[CapitalLambda]" -> "Lambda", "\[CapitalMu]" -> "Mu", "\[CapitalNu]" 527 | -> "Nu", "\[CapitalXi]" -> "Xi", "\[CapitalOmicron]" -> "Omicron", "\[CapitalPi]" 528 | -> "Pi", "\[CapitalRho]" -> "Rho", "\[CapitalSigma]" -> "Sigma", "\[CapitalTau]" 529 | -> "Tau", "\[CapitalUpsilon]" -> "Upsilon", "\[CapitalPhi]" -> "CurlyPhi", 530 | "\[CapitalChi]" -> "Chi", "\[CapitalPsi]" -> "Psi", "\[CapitalOmega]" 531 | -> "Omega"}; 532 | Private`PythonForm[Pattern[Private`h, Blank[ 533 | ]][Pattern[Private`args, BlankSequence[]]]] := StringJoin[Private`np, 534 | ToLowerCase[Private`PythonForm[Private`h]], "(", Private`PythonForm[ 535 | Private`args], ")"]; 536 | Private`PythonForm[Pattern[Private`allOther, 537 | Blank[]]] := StringReplace[ToString[Private`allOther, FortranForm], 538 | Private`greekrule]; 539 | Private`result = StringReplace[Private`PythonForm[ 540 | Private`expression], Private`greekrule]; 541 | If[Private`copy, 542 | CopyToClipboard[Private`result] 543 | ]; 544 | Private`result 545 | ] 546 | } 547 | ] 548 | , 549 | "SubValues" -> None 550 | , 551 | "DefaultValues" -> None 552 | , 553 | "NValues" -> None 554 | , 555 | "FormatValues" -> None 556 | , 557 | "Options" -> {Private`NumpyPrefix -> "np", Private`Copy 558 | -> False} 559 | , 560 | "Attributes" -> {} 561 | , 562 | "FullName" -> "ToPython`ToPython" 563 | ] 564 | , 565 | False 566 | ] 567 | ] 568 | ] 569 | , 570 | "Output" 571 | , 572 | CellChangeTimes -> {{3.846041131188478*^9, 3.846041134941896*^9 573 | }, 3.846041288348984*^9, 3.846041712356203*^9, {3.846041742478557*^9, 574 | 3.846041755771311*^9}, 3.846041872618247*^9, 3.8460423457875566`*^9, 575 | 3.846408124469769*^9, 3.8464082522938833`*^9} 576 | , 577 | CellLabel -> "Out[48]=" 578 | , 579 | ExpressionUUID -> "42c28b92-2b81-493e-bb74-e25330a1fff5" 580 | ] 581 | } 582 | , 583 | Open 584 | ] 585 | ] 586 | , 587 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", " ", "Numbers", 588 | " ", "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ToPython", "[", 589 | RowBox[{"1", "/", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", 590 | "[", RowBox[{"1", "/", "3"}], "]"}]}]}]], "Input", CellChangeTimes -> 591 | {{3.846041020933352*^9, 3.8460410297347317`*^9}, {3.846041760995372*^9, 592 | 3.846041764297275*^9}, {3.846041864881761*^9, 3.846041865835989*^9}}, 593 | CellLabel -> "In[50]:=", ExpressionUUID -> "d17288e2-6b59-4b37-b3ab-c96969989f11" 594 | ], Cell[BoxData["\<\"0.5\"\>"], "Output", CellChangeTimes -> {{3.846041025718354*^9, 595 | 3.8460410689851227`*^9}, 3.846041161606009*^9, 3.846041713588273*^9, 596 | {3.8460417559319*^9, 3.846041768151883*^9}, 3.846041872624201*^9, 3.846042345795823*^9, 597 | 3.846408252327827*^9}, CellLabel -> "Out[50]=", ExpressionUUID -> "a735febf-e560-43bd-bd6d-f914d64a4827" 598 | ], Cell[BoxData["\<\"0.3333333333333333\"\>"], "Output", CellChangeTimes 599 | -> {{3.846041025718354*^9, 3.8460410689851227`*^9}, 3.846041161606009*^9, 600 | 3.846041713588273*^9, {3.8460417559319*^9, 3.846041768151883*^9}, 3.846041872624201*^9, 601 | 3.846042345795823*^9, 3.846408252329979*^9}, CellLabel -> "Out[51]=", 602 | ExpressionUUID -> "acd027db-6e0c-4cf4-b716-fb0f2df127e2"]}, Open]] 603 | , 604 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Expression", 605 | " ", "examples"}], "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ToPython", 606 | "[", RowBox[{"a", "+", "b"}], "]"}], "\[IndentingNewLine]", RowBox[{ 607 | "ToPython", "[", RowBox[{"a", "*", "b", "*", "c"}], "]"}], "\[IndentingNewLine]", 608 | RowBox[{"ToPython", "[", RowBox[{"a", "/", "b"}], "]"}], "\[IndentingNewLine]", 609 | RowBox[{"ToPython", "[", RowBox[{RowBox[{"(", RowBox[{"a", "+", "b"} 610 | ], ")"}], "/", RowBox[{"(", RowBox[{"d", "+", "e", "+", "g"}], ")"}]} 611 | ], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", RowBox[{RowBox[ 612 | {"(", RowBox[{"a", "+", "b"}], ")"}], "^", RowBox[{"(", RowBox[{"d", 613 | "+", "e", "+", "g"}], ")"}]}], "]"}], "\[IndentingNewLine]", RowBox[{ 614 | "ToPython", "[", RowBox[{"Exp", "[", RowBox[{"a", "+", "b"}], "]"}], 615 | "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", RowBox[{RowBox[ 616 | {"Sin", "[", RowBox[{"(", RowBox[{"a", "+", "b"}], ")"}], "]"}], "/", 617 | RowBox[{"Cos", "[", RowBox[{"d", "+", "e"}], "]"}]}], "]"}], "\[IndentingNewLine]", 618 | RowBox[{"ToPython", "[", RowBox[{RowBox[{"Sin", "[", RowBox[{"(", RowBox[ 619 | {"a", "+", "b"}], ")"}], "]"}], "/", RowBox[{"Tanh", "[", RowBox[{"d", 620 | "+", "e"}], "]"}]}], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", 621 | "[", RowBox[{"\[Pi]", " ", RowBox[{"Cosh", "[", "a", "]"}]}], "]"}], 622 | "\[IndentingNewLine]", RowBox[{"ToPython", "[", RowBox[{"Log10", "[", 623 | "x", "]"}], "]"}]}]}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 624 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 625 | }, {3.82438092026691*^9, 3.824380924710678*^9}, {3.824381208382967*^9, 626 | 3.824381214615004*^9}}, CellLabel -> "In[52]:=", ExpressionUUID -> "740923fd-dd9e-45ca-b781-36fcddb044a7" 627 | ], Cell[BoxData["\<\"a + b\"\>"], "Output", CellChangeTimes -> {3.834824967993429*^9, 628 | {3.8348250027856007`*^9, 3.834825025761455*^9}, 3.834825082517449*^9, 629 | {3.834825113694745*^9, 3.834825131170567*^9}, 3.834825254557303*^9, 630 | 3.834825365719318*^9, {3.8348254306713133`*^9, 3.834825457504114*^9}, 631 | 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 3.8460410406669703`*^9 632 | }, 3.8460418726579113`*^9, 3.846042345821651*^9, 3.846408252358556*^9 633 | }, CellLabel -> "Out[52]=", ExpressionUUID -> "88214388-71e3-462b-a5be-66420571aab7" 634 | ], Cell[BoxData["\<\"a * b * c\"\>"], "Output", CellChangeTimes -> {3.834824967993429*^9, 635 | {3.8348250027856007`*^9, 3.834825025761455*^9}, 3.834825082517449*^9, 636 | {3.834825113694745*^9, 3.834825131170567*^9}, 3.834825254557303*^9, 637 | 3.834825365719318*^9, {3.8348254306713133`*^9, 3.834825457504114*^9}, 638 | 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 3.8460410406669703`*^9 639 | }, 3.8460418726579113`*^9, 3.846042345821651*^9, 3.846408252359899*^9 640 | }, CellLabel -> "Out[53]=", ExpressionUUID -> "0023fa9a-51c8-4c11-b552-d32e67f3707f" 641 | ], Cell[BoxData["\<\"a / b\"\>"], "Output", CellChangeTimes -> {3.834824967993429*^9, 642 | {3.8348250027856007`*^9, 3.834825025761455*^9}, 3.834825082517449*^9, 643 | {3.834825113694745*^9, 3.834825131170567*^9}, 3.834825254557303*^9, 644 | 3.834825365719318*^9, {3.8348254306713133`*^9, 3.834825457504114*^9}, 645 | 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 3.8460410406669703`*^9 646 | }, 3.8460418726579113`*^9, 3.846042345821651*^9, 3.8464082523613157`*^9 647 | }, CellLabel -> "Out[54]=", ExpressionUUID -> "4273074a-af87-41ce-9cc6-ae203b991c32" 648 | ], Cell[BoxData["\<\"(a + b) / (d + e + g)\"\>"], "Output", CellChangeTimes 649 | -> {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 650 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 651 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 652 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 653 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 654 | 3.846408252362858*^9}, CellLabel -> "Out[55]=", ExpressionUUID -> "bb9155fa-3227-43c3-a10a-f5d16b7cd372" 655 | ], Cell[BoxData["\<\"(a + b) ** (d + e + g)\"\>"], "Output", CellChangeTimes 656 | -> {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 657 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 658 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 659 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 660 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 661 | 3.846408252364133*^9}, CellLabel -> "Out[56]=", ExpressionUUID -> "d7158797-1d4f-401d-bb64-c29b2496c672" 662 | ], Cell[BoxData["\<\"np.exp(a + b)\"\>"], "Output", CellChangeTimes -> 663 | {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 664 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 665 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 666 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 667 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 668 | 3.84640825236545*^9}, CellLabel -> "Out[57]=", ExpressionUUID -> "e81953d6-e02b-4b0e-b543-bad8760a8b3b" 669 | ], Cell[BoxData["\<\"(1 / np.cos(d + e)) * np.sin(a + b)\"\>"], "Output", 670 | CellChangeTimes -> {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 671 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 672 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 673 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 674 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 675 | 3.846408252366715*^9}, CellLabel -> "Out[58]=", ExpressionUUID -> "9a3c9c1d-3be9-4fb8-9a18-14e65e057788" 676 | ], Cell[BoxData["\<\"(1 / np.tanh(d + e)) * np.sin(a + b)\"\>"], "Output", 677 | CellChangeTimes -> {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 678 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 679 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 680 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 681 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 682 | 3.846408252368518*^9}, CellLabel -> "Out[59]=", ExpressionUUID -> "e6d1f67c-7b2c-46c4-b5c9-122bbd12864b" 683 | ], Cell[BoxData["\<\"np.pi * np.cosh(a)\"\>"], "Output", CellChangeTimes 684 | -> {3.834824967993429*^9, {3.8348250027856007`*^9, 3.834825025761455*^9 685 | }, 3.834825082517449*^9, {3.834825113694745*^9, 3.834825131170567*^9}, 686 | 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 687 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 688 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 689 | 3.8464082523698797`*^9}, CellLabel -> "Out[60]=", ExpressionUUID -> 690 | "f275590b-eaf0-4e44-b675-c92fb2ebc858"], Cell[BoxData["\<\"np.log(x) / np.log(10)\"\>" 691 | ], "Output", CellChangeTimes -> {3.834824967993429*^9, {3.8348250027856007`*^9, 692 | 3.834825025761455*^9}, 3.834825082517449*^9, {3.834825113694745*^9, 693 | 3.834825131170567*^9}, 3.834825254557303*^9, 3.834825365719318*^9, {3.8348254306713133`*^9, 694 | 3.834825457504114*^9}, 3.834825494671575*^9, 3.83482565583664*^9, {3.84604101911229*^9, 695 | 3.8460410406669703`*^9}, 3.8460418726579113`*^9, 3.846042345821651*^9, 696 | 3.846408252371305*^9}, CellLabel -> "Out[61]=", ExpressionUUID -> "caf70baa-78be-4c50-8a77-f181a689e36f" 697 | ]}, Open]] 698 | , 699 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Expression", 700 | " ", "with", " ", "greek", " ", "letters"}], "*)"}], "\[IndentingNewLine]", 701 | RowBox[{"ToPython", "[", RowBox[{"Sin", "[", RowBox[{"\[Alpha]", "+", 702 | "\[Beta]"}], "]"}], "]"}]}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 703 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020708510957*^9}, 704 | 3.817041875624913*^9}, CellLabel -> "In[62]:=", ExpressionUUID -> "d695df00-d1d2-4318-b649-f671d424864e" 705 | ], Cell[BoxData["\<\"np.sin(alpha + beta)\"\>"], "Output", CellChangeTimes 706 | -> {{3.834825430723674*^9, 3.834825457528077*^9}, 3.8348254947234497`*^9, 707 | 3.8348256558938103`*^9, 3.8460418726745653`*^9, 3.846042345838647*^9, 708 | 3.846408252378503*^9}, CellLabel -> "Out[62]=", ExpressionUUID -> "36ad64db-329f-490b-b04e-505146c262de" 709 | ]}, Open]] 710 | , 711 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Numeric", 712 | " ", "examples"}], "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ToPython", 713 | "[", "2", "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", RowBox[ 714 | {"1", "/", "3"}], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", 715 | RowBox[{"1.0", "/", "3"}], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", 716 | "[", "2.31", "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", 717 | RowBox[{"2.31", "+", RowBox[{"5.3", "I"}]}], "]"}]}]}]], "Input", CellChangeTimes 718 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 719 | 3.817020708510957*^9}, {3.817041939215971*^9, 3.817041941599523*^9}}, 720 | CellLabel -> "In[63]:=", ExpressionUUID -> "5185dd86-dec4-4c26-8e48-124321882ccc" 721 | ], Cell[BoxData["\<\"2\"\>"], "Output", CellChangeTimes -> {{3.8348254307300167`*^9, 722 | 3.834825457566633*^9}, 3.834825494730929*^9, 3.834825655900078*^9, 3.846041872712222*^9, 723 | 3.8460423458778563`*^9, 3.846408252420711*^9}, CellLabel -> "Out[63]=", 724 | ExpressionUUID -> "34ff0311-ced8-4ed5-9f19-3c5c313b48f6"], Cell[BoxData[ 725 | "\<\"0.3333333333333333\"\>"], "Output", CellChangeTimes -> {{3.8348254307300167`*^9, 726 | 3.834825457566633*^9}, 3.834825494730929*^9, 3.834825655900078*^9, 3.846041872712222*^9, 727 | 3.8460423458778563`*^9, 3.846408252422104*^9}, CellLabel -> "Out[64]=", 728 | ExpressionUUID -> "ff1f2ab9-65bf-440e-b271-3b059595e619"], Cell[BoxData[ 729 | "\<\"0.3333333333333333\"\>"], "Output", CellChangeTimes -> {{3.8348254307300167`*^9, 730 | 3.834825457566633*^9}, 3.834825494730929*^9, 3.834825655900078*^9, 3.846041872712222*^9, 731 | 3.8460423458778563`*^9, 3.846408252423403*^9}, CellLabel -> "Out[65]=", 732 | ExpressionUUID -> "6fc6c7d0-110c-40e4-8004-48f597b8237b"], Cell[BoxData[ 733 | "\<\"2.31\"\>"], "Output", CellChangeTimes -> {{3.8348254307300167`*^9, 734 | 3.834825457566633*^9}, 3.834825494730929*^9, 3.834825655900078*^9, 3.846041872712222*^9, 735 | 3.8460423458778563`*^9, 3.846408252424692*^9}, CellLabel -> "Out[66]=", 736 | ExpressionUUID -> "5eba5c6f-d861-48ec-a19b-61235d4295b0"], Cell[BoxData[ 737 | "\<\"complex(2.31, 5.3)\"\>"], "Output", CellChangeTimes -> {{3.8348254307300167`*^9, 738 | 3.834825457566633*^9}, 3.834825494730929*^9, 3.834825655900078*^9, 3.846041872712222*^9, 739 | 3.8460423458778563`*^9, 3.846408252426001*^9}, CellLabel -> "Out[67]=", 740 | ExpressionUUID -> "663903c8-b170-4217-9afb-bef9f743e2c2"]}, Open]] 741 | , 742 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Array", 743 | " ", "handling"}], "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ToPython", 744 | "[", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], "]"}], "\[IndentingNewLine]", 745 | RowBox[{"ToPython", "[", RowBox[{"{", RowBox[{"{", RowBox[{"1", ",", 746 | "2", ",", "3"}], "}"}], "}"}], "]"}], "\[IndentingNewLine]", RowBox[ 747 | {"ToPython", "[", RowBox[{"Cos", "[", RowBox[{"{", RowBox[{"1", ",", 748 | "2", ",", "3"}], "}"}], "]"}], "]"}]}]}]], "Input", CellChangeTimes -> 749 | {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 750 | 3.817020703952483*^9}, {3.817042042716785*^9, 3.817042043976235*^9}}, 751 | CellLabel -> "In[68]:=", ExpressionUUID -> "292185a9-2fb5-4cee-ba04-979e10b4d536" 752 | ], Cell[BoxData["\<\"np.array([1, 2, 3])\"\>"], "Output", CellChangeTimes 753 | -> {{3.834825430781938*^9, 3.834825457577856*^9}, 3.834825494779072*^9, 754 | 3.834825655944306*^9, 3.846041872722941*^9, 3.846042345888381*^9, 3.84640825243394*^9 755 | }, CellLabel -> "Out[68]=", ExpressionUUID -> "0112898f-b97d-40ac-bad5-e08df00d59e5" 756 | ], Cell[BoxData["\<\"np.array([np.array([1, 2, 3])])\"\>"], "Output", 757 | CellChangeTimes -> {{3.834825430781938*^9, 3.834825457577856*^9}, 3.834825494779072*^9, 758 | 3.834825655944306*^9, 3.846041872722941*^9, 3.846042345888381*^9, 3.846408252436035*^9 759 | }, CellLabel -> "Out[69]=", ExpressionUUID -> "2b10b530-5d6c-45a1-a3d1-849cbde2b60f" 760 | ], Cell[BoxData["\<\"np.array([np.cos(1), np.cos(2), np.cos(3)])\"\>" 761 | ], "Output", CellChangeTimes -> {{3.834825430781938*^9, 3.834825457577856*^9 762 | }, 3.834825494779072*^9, 3.834825655944306*^9, 3.846041872722941*^9, 763 | 3.846042345888381*^9, 3.8464082524375343`*^9}, CellLabel -> "Out[70]=", 764 | ExpressionUUID -> "7147813f-8b02-496b-9047-a3c10754db26"]}, Open]] 765 | , 766 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Example", 767 | " ", "with", " ", "numpy", " ", "as", " ", "numpy"}], "*)"}], "\[IndentingNewLine]", 768 | RowBox[{RowBox[{"ToPython", "[", RowBox[{RowBox[{"\[Pi]", " ", RowBox[ 769 | {RowBox[{"Cosh", "[", "a", "]"}], "/", RowBox[{"Sin", "[", "b", "]"}] 770 | }]}], ",", RowBox[{"NumpyPrefix", "\[Rule]", " ", "\"\\""}]}], 771 | "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", RowBox[{RowBox[ 772 | {"Exp", "[", RowBox[{"a", "+", "b"}], "]"}], ",", RowBox[{"NumpyPrefix", 773 | "\[Rule]", " ", "\"\\""}]}], "]"}], "\[IndentingNewLine]", RowBox[ 774 | {"ToPython", "[", RowBox[{RowBox[{"Cos", "[", RowBox[{"{", RowBox[{"1", 775 | ",", "2", ",", "3"}], "}"}], "]"}], ",", RowBox[{"NumpyPrefix", "\[Rule]", 776 | " ", "\"\\""}]}], "]"}]}]}]], "Input", CellChangeTimes -> {{ 777 | 3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020699758286*^9 778 | }, {3.817042046873148*^9, 3.817042048134284*^9}, {3.834825479111014*^9, 779 | 3.834825486108267*^9}}, CellLabel -> "In[71]:=", ExpressionUUID -> "f6527cd2-52e4-49a6-9b6c-bc9c98edc4bd" 780 | ], Cell[BoxData["\<\"numpy.pi * numpy.cosh(a) * (1 / numpy.sin(b))\"\>" 781 | ], "Output", CellChangeTimes -> {{3.834825430790345*^9, 3.834825457619651*^9 782 | }, 3.834825494795306*^9, 3.834825655952808*^9, 3.846041872762762*^9, 783 | 3.846042345931856*^9, 3.846408252478046*^9}, CellLabel -> "Out[71]=", 784 | ExpressionUUID -> "45383448-7da3-4bb2-aa79-fa57c9eba20f"], Cell[BoxData[ 785 | "\<\"numpy.exp(a + b)\"\>"], "Output", CellChangeTimes -> {{3.834825430790345*^9, 786 | 3.834825457619651*^9}, 3.834825494795306*^9, 3.834825655952808*^9, 3.846041872762762*^9, 787 | 3.846042345931856*^9, 3.846408252479697*^9}, CellLabel -> "Out[72]=", 788 | ExpressionUUID -> "2bd16af2-3be7-4a2b-b41f-1c66aca38621"], Cell[BoxData[ 789 | "\<\"numpy.array([numpy.cos(1), numpy.cos(2), numpy.cos(3)])\"\>"], "Output", 790 | CellChangeTimes -> {{3.834825430790345*^9, 3.834825457619651*^9}, 3.834825494795306*^9, 791 | 3.834825655952808*^9, 3.846041872762762*^9, 3.846042345931856*^9, 3.846408252481016*^9 792 | }, CellLabel -> "Out[73]=", ExpressionUUID -> "06fee358-9a64-4080-a1b6-347d5d7f63c8" 793 | ]}, Open]] 794 | , 795 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{"Example", 796 | " ", "with", " ", "numpy", " ", "as", " ", "\"\\"" 797 | }], "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ToPython", "[", RowBox[ 798 | {RowBox[{"\[Pi]", " ", RowBox[{RowBox[{"Cosh", "[", "a", "]"}], "/", 799 | RowBox[{"Sin", "[", "b", "]"}]}]}], ",", RowBox[{"NumpyPrefix", "\[Rule]", 800 | "\"\<\>\""}]}], "]"}], "\[IndentingNewLine]", RowBox[{"ToPython", "[", 801 | RowBox[{RowBox[{"Exp", "[", RowBox[{"a", "+", "b"}], "]"}], ",", RowBox[ 802 | {"NumpyPrefix", "\[Rule]", "\"\<\>\""}]}], "]"}], "\[IndentingNewLine]", 803 | RowBox[{"ToPython", "[", RowBox[{RowBox[{"Cos", "[", RowBox[{"{", RowBox[ 804 | {"1", ",", "2", ",", "3"}], "}"}], "]"}], ",", RowBox[{"NumpyPrefix", 805 | "\[Rule]", "\"\<\>\""}]}], "]"}]}]}]], "Input", CellChangeTimes -> { 806 | {3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 807 | 3.817020694983716*^9}, {3.846408271620933*^9, 3.8464082821115227`*^9} 808 | }, CellLabel -> "In[83]:=", ExpressionUUID -> "5515cb8d-3b4a-4f07-909f-e82f28173e96" 809 | ], Cell[BoxData["\<\"pi * cosh(a) * (1 / sin(b))\"\>"], "Output", CellChangeTimes 810 | -> {{3.8348254308298597`*^9, 3.8348254576304607`*^9}, 3.834825494839604*^9, 811 | 3.834825655996907*^9, 3.846041872772156*^9, 3.8460423459407063`*^9, 812 | {3.846408252488163*^9, 3.846408282512183*^9}}, CellLabel -> "Out[83]=", 813 | ExpressionUUID -> "240ed9f5-031a-433b-b506-e4041a7c85e9"], Cell[BoxData[ 814 | "\<\"exp(a + b)\"\>"], "Output", CellChangeTimes -> {{3.8348254308298597`*^9, 815 | 3.8348254576304607`*^9}, 3.834825494839604*^9, 3.834825655996907*^9, 816 | 3.846041872772156*^9, 3.8460423459407063`*^9, {3.846408252488163*^9, 817 | 3.8464082825143633`*^9}}, CellLabel -> "Out[84]=", ExpressionUUID -> 818 | "2328c139-66f6-433b-9b3f-558e02b8de97"], Cell[BoxData["\<\"array([cos(1), cos(2), cos(3)])\"\>" 819 | ], "Output", CellChangeTimes -> {{3.8348254308298597`*^9, 3.8348254576304607`*^9 820 | }, 3.834825494839604*^9, 3.834825655996907*^9, 3.846041872772156*^9, 821 | 3.8460423459407063`*^9, {3.846408252488163*^9, 3.846408282516893*^9}}, 822 | CellLabel -> "Out[85]=", ExpressionUUID -> "738a495d-78bf-4d91-84db-aa6df0d4f9c6" 823 | ]}, Open]] 824 | , 825 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", " ", RowBox[ 826 | {"Special", " ", "functions"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[ 827 | {"ToPython", "[", RowBox[{"SphericalHarmonicY", "[", RowBox[{"l", ",", 828 | "m", ",", "\[Theta]", ",", "\[Phi]"}], "]"}], "]"}]}]], "Input", CellChangeTimes 829 | -> {{3.8171174664415627`*^9, 3.8171175150332823`*^9}}, CellLabel -> 830 | "In[77]:=", ExpressionUUID -> "0e4529e0-9456-4a42-870d-172c1748c68e"], 831 | Cell[BoxData["\<\"special.sph_harm(m, l, (phi) % (2 * np.pi), (theta) % np.pi)\"\>" 832 | ], "Output", CellChangeTimes -> {{3.8348254308381367`*^9, 3.8348254576675386`*^9 833 | }, 3.8348254948487988`*^9, 3.834825656005947*^9, 3.846041872817704*^9, 834 | 3.846042345983569*^9, 3.846408252528775*^9}, CellLabel -> "Out[77]=", 835 | ExpressionUUID -> "4ae6d35d-df52-4700-92a8-95c90f0e39a4"]}, Open]] 836 | , 837 | Cell[CellGroupData[{Cell[BoxData[RowBox[{"ToPython", "[", RowBox[ 838 | {"Sqrt", "[", "a", "]"}], "]"}]], "Input", CellChangeTimes -> {{3.817120078799831*^9, 839 | 3.817120082942841*^9}}, CellLabel -> "In[78]:=", ExpressionUUID -> "0ae939ea-d5e9-419b-999a-64601c326ce5" 840 | ], Cell[BoxData["\<\"np.sqrt(a)\"\>"], "Output", CellChangeTimes -> { 841 | {3.834825430844825*^9, 3.8348254576733294`*^9}, 3.834825494889243*^9, 842 | 3.834825656045374*^9, 3.846041872824448*^9, 3.84604234598946*^9, 3.846408252535535*^9 843 | }, CellLabel -> "Out[78]=", ExpressionUUID -> "85a68d86-e2b6-4a71-9623-f36bf1d145f4" 844 | ]}, Open]] 845 | , 846 | Cell[CellGroupData[{Cell[BoxData[RowBox[{"ToPython", "[", RowBox[ 847 | {"{", RowBox[{"1", ",", "2", ",", RowBox[{"a", "+", "b", "+", RowBox[ 848 | {"Sin", "[", "x", "]"}]}]}], "}"}], "]"}]], "Input", CellChangeTimes 849 | -> {{3.8171328786925697`*^9, 3.8171328909644003`*^9}}, CellLabel -> "In[79]:=", 850 | ExpressionUUID -> "096db8ac-16bc-4502-968b-388523b12c99"], Cell[BoxData[ 851 | "\<\"np.array([1, 2, a + b + np.sin(x)])\"\>"], "Output", CellChangeTimes 852 | -> {{3.834825430851001*^9, 3.834825457706586*^9}, 3.8348254948948517`*^9, 853 | 3.83482565605092*^9, 3.846041872873*^9, 3.846042346027454*^9, 3.846408252582428*^9 854 | }, CellLabel -> "Out[79]=", ExpressionUUID -> "70a28131-2827-4521-9b2f-3564cb142e37" 855 | ]}, Open]] 856 | } 857 | , 858 | WindowSize -> {808, 701} 859 | , 860 | WindowMargins -> {{Automatic, 150}, {Automatic, 131}} 861 | , 862 | FrontEndVersion -> "12.1 for Mac OS X x86 (64-bit) (March 13, 2020)" 863 | 864 | , 865 | StyleDefinitions -> "Default.nb" 866 | , 867 | ExpressionUUID -> "798b0806-392b-4800-9dba-1ecc8fa5714a" 868 | ] 869 | 870 | (* End of Notebook Content *) 871 | 872 | (* Internal cache information *) 873 | 874 | (*CellTagsOutline 875 | CellTagsIndex->{} 876 | *) 877 | 878 | (*CellTagsIndex 879 | CellTagsIndex->{} 880 | *) 881 | 882 | (*NotebookFileOutline 883 | Notebook[{ 884 | Cell[558, 20, 686, 15, 52, "Input",ExpressionUUID->"ee6242fe-5738-42d7-927d-12c3be9f45f8"], 885 | Cell[CellGroupData[{ 886 | Cell[1269, 39, 373, 6, 30, "Input",ExpressionUUID->"e8858397-83ae-4bb9-9a33-1b677626ef0c"], 887 | Cell[1645, 47, 733, 14, 59, "Message",ExpressionUUID->"8547ffc5-678a-4925-92f6-8ad83246e2a7"], 888 | Cell[2381, 63, 49118, 1043, 167, "Output",ExpressionUUID->"42c28b92-2b81-493e-bb74-e25330a1fff5"] 889 | }, Open ]], 890 | Cell[CellGroupData[{ 891 | Cell[51536, 1111, 516, 11, 73, "Input",ExpressionUUID->"d17288e2-6b59-4b37-b3ab-c96969989f11"], 892 | Cell[52055, 1124, 351, 5, 34, "Output",ExpressionUUID->"a735febf-e560-43bd-bd6d-f914d64a4827"], 893 | Cell[52409, 1131, 366, 5, 34, "Output",ExpressionUUID->"acd027db-6e0c-4cf4-b716-fb0f2df127e2"] 894 | }, Open ]], 895 | Cell[CellGroupData[{ 896 | Cell[52812, 1141, 1924, 50, 241, "Input",ExpressionUUID->"740923fd-dd9e-45ca-b781-36fcddb044a7"], 897 | Cell[54739, 1193, 550, 8, 34, "Output",ExpressionUUID->"88214388-71e3-462b-a5be-66420571aab7"], 898 | Cell[55292, 1203, 554, 8, 34, "Output",ExpressionUUID->"0023fa9a-51c8-4c11-b552-d32e67f3707f"], 899 | Cell[55849, 1213, 552, 8, 34, "Output",ExpressionUUID->"4273074a-af87-41ce-9cc6-ae203b991c32"], 900 | Cell[56404, 1223, 566, 8, 34, "Output",ExpressionUUID->"bb9155fa-3227-43c3-a10a-f5d16b7cd372"], 901 | Cell[56973, 1233, 567, 8, 34, "Output",ExpressionUUID->"d7158797-1d4f-401d-bb64-c29b2496c672"], 902 | Cell[57543, 1243, 557, 8, 34, "Output",ExpressionUUID->"e81953d6-e02b-4b0e-b543-bad8760a8b3b"], 903 | Cell[58103, 1253, 580, 8, 34, "Output",ExpressionUUID->"9a3c9c1d-3be9-4fb8-9a18-14e65e057788"], 904 | Cell[58686, 1263, 581, 8, 34, "Output",ExpressionUUID->"e6d1f67c-7b2c-46c4-b5c9-122bbd12864b"], 905 | Cell[59270, 1273, 565, 8, 34, "Output",ExpressionUUID->"f275590b-eaf0-4e44-b675-c92fb2ebc858"], 906 | Cell[59838, 1283, 567, 8, 34, "Output",ExpressionUUID->"caf70baa-78be-4c50-8a77-f181a689e36f"] 907 | }, Open ]], 908 | Cell[CellGroupData[{ 909 | Cell[60442, 1296, 482, 10, 52, "Input",ExpressionUUID->"d695df00-d1d2-4318-b649-f671d424864e"], 910 | Cell[60927, 1308, 324, 4, 34, "Output",ExpressionUUID->"36ad64db-329f-490b-b04e-505146c262de"] 911 | }, Open ]], 912 | Cell[CellGroupData[{ 913 | Cell[61288, 1317, 783, 17, 136, "Input",ExpressionUUID->"5185dd86-dec4-4c26-8e48-124321882ccc"], 914 | Cell[62074, 1336, 303, 4, 34, "Output",ExpressionUUID->"34ff0311-ced8-4ed5-9f19-3c5c313b48f6"], 915 | Cell[62380, 1342, 320, 4, 34, "Output",ExpressionUUID->"ff1f2ab9-65bf-440e-b271-3b059595e619"], 916 | Cell[62703, 1348, 320, 4, 34, "Output",ExpressionUUID->"6fc6c7d0-110c-40e4-8004-48f597b8237b"], 917 | Cell[63026, 1354, 306, 4, 34, "Output",ExpressionUUID->"5eba5c6f-d861-48ec-a19b-61235d4295b0"], 918 | Cell[63335, 1360, 320, 4, 34, "Output",ExpressionUUID->"663903c8-b170-4217-9afb-bef9f743e2c2"] 919 | }, Open ]], 920 | Cell[CellGroupData[{ 921 | Cell[63692, 1369, 795, 20, 94, "Input",ExpressionUUID->"292185a9-2fb5-4cee-ba04-979e10b4d536"], 922 | Cell[64490, 1391, 316, 4, 34, "Output",ExpressionUUID->"0112898f-b97d-40ac-bad5-e08df00d59e5"], 923 | Cell[64809, 1397, 329, 4, 34, "Output",ExpressionUUID->"2b10b530-5d6c-45a1-a3d1-849cbde2b60f"], 924 | Cell[65141, 1403, 343, 4, 34, "Output",ExpressionUUID->"7147813f-8b02-496b-9047-a3c10754db26"] 925 | }, Open ]], 926 | Cell[CellGroupData[{ 927 | Cell[65521, 1412, 1185, 30, 94, "Input",ExpressionUUID->"f6527cd2-52e4-49a6-9b6c-bc9c98edc4bd"], 928 | Cell[66709, 1444, 345, 5, 34, "Output",ExpressionUUID->"45383448-7da3-4bb2-aa79-fa57c9eba20f"], 929 | Cell[67057, 1451, 314, 4, 34, "Output",ExpressionUUID->"2bd16af2-3be7-4a2b-b41f-1c66aca38621"], 930 | Cell[67374, 1457, 355, 5, 34, "Output",ExpressionUUID->"06fee358-9a64-4080-a1b6-347d5d7f63c8"] 931 | }, Open ]], 932 | Cell[CellGroupData[{ 933 | Cell[67766, 1467, 1133, 30, 94, "Input",ExpressionUUID->"5515cb8d-3b4a-4f07-909f-e82f28173e96"], 934 | Cell[68902, 1499, 355, 4, 34, "Output",ExpressionUUID->"240ed9f5-031a-433b-b506-e4041a7c85e9"], 935 | Cell[69260, 1505, 340, 4, 34, "Output",ExpressionUUID->"2328c139-66f6-433b-9b3f-558e02b8de97"], 936 | Cell[69603, 1511, 359, 4, 34, "Output",ExpressionUUID->"738a495d-78bf-4d91-84db-aa6df0d4f9c6"] 937 | }, Open ]], 938 | Cell[CellGroupData[{ 939 | Cell[69999, 1520, 434, 10, 52, "Input",ExpressionUUID->"0e4529e0-9456-4a42-870d-172c1748c68e"], 940 | Cell[70436, 1532, 366, 5, 34, "Output",ExpressionUUID->"4ae6d35d-df52-4700-92a8-95c90f0e39a4"] 941 | }, Open ]], 942 | Cell[CellGroupData[{ 943 | Cell[70839, 1542, 237, 4, 30, "Input",ExpressionUUID->"0ae939ea-d5e9-419b-999a-64601c326ce5"], 944 | Cell[71079, 1548, 309, 4, 34, "Output",ExpressionUUID->"85a68d86-e2b6-4a71-9623-f36bf1d145f4"] 945 | }, Open ]], 946 | Cell[CellGroupData[{ 947 | Cell[71425, 1557, 335, 7, 30, "Input",ExpressionUUID->"096db8ac-16bc-4502-968b-388523b12c99"], 948 | Cell[71763, 1566, 331, 4, 34, "Output",ExpressionUUID->"70a28131-2827-4521-9b2f-3564cb142e37"] 949 | }, Open ]] 950 | } 951 | ] 952 | *) 953 | -------------------------------------------------------------------------------- /ToPython_tests.nb: -------------------------------------------------------------------------------- 1 | (* Content-type: application/vnd.wolfram.mathematica *) 2 | 3 | (*** Wolfram Notebook File ***) 4 | 5 | (* http://www.wolfram.com/nb *) 6 | 7 | (* CreatedBy='Mathematica 11.0' *) 8 | 9 | (*CacheID: 234*) 10 | 11 | (* Internal cache information: 12 | NotebookFileLineBreakTest 13 | NotebookFileLineBreakTest 14 | NotebookDataPosition[ 158, 7] 15 | NotebookDataLength[ 73864, 1541] 16 | NotebookOptionsPosition[ 68124, 1451] 17 | NotebookOutlinePosition[ 68520, 1467] 18 | CellTagsIndexPosition[ 68477, 1464] 19 | WindowFrame->Normal*) 20 | 21 | (* Beginning of Notebook Content *) 22 | 23 | Notebook[ 24 | { 25 | Cell[BoxData[RowBox[{RowBox[{"(*", RowBox[{RowBox[{"loads", " ", 26 | "the", " ", "package"}], " ", "-", " ", RowBox[{"after", " ", "installation" 27 | }]}], "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ClearAll", "[", 28 | "\"\\"", "]"}], "\[IndentingNewLine]", RowBox[{"Get", "@", 29 | RowBox[{"FileNameJoin", "[", RowBox[{"{", RowBox[{RowBox[{"NotebookDirectory", 30 | "[", "]"}], ",", "\"\\""}], "}"}], "]"}]}]}]}]], "Input", 31 | CellChangeTimes -> {{3.70181767476367*^9, 3.701817694205203*^9}, {3.7018181976937943`*^9, 32 | 3.701818211998588*^9}, {3.817007877025469*^9, 3.81700790447239*^9}, 33 | {3.817220388658033*^9, 3.817220409587041*^9}, {3.817221007872984*^9, 34 | 3.817221033503044*^9}, {3.817221066267579*^9, 3.817221086744882*^9}}, 35 | CellLabel -> "In[1]:=", ExpressionUUID -> "ee6242fe-5738-42d7-927d-12c3be9f45f8" 36 | ] 37 | , 38 | Cell[BoxData[RowBox[{RowBox[{"(*", " ", RowBox[{"Adjust", " ", "this", 39 | " ", "path", " ", "to", " ", "your", " ", "python", " ", "interpreter" 40 | }], " ", "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"pythonPath", 41 | "=", "\"\\""}], ";"}]}]], "Input", CellChangeTimes 42 | -> {{3.817221410879698*^9, 3.817221418419937*^9}, {3.81722144914742*^9, 43 | 3.81722147152433*^9}}, CellLabel -> "In[3]:=", ExpressionUUID -> "b874d894-ea09-439a-90db-628140ef50ad" 44 | ] 45 | , 46 | Cell[ 47 | CellGroupData[ 48 | { 49 | Cell["Test infrastructure", "Section", CellChangeTimes -> { 50 | {3.846042068107306*^9, 3.84604207224017*^9}}, ExpressionUUID -> "7b6e915e-b4c7-474a-aaf3-aecc99a4e24d" 51 | ] 52 | , 53 | Cell[CellGroupData[{Cell[BoxData[RowBox[{RowBox[{"(*", " ", 54 | RowBox[{"Pick", " ", "some", " ", "values", " ", "and", " ", "initialize", 55 | " ", "the", " ", "python", " ", "evaluator"}], " ", "*)"}], "\[IndentingNewLine]", 56 | RowBox[{"vals", "=", RowBox[{"{", RowBox[{RowBox[{"a", "\[Rule]", "1" 57 | }], ",", RowBox[{"b", "\[Rule]", "2"}], ",", RowBox[{"c", "\[Rule]", 58 | RowBox[{"RandomReal", "[", "]"}]}], ",", RowBox[{"d", "\[Rule]", RowBox[ 59 | {"RandomReal", "[", "]"}]}], ",", RowBox[{"e", "\[Rule]", RowBox[{"RandomReal", 60 | "[", "]"}]}], ",", RowBox[{"g", "\[Rule]", RowBox[{"RandomReal", "[", 61 | "]"}]}]}], "}"}]}]}]], "Input", CellChangeTimes -> {{3.8170415720331717`*^9, 62 | 3.817041663288992*^9}, {3.8170422146371593`*^9, 3.817042243683446*^9 63 | }, {3.817119417702676*^9, 3.817119423221958*^9}, {3.8172200443350983`*^9, 64 | 3.817220088496299*^9}, {3.817220538077466*^9, 3.817220539134753*^9}}, 65 | CellLabel -> "In[4]:=", ExpressionUUID -> "be172ae8-6ece-4aaf-9126-d625e8d00a59" 66 | ], Cell[BoxData[RowBox[{"{", RowBox[{RowBox[{"a", "\[Rule]", "1"}], ",", 67 | RowBox[{"b", "\[Rule]", "2"}], ",", RowBox[{"c", "\[Rule]", "0.607399570102088`" 68 | }], ",", RowBox[{"d", "\[Rule]", "0.7489446113292975`"}], ",", RowBox[ 69 | {"e", "\[Rule]", "0.7095969870653862`"}], ",", RowBox[{"g", "\[Rule]", 70 | "0.21674371595706687`"}]}], "}"}]], "Output", CellChangeTimes -> {3.834825663428466*^9, 71 | 3.846040776783359*^9, 3.8460410046161013`*^9, 3.8460417773639402`*^9, 72 | 3.846041884040916*^9, {3.8460420779687443`*^9, 3.8460420902269*^9}, 73 | 3.846042311515045*^9, 3.846158304014421*^9, 3.8461667208505163`*^9, 3.8464079831186533`*^9, 74 | 3.846408146365361*^9, 3.846408235785553*^9}, CellLabel -> "Out[4]=", 75 | ExpressionUUID -> "27a592f9-7d00-4126-bc05-25ce5f6c16e2"]}, Open]] 76 | , 77 | Cell[ 78 | CellGroupData[ 79 | { 80 | Cell[BoxData[RowBox[{RowBox[{"(*", " ", RowBox[{"Start", 81 | " ", "a", " ", "python", " ", "shell", " ", "do", " ", "evaluate", " ", 82 | "commands"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{RowBox[{"session", 83 | "=", RowBox[{"StartExternalSession", "[", RowBox[{"<|", RowBox[{RowBox[ 84 | {"\"\\"", "\[Rule]", "\"\\""}], ",", RowBox[{"\"\\"", 85 | "\[Rule]", "pythonPath"}]}], "|>"}], "]"}]}], "\[IndentingNewLine]", 86 | RowBox[{RowBox[{"init", "=", RowBox[{"StringRiffle", "[", RowBox[{RowBox[ 87 | {"Map", "[", RowBox[{RowBox[{RowBox[{RowBox[{"ToString", "[", RowBox[ 88 | {"#", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}], "<>", "\"\<=\>\"", 89 | "<>", RowBox[{"ToString", "[", RowBox[{RowBox[{"#", "[", RowBox[{"[", 90 | "2", "]"}], "]"}], ",", "FortranForm"}], "]"}]}], "&"}], ",", "vals" 91 | }], "]"}], ",", " ", "\"\<;\>\""}], "]"}]}], ";"}], "\[IndentingNewLine]", 92 | RowBox[{RowBox[{"ExternalEvaluate", "[", RowBox[{"session", ",", "\"\\"" 93 | }], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ExternalEvaluate", 94 | "[", RowBox[{"session", ",", "\"\\""}], 95 | "]"}], ";"}], "\[IndentingNewLine]", RowBox[{RowBox[{"ExternalEvaluate", 96 | "[", RowBox[{"session", ",", "init"}], "]"}], ";"}]}]}]], "Input", CellChangeTimes 97 | -> {{3.8170415720331717`*^9, 3.817041663288992*^9}, {3.8170422146371593`*^9, 98 | 3.817042243683446*^9}, {3.817119417702676*^9, 3.817119423221958*^9}, 99 | {3.8172200443350983`*^9, 3.817220081853519*^9}, {3.817220200706709*^9, 100 | 3.8172202130659523`*^9}, {3.81722142464642*^9, 3.817221436366208*^9}, 101 | 3.817273597531622*^9}, CellLabel -> "In[5]:=", ExpressionUUID -> "2df5bef7-4ce7-41a3-919a-c19df456e2f3" 102 | ] 103 | , 104 | Cell[ 105 | BoxData[ 106 | InterpretationBox[ 107 | RowBox[ 108 | { 109 | TagBox["ExternalSessionObject", "SummaryHead" 110 | ] 111 | , 112 | "[" 113 | , 114 | DynamicModuleBox[ 115 | {Typeset`open$$ = False, Typeset`embedState$$ 116 | = "Ready"} 117 | , 118 | TemplateBox[ 119 | { 120 | PaneSelectorBox[ 121 | { 122 | False -> GridBox[{{PaneBox[ButtonBox[ 123 | DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "SquarePlusIconMedium" 124 | ]], ButtonFunction :> (Typeset`open$$ = True), Appearance -> None, Evaluator 125 | -> Automatic, Method -> "Preemptive"], Alignment -> {Center, Center}, 126 | ImageSize -> Dynamic[{Automatic, 3.5 CurrentValue["FontCapHeight"] / 127 | AbsoluteCurrentValue[Magnification]}]], GraphicsBox[{{Hue[0.5766283524904214, 128 | 0.6682027649769585, 0.651], EdgeForm[None], FilledCurveBox[{{{1, 4, 129 | 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}, {{1, 4, 3}, {0, 1, 0}, {0, 1, 0 130 | }, {0, 1, 0}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {0, 1, 0}, 131 | {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}}}, {{{58, 120}, 132 | {60, 120}, {62, 118}, {62, 115}, {62, 112}, {60, 110}, {58, 110}, {55, 133 | 110}, {53, 112}, {53, 115}, {53, 118}, {55, 120}, {58, 120}}, {{72, 134 | 128}, {44, 128}, {46, 116}, {46, 116}, {46, 104}, {73, 104}, {73, 100 135 | }, {36, 100}, {36, 100}, {18, 102}, {18, 74}, {18, 45}, {33, 46}, {33, 136 | 46}, {43, 46}, {43, 59}, {43, 59}, {42, 75}, {58, 75}, {85, 75}, {85, 137 | 75}, {99, 75}, {99, 89}, {99, 114}, {99, 114}, {102, 128}, {72, 128} 138 | }}]}, {Hue[0.1164, 0.745, 0.99], EdgeForm[None], FilledCurveBox[{{{1, 139 | 4, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}, {{1, 4, 3}, {0, 1, 0}, {0, 140 | 1, 0}, {0, 1, 0}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {0, 1, 141 | 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}}}, {{{88, 27 142 | }, {85, 27}, {83, 29}, {83, 32}, {83, 34}, {85, 37}, {88, 37}, {91, 37 143 | }, {93, 34}, {93, 32}, {93, 29}, {91, 27}, {88, 27}}, {{73, 18}, {101, 144 | 18}, {99, 31}, {99, 31}, {99, 43}, {73, 43}, {73, 47}, {110, 47}, {110, 145 | 47}, {128, 45}, {128, 73}, {128, 102}, {112, 101}, {112, 101}, {103, 146 | 101}, {103, 87}, {103, 87}, {104, 72}, {88, 72}, {61, 72}, {61, 72}, 147 | {46, 72}, {46, 57}, {46, 33}, {46, 33}, {44, 18}, {73, 18}}}]}}, {ImageSize 148 | -> {Automatic, Dynamic[3.5 CurrentValue["FontCapHeight"]]}, ImageSize 149 | -> {Automatic, Dynamic[3.5 CurrentValue["FontCapHeight"]]}}], GridBox[ 150 | {{RowBox[{TagBox["\"System: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 151 | TagBox["\"Python\"", "SummaryItem"]}], RowBox[{TagBox["\"Version: \"", 152 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"3.7.9\"", "SummaryItem" 153 | ]}]}, {RowBox[{TagBox["\"UUID: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 154 | TagBox["\"9d054758-6742-4dc1-bdf0-92cfab26dc91\"", "SummaryItem"]}], 155 | "\[SpanFromLeft]"}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" 156 | -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize -> {"Columns" 157 | -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" 158 | -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> {ShowStringCharacters 159 | -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles 160 | -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> 161 | False, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic 162 | }}}, BaselinePosition -> {1, 1}] 163 | , 164 | True -> 165 | GridBox[ 166 | { 167 | { 168 | PaneBox[ButtonBox[DynamicBox[ 169 | FEPrivate`FrontEndResource["FEBitmaps", "SquareMinusIconMedium"]], ButtonFunction 170 | :> (Typeset`open$$ = False), Appearance -> None, Evaluator -> Automatic, 171 | Method -> "Preemptive"], Alignment -> {Center, Center}, ImageSize -> 172 | Dynamic[{Automatic, 3.5 CurrentValue["FontCapHeight"] / AbsoluteCurrentValue[ 173 | Magnification]}]] 174 | , 175 | GraphicsBox[{{Hue[0.5766283524904214, 176 | 0.6682027649769585, 0.651], EdgeForm[None], FilledCurveBox[{{{1, 4, 177 | 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}, {{1, 4, 3}, {0, 1, 0}, {0, 1, 0 178 | }, {0, 1, 0}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {0, 1, 0}, 179 | {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}}}, {{{58, 120}, 180 | {60, 120}, {62, 118}, {62, 115}, {62, 112}, {60, 110}, {58, 110}, {55, 181 | 110}, {53, 112}, {53, 115}, {53, 118}, {55, 120}, {58, 120}}, {{72, 182 | 128}, {44, 128}, {46, 116}, {46, 116}, {46, 104}, {73, 104}, {73, 100 183 | }, {36, 100}, {36, 100}, {18, 102}, {18, 74}, {18, 45}, {33, 46}, {33, 184 | 46}, {43, 46}, {43, 59}, {43, 59}, {42, 75}, {58, 75}, {85, 75}, {85, 185 | 75}, {99, 75}, {99, 89}, {99, 114}, {99, 114}, {102, 128}, {72, 128} 186 | }}]}, {Hue[0.1164, 0.745, 0.99], EdgeForm[None], FilledCurveBox[{{{1, 187 | 4, 3}, {1, 3, 3}, {1, 3, 3}, {1, 3, 3}}, {{1, 4, 3}, {0, 1, 0}, {0, 188 | 1, 0}, {0, 1, 0}, {0, 1, 0}, {1, 3, 3}, {1, 3, 3}, {0, 1, 0}, {0, 1, 189 | 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}}}, {{{88, 27 190 | }, {85, 27}, {83, 29}, {83, 32}, {83, 34}, {85, 37}, {88, 37}, {91, 37 191 | }, {93, 34}, {93, 32}, {93, 29}, {91, 27}, {88, 27}}, {{73, 18}, {101, 192 | 18}, {99, 31}, {99, 31}, {99, 43}, {73, 43}, {73, 47}, {110, 47}, {110, 193 | 47}, {128, 45}, {128, 73}, {128, 102}, {112, 101}, {112, 101}, {103, 194 | 101}, {103, 87}, {103, 87}, {104, 72}, {88, 72}, {61, 72}, {61, 72}, 195 | {46, 72}, {46, 57}, {46, 33}, {46, 33}, {44, 18}, {73, 18}}}]}}, {ImageSize 196 | -> {Automatic, Dynamic[3.5 CurrentValue["FontCapHeight"]]}, ImageSize 197 | -> {Automatic, Dynamic[3.5 CurrentValue["FontCapHeight"]]}}] 198 | , 199 | GridBox[ 200 | { 201 | {RowBox[{TagBox["\"System: \"", 202 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"Python\"", 203 | "SummaryItem"]}]} 204 | , 205 | {RowBox[{TagBox["\"Version: \"", 206 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"3.7.9\"", "SummaryItem" 207 | ]}]} 208 | , 209 | {RowBox[{TagBox["\"UUID: \"", 210 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"9d054758-6742-4dc1-bdf0-92cfab26dc91\"", 211 | "SummaryItem"]}]} 212 | , 213 | { 214 | RowBox[ 215 | { 216 | TagBox["\"Active: \"", 217 | "SummaryItemAnnotation"] 218 | , 219 | "\[InvisibleSpace]" 220 | 221 | , 222 | TagBox[ 223 | DynamicBox[ 224 | ToBoxes[ 225 | If[TrueQ[ 226 | ExternalEvaluate`Private`getSessionOpts["9d054758-6742-4dc1-bdf0-92cfab26dc91", 227 | "Exists"]], 228 | ExternalSessionObject[ 229 | "9d054758-6742-4dc1-bdf0-92cfab26dc91"]["Active"] 230 | , 231 | False 232 | ] 233 | , 234 | StandardForm 235 | 236 | ] 237 | , 238 | TrackedSymbols 239 | :> {ExternalEvaluate`Private`$Links} 240 | ] 241 | , 242 | "SummaryItem" 243 | 244 | ] 245 | } 246 | ] 247 | } 248 | , 249 | {RowBox[{TagBox["\"Executable: \"", 250 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"/opt/local/bin/python3\"", 251 | "SummaryItem"]}]} 252 | , 253 | {RowBox[{TagBox["\"UUID: \"", 254 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"9d054758-6742-4dc1-bdf0-92cfab26dc91\"", 255 | "SummaryItem"]}]} 256 | , 257 | {RowBox[{TagBox["\"Process: \"", 258 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[InterpretationBox[ 259 | RowBox[{TagBox["ProcessObject", "SummaryHead"], "[", DynamicModuleBox[ 260 | {Typeset`open$$ = False, Typeset`embedState$$ = "Ready"}, TemplateBox[ 261 | {PaneSelectorBox[{False -> GridBox[{{PaneBox[ButtonBox[DynamicBox[FEPrivate`FrontEndResource[ 262 | "FEBitmaps", "SquarePlusIconMedium"]], ButtonFunction :> (Typeset`open$$ 263 | = True), Appearance -> None, Evaluator -> Automatic, Method -> "Preemptive" 264 | ], Alignment -> {Center, Center}, ImageSize -> Dynamic[{Automatic, 3.5 265 | CurrentValue["FontCapHeight"] / AbsoluteCurrentValue[Magnification]} 266 | ]], GridBox[{{RowBox[{TagBox["\"Program: \"", "SummaryItemAnnotation" 267 | ], "\[InvisibleSpace]", TagBox["\"python3.8\"", "SummaryItem"]}]}, {RowBox[ 268 | {TagBox["\"PID: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[ 269 | "85527", "SummaryItem"]}]}}, GridBoxAlignment -> {"Columns" -> {{Left 270 | }}, "Rows" -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize -> 271 | {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings 272 | -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> {ShowStringCharacters 273 | -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles 274 | -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> 275 | False, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic 276 | }}}, BaselinePosition -> {1, 1}], True -> GridBox[{{PaneBox[ButtonBox[ 277 | DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "SquareMinusIconMedium" 278 | ]], ButtonFunction :> (Typeset`open$$ = False), Appearance -> None, Evaluator 279 | -> Automatic, Method -> "Preemptive"], Alignment -> {Center, Center}, 280 | ImageSize -> Dynamic[{Automatic, 3.5 CurrentValue["FontCapHeight"] / 281 | AbsoluteCurrentValue[Magnification]}]], GridBox[{{RowBox[{TagBox["\"Program: \"", 282 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"python3.8\"", 283 | "SummaryItem"]}]}, {RowBox[{TagBox["\"PID: \"", "SummaryItemAnnotation" 284 | ], "\[InvisibleSpace]", TagBox["85527", "SummaryItem"]}]}, {RowBox[{TagBox[ 285 | "\"Parent PID: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[ 286 | "85524", "SummaryItem"]}]}, {RowBox[{TagBox["\"User: \"", "SummaryItemAnnotation" 287 | ], "\[InvisibleSpace]", TagBox["\"dzwicker\"", "SummaryItem"]}]}, {RowBox[ 288 | {TagBox["\"Path: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 289 | TagBox["\"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python\"", 290 | "SummaryItem"]}]}, {RowBox[{TagBox["\"Memory:\"", "SummaryItemAnnotation" 291 | ], "\[InvisibleSpace]", TagBox[TemplateBox[{"20.508672`", "\"MB\"", "megabytes", 292 | "\"Megabytes\""}, "Quantity", SyntaxForm -> Mod], "SummaryItem"]}]}, 293 | {RowBox[{TagBox["\"Threads: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 294 | TagBox["3", "SummaryItem"]}]}, {RowBox[{TagBox["\"Start Time: \"", "SummaryItemAnnotation" 295 | ], "\[InvisibleSpace]", TagBox[TemplateBox[{RowBox[{"\"Sat 20 Nov 2021 15:43:58\"", 296 | StyleBox[RowBox[{"\"GMT+\"", "\[InvisibleSpace]", StyleBox["1.`", NumberMarks 297 | -> False, StripOnInput -> False]}], FontColor -> GrayLevel[0.5]]}], 298 | RowBox[{"DateObject", "[", RowBox[{RowBox[{"{", RowBox[{"2021", ",", 299 | "11", ",", "20", ",", "15", ",", "43", ",", "58.`"}], "}"}], ",", "\"Instant\"", 300 | ",", "\"Gregorian\"", ",", "1.`"}], "]"}]}, "DateObject", Editable -> 301 | False], "SummaryItem"]}]}, {RowBox[{TagBox["\"System Time: \"", "SummaryItemAnnotation" 302 | ], "\[InvisibleSpace]", TagBox[TemplateBox[{"0.1148549999999999988`5.", 303 | "\"s\"", "seconds", "\"Seconds\""}, "Quantity", SyntaxForm -> Mod], 304 | "SummaryItem"]}]}, {RowBox[{TagBox["\"User Time: \"", "SummaryItemAnnotation" 305 | ], "\[InvisibleSpace]", TagBox[TemplateBox[{"0.2291410000000000113`5.", 306 | "\"s\"", "seconds", "\"Seconds\""}, "Quantity", SyntaxForm -> Mod], 307 | "SummaryItem"]}]}, {RowBox[{TagBox["\"Real Time: \"", "SummaryItemAnnotation" 308 | ], "\[InvisibleSpace]", TagBox[TemplateBox[{"0", "\"s\"", "seconds", 309 | "\"Seconds\""}, "Quantity", SyntaxForm -> Mod], "SummaryItem"]}]}}, GridBoxAlignment 310 | -> {"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> False, 311 | GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic 312 | }}}, GridBoxSpacings -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}}, 313 | BaseStyle -> {ShowStringCharacters -> False, NumberMarks -> False, PrintPrecision 314 | -> 3, ShowSyntaxStyles -> False}]}}, GridBoxAlignment -> {"Rows" -> 315 | {{Top}}}, AutoDelete -> False, GridBoxItemSize -> {"Columns" -> {{Automatic 316 | }}, "Rows" -> {{Automatic}}}, BaselinePosition -> {1, 1}]}, Dynamic[Typeset`open$$ 317 | ], ImageSize -> Automatic]}, "SummaryPanel"], DynamicModuleValues :> 318 | {}], "]"}], ProcessObject[Association["ManagedProcess" -> True, "UID" 319 | -> 0, "PID" -> 85527, "PPID" -> 85524, "Program" -> "python3.8", "Path" 320 | -> "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8", 321 | "User" -> "dzwicker", "StartTime" -> DateObject[{2021, 11, 20, 15, 43, 322 | 58.}, "Instant", "Gregorian", 1.]]], Selectable -> False, Editable -> 323 | False, SelectWithContents -> True], "SummaryItem"]}]} 324 | , 325 | {RowBox[{TagBox["\"ReturnType: \"", 326 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"Expression\"", 327 | "SummaryItem"]}]} 328 | , 329 | {RowBox[{TagBox["\"Socket: \"", 330 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[InterpretationBox[ 331 | RowBox[{TagBox["SocketObject", "SummaryHead"], "[", DynamicModuleBox[ 332 | {Typeset`open$$ = False, Typeset`embedState$$ = "Ready"}, TemplateBox[ 333 | {PaneSelectorBox[{False -> GridBox[{{PaneBox[ButtonBox[DynamicBox[FEPrivate`FrontEndResource[ 334 | "FEBitmaps", "SquarePlusIconMedium"]], ButtonFunction :> (Typeset`open$$ 335 | = True), Appearance -> None, Evaluator -> Automatic, Method -> "Preemptive" 336 | ], Alignment -> {Center, Center}, ImageSize -> Dynamic[{Automatic, 3.5 337 | CurrentValue["FontCapHeight"] / AbsoluteCurrentValue[Magnification]} 338 | ]], GraphicsBox[GeometricTransformationBox[{{{FilledCurveBox[{{Line[{ 339 | {36.558, 8.569}, {40.947, 8.569}, {40.947, 43.684000000000005`}, {36.558, 340 | 43.684000000000005`}, {36.558, 8.569}}]}}]}, {FilledCurveBox[{{Line[ 341 | {{59.053, 8.569}, {63.443, 8.569}, {63.443, 43.684000000000005`}, {59.053, 342 | 43.684000000000005`}, {59.053, 8.569}}]}}]}, {{FilledCurveBox[{{Line[ 343 | {{55.487, 8.569}, {56.95, 8.569}, {56.95, 21.188000000000002`}, {55.487, 344 | 21.188000000000002`}, {55.487, 8.569}}]}}]}, {FilledCurveBox[{{Line[ 345 | {{52.562, 8.569}, {54.025, 8.569}, {54.025, 21.188000000000002`}, {52.562, 346 | 21.188000000000002`}, {52.562, 8.569}}]}}]}, {FilledCurveBox[{{Line[ 347 | {{49.636, 8.569}, {51.099000000000004`, 8.569}, {51.099000000000004`, 348 | 21.188000000000002`}, {49.636, 21.188000000000002`}, {49.636, 8.569} 349 | }]}}]}, {FilledCurveBox[{{Line[{{46.709, 8.569}, {48.172000000000004`, 350 | 8.569}, {48.172000000000004`, 21.188000000000002`}, {46.709, 21.188000000000002` 351 | }, {46.709, 8.569}}]}}]}, {FilledCurveBox[{{Line[{{43.783, 8.569}, {45.246, 352 | 8.569}, {45.246, 21.188000000000002`}, {43.783, 21.188000000000002`}, 353 | {43.783, 8.569}}]}}]}}, {FilledCurveBox[{{Line[{{40.947, 4.911}, {59.787000000000006`, 354 | 4.911}, {59.787000000000006`, 6.922}, {40.947, 6.922}, {40.947, 4.911 355 | }}]}}]}, {FilledCurveBox[{{Line[{{44.057, 31.675}, {56.678000000000004`, 356 | 31.675}, {56.678000000000004`, 39.051}, {44.057, 39.051}, {44.057, 31.675 357 | }}]}}]}, {FilledCurveBox[{{Line[{{44.057, 43.685}, {56.678000000000004`, 358 | 43.685}, {56.678000000000004`, 65.089}, {44.057, 65.089}, {44.057, 43.685 359 | }}]}}]}}}, {{{1, 0}, {0, -1}}, Center}], {ImageSize -> {Automatic, Dynamic[ 360 | 3.5 CurrentValue["FontCapHeight"] / AbsoluteCurrentValue[Magnification 361 | ]]}, PlotRange -> {{20, 80}, {0, 70}}, BaseStyle -> {CacheGraphics -> 362 | False}, ImageSize -> 30}], GridBox[{{RowBox[{TagBox["\"IPAddress: \"", 363 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"127.0.0.1\"", 364 | "SummaryItem"]}], RowBox[{TagBox["\"Port: \"", "SummaryItemAnnotation" 365 | ], "\[InvisibleSpace]", TagBox["\"63781\"", "SummaryItem"]}]}, {RowBox[ 366 | {TagBox["\"UUID: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 367 | TagBox["\"ZMQ-3ef55c1d-4a9b-4c18-866b-a2c013f75fc7\"", "SummaryItem"] 368 | }], RowBox[{TagBox["\"Protocol: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", 369 | TagBox["\"ZMQ_PAIR\"", "SummaryItem"]}]}}, GridBoxAlignment -> {"Columns" 370 | -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize 371 | -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings 372 | -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> {ShowStringCharacters 373 | -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles 374 | -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> 375 | False, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic 376 | }}}, BaselinePosition -> {1, 1}], True -> GridBox[{{PaneBox[ButtonBox[ 377 | DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "SquareMinusIconMedium" 378 | ]], ButtonFunction :> (Typeset`open$$ = False), Appearance -> None, Evaluator 379 | -> Automatic, Method -> "Preemptive"], Alignment -> {Center, Center}, 380 | ImageSize -> Dynamic[{Automatic, 3.5 CurrentValue["FontCapHeight"] / 381 | AbsoluteCurrentValue[Magnification]}]], GraphicsBox[GeometricTransformationBox[ 382 | {{{FilledCurveBox[{{Line[{{36.558, 8.569}, {40.947, 8.569}, {40.947, 383 | 43.684000000000005`}, {36.558, 43.684000000000005`}, {36.558, 8.569}} 384 | ]}}]}, {FilledCurveBox[{{Line[{{59.053, 8.569}, {63.443, 8.569}, {63.443, 385 | 43.684000000000005`}, {59.053, 43.684000000000005`}, {59.053, 8.569} 386 | }]}}]}, {{FilledCurveBox[{{Line[{{55.487, 8.569}, {56.95, 8.569}, {56.95, 387 | 21.188000000000002`}, {55.487, 21.188000000000002`}, {55.487, 8.569} 388 | }]}}]}, {FilledCurveBox[{{Line[{{52.562, 8.569}, {54.025, 8.569}, {54.025, 389 | 21.188000000000002`}, {52.562, 21.188000000000002`}, {52.562, 8.569} 390 | }]}}]}, {FilledCurveBox[{{Line[{{49.636, 8.569}, {51.099000000000004`, 391 | 8.569}, {51.099000000000004`, 21.188000000000002`}, {49.636, 21.188000000000002` 392 | }, {49.636, 8.569}}]}}]}, {FilledCurveBox[{{Line[{{46.709, 8.569}, {48.172000000000004`, 393 | 8.569}, {48.172000000000004`, 21.188000000000002`}, {46.709, 21.188000000000002` 394 | }, {46.709, 8.569}}]}}]}, {FilledCurveBox[{{Line[{{43.783, 8.569}, {45.246, 395 | 8.569}, {45.246, 21.188000000000002`}, {43.783, 21.188000000000002`}, 396 | {43.783, 8.569}}]}}]}}, {FilledCurveBox[{{Line[{{40.947, 4.911}, {59.787000000000006`, 397 | 4.911}, {59.787000000000006`, 6.922}, {40.947, 6.922}, {40.947, 4.911 398 | }}]}}]}, {FilledCurveBox[{{Line[{{44.057, 31.675}, {56.678000000000004`, 399 | 31.675}, {56.678000000000004`, 39.051}, {44.057, 39.051}, {44.057, 31.675 400 | }}]}}]}, {FilledCurveBox[{{Line[{{44.057, 43.685}, {56.678000000000004`, 401 | 43.685}, {56.678000000000004`, 65.089}, {44.057, 65.089}, {44.057, 43.685 402 | }}]}}]}}}, {{{1, 0}, {0, -1}}, Center}], {ImageSize -> {Automatic, Dynamic[ 403 | 3.5 CurrentValue["FontCapHeight"] / AbsoluteCurrentValue[Magnification 404 | ]]}, PlotRange -> {{20, 80}, {0, 70}}, BaseStyle -> {CacheGraphics -> 405 | False}, ImageSize -> 30}], GridBox[{{RowBox[{TagBox["\"DestinationIPAddress: \"", 406 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[RowBox[{"IPAddress", 407 | "[", "\"127.0.0.1\"", "]"}], "SummaryItem"]}]}, {RowBox[{TagBox["\"DestinationPort: \"", 408 | "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"63781\"", "SummaryItem" 409 | ]}]}, {RowBox[{TagBox["\"SourceIPAddress: \"", "SummaryItemAnnotation" 410 | ], "\[InvisibleSpace]", TagBox[RowBox[{"IPAddress", "[", "\"::500:5bde:ff17:6166\"", 411 | "]"}], "SummaryItem"]}]}, {RowBox[{TagBox["\"SourcePort: \"", "SummaryItemAnnotation" 412 | ], "\[InvisibleSpace]", TagBox["\"0\"", "SummaryItem"]}]}, {RowBox[{TagBox[ 413 | "\"Protocol: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[ 414 | "\"ZMQ_PAIR\"", "SummaryItem"]}]}}, GridBoxAlignment -> {"Columns" -> 415 | {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize 416 | -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings 417 | -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> {ShowStringCharacters 418 | -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles 419 | -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> 420 | False, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic 421 | }}}, BaselinePosition -> {1, 1}]}, Dynamic[Typeset`open$$], ImageSize 422 | -> Automatic]}, "SummaryPanel"], DynamicModuleValues :> {}], "]"}], 423 | SocketObject["ZMQ-3ef55c1d-4a9b-4c18-866b-a2c013f75fc7"], Selectable 424 | -> False, Editable -> False, SelectWithContents -> True], "SummaryItem" 425 | ]}]} 426 | , 427 | { 428 | RowBox[ 429 | { 430 | TagBox["\"EvaluationCount: \"", 431 | "SummaryItemAnnotation"] 432 | , 433 | "\[InvisibleSpace]" 434 | 435 | , 436 | TagBox[ 437 | DynamicBox[ 438 | ToBoxes[ 439 | If[TrueQ[ 440 | ExternalEvaluate`Private`getSessionOpts["9d054758-6742-4dc1-bdf0-92cfab26dc91", 441 | "Exists"]], 442 | ExternalSessionObject[ 443 | "9d054758-6742-4dc1-bdf0-92cfab26dc91"]["EvaluationCount"] 444 | , 445 | None 446 | ] 447 | , 448 | StandardForm 449 | 450 | ] 451 | , 452 | TrackedSymbols 453 | :> {ExternalEvaluate`Private`$Links} 454 | ] 455 | , 456 | "SummaryItem" 457 | 458 | ] 459 | } 460 | ] 461 | } 462 | , 463 | { 464 | RowBox[ 465 | { 466 | TagBox["\"ProcessMemory: \"", 467 | "SummaryItemAnnotation"] 468 | , 469 | "\[InvisibleSpace]" 470 | 471 | , 472 | TagBox[ 473 | DynamicBox[ 474 | ToBoxes[ 475 | If[TrueQ[ 476 | ExternalEvaluate`Private`getSessionOpts["9d054758-6742-4dc1-bdf0-92cfab26dc91", 477 | "Exists"]], 478 | Refresh[ 479 | ExternalSessionObject["9d054758-6742-4dc1-bdf0-92cfab26dc91"]["ProcessMemory" 480 | ], UpdateInterval -> 5] 481 | , 482 | Missing[ 483 | "NotAvailable"] 484 | ] 485 | , 486 | StandardForm 487 | 488 | ] 489 | , 490 | TrackedSymbols 491 | :> {ExternalEvaluate`Private`$Links} 492 | ] 493 | , 494 | "SummaryItem" 495 | 496 | ] 497 | } 498 | ] 499 | } 500 | , 501 | { 502 | RowBox[ 503 | { 504 | TagBox["\"ProcessThreads: \"", 505 | "SummaryItemAnnotation"] 506 | , 507 | "\[InvisibleSpace]" 508 | 509 | , 510 | TagBox[ 511 | DynamicBox[ 512 | ToBoxes[ 513 | If[TrueQ[ 514 | ExternalEvaluate`Private`getSessionOpts["9d054758-6742-4dc1-bdf0-92cfab26dc91", 515 | "Exists"]], 516 | Refresh[ 517 | ExternalSessionObject["9d054758-6742-4dc1-bdf0-92cfab26dc91"]["ProcessThreads" 518 | ], UpdateInterval -> 5] 519 | , 520 | Missing[ 521 | "NotAvailable"] 522 | ] 523 | , 524 | StandardForm 525 | 526 | ] 527 | , 528 | TrackedSymbols 529 | :> {ExternalEvaluate`Private`$Links} 530 | ] 531 | , 532 | "SummaryItem" 533 | 534 | ] 535 | } 536 | ] 537 | } 538 | , 539 | { 540 | RowBox[ 541 | { 542 | TagBox["\"SessionTime: \"", 543 | "SummaryItemAnnotation"] 544 | , 545 | "\[InvisibleSpace]" 546 | 547 | , 548 | TagBox[ 549 | DynamicBox[ 550 | ToBoxes[ 551 | If[TrueQ[ 552 | ExternalEvaluate`Private`getSessionOpts["9d054758-6742-4dc1-bdf0-92cfab26dc91", 553 | "Exists"]], 554 | Refresh[ 555 | ExternalSessionObject["9d054758-6742-4dc1-bdf0-92cfab26dc91"]["SessionTime" 556 | ], UpdateInterval -> 1] 557 | , 558 | Missing[ 559 | "NotAvailable"] 560 | ] 561 | , 562 | StandardForm 563 | 564 | ] 565 | , 566 | TrackedSymbols 567 | :> {ExternalEvaluate`Private`$Links} 568 | ] 569 | , 570 | "SummaryItem" 571 | 572 | ] 573 | } 574 | ] 575 | } 576 | } 577 | , 578 | GridBoxAlignment -> {"Columns" 579 | -> {{Left}}, "Rows" -> {{Automatic}}} 580 | , 581 | AutoDelete -> False 582 | , 583 | GridBoxItemSize -> {"Columns" 584 | -> {{Automatic}}, "Rows" -> {{Automatic}}} 585 | , 586 | GridBoxSpacings -> {"Columns" 587 | -> {{2}}, "Rows" -> {{Automatic}}} 588 | , 589 | BaseStyle -> {ShowStringCharacters 590 | -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles 591 | -> False} 592 | ] 593 | } 594 | } 595 | , 596 | GridBoxAlignment -> {"Rows" -> 597 | {{Top}}} 598 | , 599 | AutoDelete -> False 600 | , 601 | GridBoxItemSize -> {"Columns" 602 | -> {{Automatic}}, "Rows" -> {{Automatic}}} 603 | , 604 | BaselinePosition -> {1, 1} 605 | ] 606 | } 607 | , 608 | Dynamic[Typeset`open$$] 609 | , 610 | ImageSize -> Automatic 611 | ] 612 | } 613 | , 614 | "SummaryPanel" 615 | ] 616 | , 617 | DynamicModuleValues :> {} 618 | ] 619 | , 620 | "]" 621 | } 622 | ] 623 | , 624 | ExternalSessionObject["9d054758-6742-4dc1-bdf0-92cfab26dc91" 625 | ] 626 | , 627 | Editable -> False 628 | , 629 | SelectWithContents -> True 630 | , 631 | Selectable -> False 632 | ] 633 | ] 634 | , 635 | "Output" 636 | , 637 | CellChangeTimes -> {3.834825666132516*^9, 3.846040782326826*^9, 638 | 3.8460410050460367`*^9, 3.8460417800745296`*^9, 3.84604188615975*^9, 639 | {3.84604207782257*^9, 3.846042090548864*^9}, 3.846042311852193*^9, 3.846158308474115*^9, 640 | 3.8461667215366983`*^9, 3.846407988043374*^9, 3.84640814915168*^9, 3.846408238546768*^9 641 | } 642 | , 643 | CellLabel -> "Out[5]=" 644 | , 645 | ExpressionUUID -> "e620fb46-ca28-4cc2-9a58-49a749a12856" 646 | 647 | ] 648 | } 649 | , 650 | Open 651 | ] 652 | ] 653 | , 654 | Cell[BoxData[RowBox[{RowBox[{"TestExpr", "[", RowBox[{"expr_", 655 | ",", " ", RowBox[{"verbose_", ":", "False"}], ",", " ", RowBox[{"tol_", 656 | ":", "1*^-8"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{RowBox[ 657 | {"{", RowBox[{"exprPy", ",", "resM", ",", "resP", ",", " ", "valid"}], 658 | "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Function", 659 | " ", "that", " ", "compares", " ", "the", " ", "Mathematica", " ", "result", 660 | " ", "to", " ", "the", " ", "python", " ", "result"}], " ", "*)"}], 661 | "\[IndentingNewLine]", RowBox[{RowBox[{"exprPy", "=", RowBox[{"ToPython", 662 | "[", RowBox[{"expr", ",", RowBox[{"Copy", "\[Rule]", "False"}]}], "]" 663 | }]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"evaluate", 664 | " ", "the", " ", "expressions", " ", "in", " ", "Mathematica", " ", 665 | "and", " ", "in", " ", "python"}], " ", "*)"}], "\[IndentingNewLine]", 666 | RowBox[{"resM", "=", RowBox[{"Normal", "[", RowBox[{"expr", "/.", "vals" 667 | }], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[ 668 | {"If", "[", RowBox[{RowBox[{"ArrayQ", "[", "resM", "]"}], ",", "\[IndentingNewLine]", 669 | RowBox[{"resP", "=", RowBox[{"N", "@", RowBox[{"ExternalEvaluate", "[", 670 | RowBox[{"session", ",", RowBox[{"exprPy", "<>", "\"\<.tolist()\>\""} 671 | ]}], "]"}]}]}], "\[IndentingNewLine]", ",", RowBox[{"(*", "else", "*)" 672 | }], "\[IndentingNewLine]", RowBox[{"resP", "=", RowBox[{"N", "@", RowBox[ 673 | {"ExternalEvaluate", "[", RowBox[{"session", ",", "exprPy"}], "]"}]}] 674 | }]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[ 675 | {"valid", "=", RowBox[{RowBox[{"Norm", "[", RowBox[{"resM", "-", "resP" 676 | }], "]"}], "<", RowBox[{"tol", "+", RowBox[{"tol", "*", RowBox[{"Mean", 677 | "[", RowBox[{"Norm", "/@", RowBox[{"{", RowBox[{"resM", ",", "resP"} 678 | ], "}"}]}], "]"}]}]}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", 679 | RowBox[{"If", "[", RowBox[{"verbose", ",", RowBox[{"Print", "@", RowBox[ 680 | {"StringForm", "[", RowBox[{"\"\<`` =?= ``\>\"", ",", " ", "resM", ",", 681 | " ", "resP"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[ 682 | {"If", "[", RowBox[{RowBox[{"valid", "=!=", "True"}], ",", "\[IndentingNewLine]", 683 | RowBox[{"Print", "@", RowBox[{"StringForm", "[", RowBox[{"\"\\"", 684 | ",", "\[IndentingNewLine]", RowBox[{"InputForm", "@", "expr"}], ",", 685 | "exprPy", ",", "resM", ",", "resP", ",", RowBox[{"Norm", "[", RowBox[ 686 | {"resM", "-", "resP"}], "]"}]}], "]"}]}]}], "\[IndentingNewLine]", "]" 687 | }], ";"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes 688 | -> {{3.8170417020811777`*^9, 3.81704172657474*^9}, {3.81704179280335*^9, 689 | 3.817041840489778*^9}, {3.817041927575897*^9, 3.817042036063344*^9}, 690 | {3.8170421879989634`*^9, 3.817042226019485*^9}, {3.817042299961542*^9, 691 | 3.817042425907525*^9}, {3.8171187981847067`*^9, 3.817118837881874*^9 692 | }, {3.817118869098439*^9, 3.817118901147331*^9}, {3.817118980087762*^9, 693 | 3.81711925677897*^9}, {3.81711928731602*^9, 3.817119290162525*^9}, { 694 | 3.8171196009707813`*^9, 3.8171196235745583`*^9}, {3.817133292637014*^9, 695 | 3.817133292955245*^9}, {3.8172200224753237`*^9, 3.817220038170822*^9 696 | }, {3.8172201143851852`*^9, 3.817220171218865*^9}, {3.8172202219502983`*^9, 697 | 3.817220222379529*^9}, {3.817220443941942*^9, 3.8172204825096703`*^9 698 | }, {3.817220514090167*^9, 3.817220515003347*^9}, {3.8348256851524878`*^9, 699 | 3.8348256887404423`*^9}, {3.846042112354926*^9, 3.846042137622614*^9 700 | }}, CellLabel -> "In[10]:=", ExpressionUUID -> "1daf2eb3-6166-48ed-992f-1473b56947a1" 701 | ] 702 | } 703 | , 704 | Open 705 | ] 706 | ] 707 | , 708 | Cell[CellGroupData[{Cell["Test cases", "Section", CellChangeTimes 709 | -> {{3.846042058634193*^9, 3.8460420644426203`*^9}}, ExpressionUUID 710 | -> "a27a99f9-bd12-46d4-8624-85cc4f3e3bb5"], Cell[CellGroupData[{Cell[ 711 | "Test numeric examples", "Subsection", CellChangeTimes -> {{3.817007935108295*^9, 712 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020708510957*^9}, 713 | {3.817041939215971*^9, 3.817041941599523*^9}, {3.8170421343013906`*^9, 714 | 3.817042142368922*^9}, {3.8170422708990498`*^9, 3.8170422957666273`*^9 715 | }, {3.817120307551271*^9, 3.817120316935302*^9}, {3.817273522417403*^9, 716 | 3.817273542125928*^9}, {3.817273580569841*^9, 3.817273583701936*^9}, 717 | {3.846041902853119*^9, 3.846041924803459*^9}}, ExpressionUUID -> "5185dd86-dec4-4c26-8e48-124321882ccc" 718 | ], Cell[BoxData[RowBox[{"TestExpr", "[", "2", "]"}]], "Input", CellChangeTimes 719 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 720 | 3.817020708510957*^9}, {3.817041939215971*^9, 3.817041941599523*^9}, 721 | {3.8170421343013906`*^9, 3.817042142368922*^9}, {3.8170422708990498`*^9, 722 | 3.8170422957666273`*^9}, {3.817120307551271*^9, 3.817120316935302*^9 723 | }, {3.817273522417403*^9, 3.817273542125928*^9}, {3.817273580569841*^9, 724 | 3.817273583701936*^9}, {3.846041902853119*^9, 3.846041922919067*^9}}, 725 | CellLabel -> "In[11]:=", ExpressionUUID -> "d2ab5645-70dd-4a4c-a916-861a7f41c40f" 726 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"1", "/", "3"}], "]" 727 | }]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 728 | }, {3.817020691587697*^9, 3.817020708510957*^9}, {3.817041939215971*^9, 729 | 3.817041941599523*^9}, {3.8170421343013906`*^9, 3.817042142368922*^9 730 | }, {3.8170422708990498`*^9, 3.8170422957666273`*^9}, {3.817120307551271*^9, 731 | 3.817120316935302*^9}, {3.817273522417403*^9, 3.817273542125928*^9}, 732 | {3.817273580569841*^9, 3.817273583701936*^9}, {3.846041902853119*^9, 733 | 3.846041908793754*^9}}, CellLabel -> "In[12]:=", ExpressionUUID -> "bf998445-7f53-4e06-aa2b-bbedde1dd042" 734 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"1.", "/", "3"}], "]" 735 | }]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 736 | }, {3.817020691587697*^9, 3.817020708510957*^9}, {3.817041939215971*^9, 737 | 3.817041941599523*^9}, {3.8170421343013906`*^9, 3.817042142368922*^9 738 | }, {3.8170422708990498`*^9, 3.8170422957666273`*^9}, {3.817120307551271*^9, 739 | 3.817120316935302*^9}, {3.817273522417403*^9, 3.817273542125928*^9}, 740 | {3.817273580569841*^9, 3.817273583701936*^9}, {3.846041902853119*^9, 741 | 3.846041911460279*^9}}, CellLabel -> "In[13]:=", ExpressionUUID -> "ad674aef-74e7-4220-8935-283e9c43e016" 742 | ], Cell[BoxData[RowBox[{"TestExpr", "[", "2.31", "]"}]], "Input", CellChangeTimes 743 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 744 | 3.817020708510957*^9}, {3.817041939215971*^9, 3.817041941599523*^9}, 745 | {3.8170421343013906`*^9, 3.817042142368922*^9}, {3.8170422708990498`*^9, 746 | 3.8170422957666273`*^9}, {3.817120307551271*^9, 3.817120316935302*^9 747 | }, {3.817273522417403*^9, 3.817273542125928*^9}, {3.817273580569841*^9, 748 | 3.817273583701936*^9}, {3.846041902853119*^9, 3.846041912381846*^9}}, 749 | CellLabel -> "In[14]:=", ExpressionUUID -> "891d4fba-9677-40a3-aa36-ac911d861410" 750 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"2.31", "+", RowBox[ 751 | {"5.3", "I"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 752 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020708510957*^9}, 753 | {3.817041939215971*^9, 3.817041941599523*^9}, {3.8170421343013906`*^9, 754 | 3.817042142368922*^9}, {3.8170422708990498`*^9, 3.8170422957666273`*^9 755 | }, {3.817120307551271*^9, 3.817120316935302*^9}, {3.817273522417403*^9, 756 | 3.817273542125928*^9}, {3.817273580569841*^9, 3.817273583701936*^9}, 757 | {3.846041902853119*^9, 3.8460419129741993`*^9}}, CellLabel -> "In[15]:=", 758 | ExpressionUUID -> "d7af6c11-af2c-467a-a27e-4d20c06250f9"], Cell[BoxData[ 759 | RowBox[{"TestExpr", "[", "1*^30", "]"}]], "Input", CellChangeTimes -> 760 | {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 761 | 3.817020708510957*^9}, {3.817041939215971*^9, 3.817041941599523*^9}, 762 | {3.8170421343013906`*^9, 3.817042142368922*^9}, {3.8170422708990498`*^9, 763 | 3.8170422957666273`*^9}, {3.817120307551271*^9, 3.817120316935302*^9 764 | }, {3.817273522417403*^9, 3.817273542125928*^9}, {3.817273580569841*^9, 765 | 3.817273583701936*^9}, {3.846041902853119*^9, 3.846041913542753*^9}}, 766 | CellLabel -> "In[16]:=", ExpressionUUID -> "9da2859f-5de4-41ed-834e-b6411e93e3c8" 767 | ], Cell[BoxData[RowBox[{"TestExpr", "[", "1*^-30", "]"}]], "Input", CellChangeTimes 768 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 769 | 3.817020708510957*^9}, {3.817041939215971*^9, 3.817041941599523*^9}, 770 | {3.8170421343013906`*^9, 3.817042142368922*^9}, {3.8170422708990498`*^9, 771 | 3.8170422957666273`*^9}, {3.817120307551271*^9, 3.817120316935302*^9 772 | }, {3.817273522417403*^9, 3.817273542125928*^9}, {3.817273580569841*^9, 773 | 3.817273583701936*^9}, {3.846041902853119*^9, 3.846041914105044*^9}}, 774 | CellLabel -> "In[17]:=", ExpressionUUID -> "6967dc5d-a3ee-456d-8e2b-c49ae6fd06df" 775 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"N", "[", RowBox[{"Pi", 776 | ",", "40"}], "]"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 777 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020708510957*^9}, 778 | {3.817041939215971*^9, 3.817041941599523*^9}, {3.8170421343013906`*^9, 779 | 3.817042142368922*^9}, {3.8170422708990498`*^9, 3.8170422957666273`*^9 780 | }, {3.817120307551271*^9, 3.817120316935302*^9}, {3.817273522417403*^9, 781 | 3.817273542125928*^9}, {3.817273580569841*^9, 3.817273583701936*^9}, 782 | {3.846041902853119*^9, 3.846041914651318*^9}}, CellLabel -> "In[18]:=", 783 | ExpressionUUID -> "b724c4b6-a2eb-4f9d-816c-3b5afb62e3f1"]}, Open]], 784 | Cell[CellGroupData[{Cell["Test simple expressions", "Subsection", CellChangeTimes 785 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.8170418609071417`*^9, 786 | 3.817041872218865*^9}, 3.817042250551552*^9, {3.817120284841795*^9, 787 | 3.817120284977632*^9}, {3.817273573444448*^9, 3.8172735792254133`*^9}, 788 | {3.8243812261167088`*^9, 3.824381227200451*^9}, {3.824385042461767*^9, 789 | 3.82438504484193*^9}, {3.8460407883889914`*^9, 3.846040796525504*^9}, 790 | {3.846041929532474*^9, 3.846041932973956*^9}}, ExpressionUUID -> "740923fd-dd9e-45ca-b781-36fcddb044a7" 791 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"a", "+", "b"}], "]" 792 | }]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 793 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 794 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 795 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 796 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 797 | 3.846040796525504*^9}, 3.846041929532474*^9, 3.846041973392763*^9}, 798 | CellLabel -> "In[19]:=", ExpressionUUID -> "622a3868-cc93-4e9f-9244-dd90a3b0e230" 799 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"a", "+", "b", "+", 800 | "d"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 801 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 802 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 803 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 804 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 805 | 3.846040796525504*^9}, 3.846041929532474*^9, {3.846041973392763*^9, 806 | 3.846041973899994*^9}}, CellLabel -> "In[20]:=", ExpressionUUID -> "d01a1f82-0634-497a-bd28-045fa1359270" 807 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"a", "*", "b"}], "]" 808 | }]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 809 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 810 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 811 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 812 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 813 | 3.846040796525504*^9}, 3.846041929532474*^9, {3.846041973392763*^9, 814 | 3.846041974404408*^9}}, CellLabel -> "In[21]:=", ExpressionUUID -> "d0960264-a1eb-4839-825b-0c85d421789c" 815 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"a", "*", "b", "*", 816 | "c"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 817 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 818 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 819 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 820 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 821 | 3.846040796525504*^9}, 3.846041929532474*^9, {3.846041973392763*^9, 822 | 3.846041974950733*^9}}, CellLabel -> "In[22]:=", ExpressionUUID -> "43e88e09-b2cb-4b40-9ef3-257eb977fb9c" 823 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"a", "/", "b"}], "]" 824 | }]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 825 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 826 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 827 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 828 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 829 | 3.846040796525504*^9}, 3.846041929532474*^9, {3.846041973392763*^9, 830 | 3.846041975415821*^9}}, CellLabel -> "In[23]:=", ExpressionUUID -> "b7ce3257-a3a1-47e8-b3d8-3b4360a0a4a2" 831 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{RowBox[{"(", RowBox[ 832 | {"a", "+", "b"}], ")"}], "/", RowBox[{"(", RowBox[{"d", "+", "e", "+", 833 | "g"}], ")"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 834 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 835 | }, 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 836 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 837 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 838 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 839 | {3.846041973392763*^9, 3.846041976071169*^9}}, CellLabel -> "In[24]:=", 840 | ExpressionUUID -> "8430173d-a223-44f9-8854-a777595d6f28"], Cell[BoxData[ 841 | RowBox[{"TestExpr", "[", RowBox[{RowBox[{"(", RowBox[{"a", "+", "b"}], 842 | ")"}], "^", RowBox[{"(", RowBox[{"d", "+", "e", "+", "g"}], ")"}]}], 843 | "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9 844 | }, {3.8170418609071417`*^9, 3.817041872218865*^9}, 3.817042250551552*^9, 845 | {3.817120284841795*^9, 3.817120284977632*^9}, {3.817273573444448*^9, 846 | 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 3.824381227200451*^9 847 | }, {3.824385042461767*^9, 3.82438504484193*^9}, {3.8460407883889914`*^9, 848 | 3.846040796525504*^9}, 3.846041929532474*^9, {3.846041973392763*^9, 849 | 3.846041976569558*^9}}, CellLabel -> "In[25]:=", ExpressionUUID -> "6dac367c-012b-4f05-910e-5e1cdb6b9d36" 850 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"Exp", "[", RowBox[{ 851 | "a", "+", "b"}], "]"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 852 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 853 | }, 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 854 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 855 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 856 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 857 | {3.846041973392763*^9, 3.846041977947075*^9}}, CellLabel -> "In[26]:=", 858 | ExpressionUUID -> "e89b6c2c-4333-4c40-b1b7-71690b6227c0"], Cell[BoxData[ 859 | RowBox[{"TestExpr", "[", RowBox[{RowBox[{"Sin", "[", RowBox[{"(", RowBox[ 860 | {"a", "+", "b"}], ")"}], "]"}], "/", RowBox[{"Cos", "[", RowBox[{"d", 861 | "+", "e"}], "]"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 862 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 863 | }, 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 864 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 865 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 866 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 867 | {3.846041973392763*^9, 3.846041978438273*^9}}, CellLabel -> "In[27]:=", 868 | ExpressionUUID -> "e8909287-f2aa-46b1-82c2-11d3ae21304d"], Cell[BoxData[ 869 | RowBox[{"TestExpr", "[", RowBox[{RowBox[{"Sin", "[", RowBox[{"(", RowBox[ 870 | {"a", "+", "b"}], ")"}], "]"}], "/", RowBox[{"Tanh", "[", RowBox[{"d", 871 | "+", "e"}], "]"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 872 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 873 | }, 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 874 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 875 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 876 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 877 | {3.846041973392763*^9, 3.846041978892454*^9}}, CellLabel -> "In[28]:=", 878 | ExpressionUUID -> "67fd3b61-19e7-4444-9c7b-8d4becc7480c"], Cell[BoxData[ 879 | RowBox[{"TestExpr", "[", RowBox[{"\[Pi]", " ", RowBox[{"Cosh", "[", "a", 880 | "]"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 881 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9 882 | }, 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 883 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 884 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 885 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 886 | {3.846041973392763*^9, 3.8460419793917923`*^9}}, CellLabel -> "In[29]:=", 887 | ExpressionUUID -> "fdef6874-99c9-4558-8fca-639ab5cd2100"], Cell[BoxData[ 888 | RowBox[{"TestExpr", "[", RowBox[{"1", "/", RowBox[{"Sqrt", "[", "a", 889 | "]"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 890 | 3.817007961051466*^9}, {3.8170418609071417`*^9, 3.817041872218865*^9}, 891 | 3.817042250551552*^9, {3.817120284841795*^9, 3.817120284977632*^9}, 892 | {3.817273573444448*^9, 3.8172735792254133`*^9}, {3.8243812261167088`*^9, 893 | 3.824381227200451*^9}, {3.824385042461767*^9, 3.82438504484193*^9}, 894 | {3.8460407883889914`*^9, 3.846040796525504*^9}, 3.846041929532474*^9, 895 | {3.846041973392763*^9, 3.846041979873971*^9}}, CellLabel -> "In[30]:=", 896 | ExpressionUUID -> "dd120ca1-848e-423b-8132-8a4ad1af66b7"]}, Open]], 897 | Cell[CellGroupData[{Cell["Test more complex expression", "Subsection", 898 | CellChangeTimes -> {{3.846158166621696*^9, 3.846158172465621*^9}}, ExpressionUUID 899 | -> "f8397244-1ddc-4683-9ba2-1631f6f2ff53"], Cell[BoxData[RowBox[{RowBox[ 900 | {"xs", "=", RowBox[{"x", "/.", RowBox[{"Solve", "[", RowBox[{RowBox[{ 901 | RowBox[{RowBox[{"a", "*", RowBox[{"x", "^", "2"}]}], "-", RowBox[{"b", 902 | "*", "x"}], "+", "c"}], "\[Equal]", "0"}], ",", "x"}], "]"}]}]}], ";" 903 | }]], "Input", CellChangeTimes -> {{3.846158181269034*^9, 3.846158184218039*^9 904 | }, {3.8461582922280684`*^9, 3.846158299353643*^9}, {3.846158415782278*^9, 905 | 3.846158482201703*^9}, {3.8461591530743628`*^9, 3.846159182503839*^9 906 | }, {3.84616668901619*^9, 3.84616671474564*^9}}, CellLabel -> "In[31]:=", 907 | ExpressionUUID -> "4a484416-8716-4c9a-a177-e23d82b841bf"], Cell[BoxData[ 908 | RowBox[{"TestExpr", "[", RowBox[{"xs", "[", RowBox[{"[", "1", "]"}], 909 | "]"}], "]"}]], "Input", CellChangeTimes -> {{3.846158181269034*^9, 3.846158184218039*^9 910 | }, {3.8461582922280684`*^9, 3.846158299353643*^9}, {3.846158415782278*^9, 911 | 3.846158482201703*^9}, {3.8461591530743628`*^9, 3.846159188526732*^9 912 | }}, CellLabel -> "In[32]:=", ExpressionUUID -> "4124d2cf-9243-403b-88b8-8fc04ac56def" 913 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"xs", "[", RowBox[{"[", 914 | "2", "]"}], "]"}], "]"}]], "Input", CellChangeTimes -> {3.8461591911438313`*^9 915 | }, CellLabel -> "In[33]:=", ExpressionUUID -> "05090169-8f98-4d80-a8c4-a624f7083a03" 916 | ], Cell[BoxData[RowBox[{"TestExpr", "@", RowBox[{"Assuming", "[", RowBox[ 917 | {RowBox[{RowBox[{"a", ">", "0"}], "&&", RowBox[{"c", ">", "0"}]}], ",", 918 | RowBox[{"Simplify", "@", RowBox[{"Norm", "@", RowBox[{"{", RowBox[{RowBox[ 919 | {"{", RowBox[{RowBox[{"Sin", "[", "a", "]"}], ",", RowBox[{"Sqrt", "[", 920 | "c", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", RowBox[{"a", 921 | "^", "2"}]}], "}"}]}], "}"}]}]}]}], "]"}]}]], "Input", CellChangeTimes 922 | -> {{3.846408000340914*^9, 3.846408017120659*^9}, {3.84640816301118*^9, 923 | 3.846408179006751*^9}}, CellLabel -> "In[34]:=", ExpressionUUID -> "47d0e7b8-7fc1-41ab-a340-d7245957e301" 924 | ]}, Open]], Cell[CellGroupData[{Cell["Test constants", "Subsection", 925 | CellChangeTimes -> {{3.817219734532898*^9, 3.817219757613577*^9}, {3.81727358772644*^9, 926 | 3.8172735887082853`*^9}, {3.846041981098611*^9, 3.8460419985237017`*^9 927 | }}, ExpressionUUID -> "8b3d5e80-8e20-438b-87ee-ceea90da1c2e"], Cell[BoxData[ 928 | RowBox[{"TestExpr", "[", "Pi", "]"}]], "Input", CellChangeTimes -> {{ 929 | 3.817219734532898*^9, 3.817219757613577*^9}, {3.81727358772644*^9, 3.8172735887082853`*^9 930 | }, {3.846041981098611*^9, 3.846041982203734*^9}}, CellLabel -> "In[35]:=", 931 | ExpressionUUID -> "37d2d871-953e-4c23-bc44-f83a3b622304"], Cell[BoxData[ 932 | RowBox[{"TestExpr", "[", "E", "]"}]], "Input", CellChangeTimes -> {{3.817219734532898*^9, 933 | 3.817219757613577*^9}, {3.81727358772644*^9, 3.8172735887082853`*^9}, 934 | {3.846041981098611*^9, 3.846041982203734*^9}}, CellLabel -> "In[36]:=", 935 | ExpressionUUID -> "8f765bef-c3b4-4a72-889e-faed0af5e750"], Cell[BoxData[ 936 | RowBox[{"TestExpr", "[", RowBox[{"N", "@", RowBox[{"Sqrt", "[", "2", 937 | "]"}]}], "]"}]], "Input", CellChangeTimes -> {{3.817219734532898*^9, 938 | 3.817219757613577*^9}, {3.81727358772644*^9, 3.8172735887082853`*^9}, 939 | {3.846041981098611*^9, 3.846041983003277*^9}}, CellLabel -> "In[37]:=", 940 | ExpressionUUID -> "d58c4ae4-2ee3-4f60-8649-e005867fbd14"], Cell[BoxData[ 941 | RowBox[{"TestExpr", "[", RowBox[{"N", "@", "Pi"}], "]"}]], "Input", CellChangeTimes 942 | -> {{3.817219734532898*^9, 3.817219757613577*^9}, {3.81727358772644*^9, 943 | 3.8172735887082853`*^9}, {3.846041981098611*^9, 3.846041983504922*^9 944 | }}, CellLabel -> "In[38]:=", ExpressionUUID -> "beed9989-7b46-45f6-b92e-d9534e983cae" 945 | ]}, Open]], Cell[CellGroupData[{Cell["Test array handling", "Subsection", 946 | CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 947 | 3.817020703952483*^9}, {3.817042042716785*^9, 3.817042043976235*^9}, 948 | {3.81711939281493*^9, 3.817119394171856*^9}, {3.817133214478402*^9, 949 | 3.817133216574778*^9}, {3.817220529995721*^9, 3.8172205307949047`*^9}, 950 | {3.817273590716207*^9, 3.817273591432549*^9}, {3.846041987064098*^9, 951 | 3.846042008138753*^9}}, ExpressionUUID -> "292185a9-2fb5-4cee-ba04-979e10b4d536" 952 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"{", RowBox[{"a", ",", 953 | "b", ",", "c"}], "}"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 954 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020703952483*^9}, 955 | {3.817042042716785*^9, 3.817042043976235*^9}, {3.81711939281493*^9, 956 | 3.817119394171856*^9}, {3.817133214478402*^9, 3.817133216574778*^9}, 957 | {3.817220529995721*^9, 3.8172205307949047`*^9}, {3.817273590716207*^9, 958 | 3.817273591432549*^9}, {3.846041987064098*^9, 3.8460419875670156`*^9 959 | }}, CellLabel -> "In[39]:=", ExpressionUUID -> "9325edd7-eacf-45d9-a0aa-6cb7fc2b9707" 960 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"{", RowBox[{"{", RowBox[ 961 | {"1", ",", "2", ",", "3"}], "}"}], "}"}], "]"}]], "Input", CellChangeTimes 962 | -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 963 | 3.817020703952483*^9}, {3.817042042716785*^9, 3.817042043976235*^9}, 964 | {3.81711939281493*^9, 3.817119394171856*^9}, {3.817133214478402*^9, 965 | 3.817133216574778*^9}, {3.817220529995721*^9, 3.8172205307949047`*^9}, 966 | {3.817273590716207*^9, 3.817273591432549*^9}, {3.846041987064098*^9, 967 | 3.846041988161628*^9}}, CellLabel -> "In[40]:=", ExpressionUUID -> "8c4b586c-c3d0-42ee-a1e6-2e373492ac18" 968 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"Cos", "[", RowBox[{ 969 | "{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], "]"}], "]"}]], "Input", 970 | CellChangeTimes -> {{3.817007935108295*^9, 3.817007961051466*^9}, {3.817020691587697*^9, 971 | 3.817020703952483*^9}, {3.817042042716785*^9, 3.817042043976235*^9}, 972 | {3.81711939281493*^9, 3.817119394171856*^9}, {3.817133214478402*^9, 973 | 3.817133216574778*^9}, {3.817220529995721*^9, 3.8172205307949047`*^9}, 974 | {3.817273590716207*^9, 3.817273591432549*^9}, {3.846041987064098*^9, 975 | 3.846041988725069*^9}}, CellLabel -> "In[41]:=", ExpressionUUID -> "55454dae-6e1e-4815-94e6-523a2247c161" 976 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"NumericArray", "[", 977 | RowBox[{RowBox[{"{", RowBox[{RowBox[{"{", RowBox[{"1", ",", "2"}], "}" 978 | }], ",", RowBox[{"{", RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", "\"\\"" 979 | }], "]"}], "]"}]], "Input", CellChangeTimes -> {{3.817007935108295*^9, 980 | 3.817007961051466*^9}, {3.817020691587697*^9, 3.817020703952483*^9}, 981 | {3.817042042716785*^9, 3.817042043976235*^9}, {3.81711939281493*^9, 982 | 3.817119394171856*^9}, {3.817133214478402*^9, 3.817133216574778*^9}, 983 | {3.817220529995721*^9, 3.8172205307949047`*^9}, {3.817273590716207*^9, 984 | 3.817273591432549*^9}, {3.846041987064098*^9, 3.846041988725069*^9}}, 985 | CellLabel -> "In[42]:=", ExpressionUUID -> "80f5a18a-2e1c-43d0-9b42-8e79c2facab6" 986 | ]}, Open]], Cell[CellGroupData[{Cell["Test special functions of one argument", 987 | "Subsection", CellChangeTimes -> {{3.817119378001226*^9, 3.817119478821705*^9 988 | }, {3.817119841126937*^9, 3.8171199085150433`*^9}, {3.817120294809811*^9, 989 | 3.8171202949819508`*^9}, {3.817273244838635*^9, 3.817273261133836*^9 990 | }, {3.817273561872357*^9, 3.817273563524414*^9}, {3.8460419904284897`*^9, 991 | 3.846042015638241*^9}}, ExpressionUUID -> "9004b91b-2ef8-48dc-bf1f-39d9648a9831" 992 | ], Cell[BoxData[RowBox[{RowBox[{"Map", "[", RowBox[{RowBox[{RowBox[{"TestExpr", 993 | "[", RowBox[{"#", "[", RowBox[{"a", "-", "c"}], "]"}], "]"}], "&"}], 994 | ",", RowBox[{"{", RowBox[{"Log10", ",", "Sqrt", ",", "Exp", ",", "Sin", 995 | ",", "Cos", ",", "Tan", ",", "Csc", ",", "Sec", ",", "Cot", ",", "Sinh", 996 | ",", "Cosh", ",", "Tanh", ",", "Csch", ",", "Sech", ",", "Coth", ",", 997 | " ", "Gamma"}], "}"}]}], "]"}], ";"}]], "Input", CellChangeTimes -> 998 | {{3.817119378001226*^9, 3.817119478821705*^9}, {3.817119841126937*^9, 999 | 3.8171199085150433`*^9}, {3.817120294809811*^9, 3.8171202949819508`*^9 1000 | }, {3.817273244838635*^9, 3.817273261133836*^9}, {3.817273561872357*^9, 1001 | 3.817273563524414*^9}, 3.8460419904284897`*^9}, CellLabel -> "In[43]:=", 1002 | ExpressionUUID -> "0c207f89-6be0-4cb7-b228-331ba7e2e930"]}, Open]], 1003 | Cell[CellGroupData[{Cell["Test special functions of two arguments", "Subsection", 1004 | CellChangeTimes -> {{3.817219195028184*^9, 3.817219220967013*^9}, {3.817219323326161*^9, 1005 | 3.8172193325693407`*^9}, {3.817273233785985*^9, 3.817273259608906*^9 1006 | }, 3.846041991510054*^9, {3.846042023129198*^9, 3.846042032414493*^9} 1007 | }, ExpressionUUID -> "07df250e-87b1-4228-9a21-d011319228fc"], Cell[BoxData[ 1008 | RowBox[{RowBox[{"Map", "[", RowBox[{RowBox[{RowBox[{"TestExpr", "[", 1009 | RowBox[{"#", "[", RowBox[{"a", ",", "b"}], "]"}], "]"}], "&"}], ",", 1010 | RowBox[{"{", RowBox[{"Gamma", ",", "BesselI", ",", "BesselJ", ",", "BesselK", 1011 | ",", "BesselY"}], "}"}]}], "]"}], ";"}]], "Input", CellChangeTimes -> 1012 | {{3.817219195028184*^9, 3.817219220967013*^9}, {3.817219323326161*^9, 1013 | 3.8172193325693407`*^9}, {3.817273233785985*^9, 3.817273259608906*^9 1014 | }, 3.846041991510054*^9}, CellLabel -> "In[44]:=", ExpressionUUID -> 1015 | "9662f5ee-5f1f-4b30-aa68-fe818f5045fd"]}, Open]], Cell[CellGroupData[ 1016 | {Cell["Test special functions for more complicated cases", "Subsection", 1017 | CellChangeTimes -> {{3.8172735000772457`*^9, 3.817273508216394*^9}, 1018 | {3.846041992808167*^9, 3.846041993470435*^9}, {3.846042027978241*^9, 1019 | 3.846042030735072*^9}}, ExpressionUUID -> "4e89ff29-6ed5-4222-b155-669840286e53" 1020 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"Arg", "[", RowBox[{ 1021 | "a", "+", RowBox[{"b", " ", "I"}]}], "]"}], "]"}]], "Input", CellChangeTimes 1022 | -> {{3.8172735000772457`*^9, 3.817273508216394*^9}, {3.846041992808167*^9, 1023 | 3.846041993470435*^9}}, CellLabel -> "In[45]:=", ExpressionUUID -> "66c391ad-09e8-4146-b5f4-2fbcc12aa3d5" 1024 | ], Cell[BoxData[RowBox[{"TestExpr", "[", RowBox[{"SphericalHarmonicY", 1025 | "[", RowBox[{"b", ",", "a", ",", "c", ",", "d"}], "]"}], "]"}]], "Input", 1026 | CellChangeTimes -> {{3.8172735000772457`*^9, 3.817273508216394*^9}, 1027 | 3.846041992808167*^9}, CellLabel -> "In[46]:=", ExpressionUUID -> "01377ee4-a30f-447b-8174-2568e047951d" 1028 | ]}, Open]]}, Open]] 1029 | } 1030 | , 1031 | WindowSize -> {808, 701} 1032 | , 1033 | WindowMargins -> {{172, Automatic}, {Automatic, 144}} 1034 | , 1035 | FrontEndVersion -> "12.1 for Mac OS X x86 (64-bit) (March 13, 2020)" 1036 | 1037 | , 1038 | StyleDefinitions -> "Default.nb" 1039 | , 1040 | ExpressionUUID -> "58567f7e-6c45-40f5-80ec-2593b646d55a" 1041 | ] 1042 | 1043 | (* End of Notebook Content *) 1044 | 1045 | (* Internal cache information *) 1046 | 1047 | (*CellTagsOutline 1048 | CellTagsIndex->{} 1049 | *) 1050 | 1051 | (*CellTagsIndex 1052 | CellTagsIndex->{} 1053 | *) 1054 | 1055 | (*NotebookFileOutline 1056 | Notebook[{ 1057 | Cell[558, 20, 884, 20, 73, "Input",ExpressionUUID->"ee6242fe-5738-42d7-927d-12c3be9f45f8"], 1058 | Cell[1445, 42, 490, 11, 52, "Input",ExpressionUUID->"b874d894-ea09-439a-90db-628140ef50ad"], 1059 | Cell[CellGroupData[{ 1060 | Cell[1960, 57, 163, 3, 67, "Section",ExpressionUUID->"7b6e915e-b4c7-474a-aaf3-aecc99a4e24d"], 1061 | Cell[CellGroupData[{ 1062 | Cell[2148, 64, 1029, 24, 52, "Input",ExpressionUUID->"be172ae8-6ece-4aaf-9126-d625e8d00a59"], 1063 | Cell[3180, 90, 778, 15, 34, "Output",ExpressionUUID->"27a592f9-7d00-4126-bc05-25ce5f6c16e2"] 1064 | }, Open ]], 1065 | Cell[CellGroupData[{ 1066 | Cell[3995, 110, 1939, 47, 157, "Input",ExpressionUUID->"2df5bef7-4ce7-41a3-919a-c19df456e2f3"], 1067 | Cell[5937, 159, 33262, 646, 62, "Output",ExpressionUUID->"e620fb46-ca28-4cc2-9a58-49a749a12856"] 1068 | }, Open ]], 1069 | Cell[39214, 808, 4030, 90, 409, "Input",ExpressionUUID->"1daf2eb3-6166-48ed-992f-1473b56947a1"] 1070 | }, Open ]], 1071 | Cell[CellGroupData[{ 1072 | Cell[43281, 903, 157, 3, 67, "Section",ExpressionUUID->"a27a99f9-bd12-46d4-8624-85cc4f3e3bb5"], 1073 | Cell[CellGroupData[{ 1074 | Cell[43463, 910, 558, 8, 54, "Subsection",ExpressionUUID->"5185dd86-dec4-4c26-8e48-124321882ccc"], 1075 | Cell[44024, 920, 598, 9, 30, "Input",ExpressionUUID->"d2ab5645-70dd-4a4c-a916-861a7f41c40f"], 1076 | Cell[44625, 931, 621, 10, 30, "Input",ExpressionUUID->"bf998445-7f53-4e06-aa2b-bbedde1dd042"], 1077 | Cell[45249, 943, 622, 10, 30, "Input",ExpressionUUID->"ad674aef-74e7-4220-8935-283e9c43e016"], 1078 | Cell[45874, 955, 601, 9, 30, "Input",ExpressionUUID->"891d4fba-9677-40a3-aa36-ac911d861410"], 1079 | Cell[46478, 966, 647, 11, 30, "Input",ExpressionUUID->"d7af6c11-af2c-467a-a27e-4d20c06250f9"], 1080 | Cell[47128, 979, 602, 9, 30, "Input",ExpressionUUID->"9da2859f-5de4-41ed-834e-b6411e93e3c8"], 1081 | Cell[47733, 990, 603, 9, 30, "Input",ExpressionUUID->"6967dc5d-a3ee-456d-8e2b-c49ae6fd06df"], 1082 | Cell[48339, 1001, 652, 11, 30, "Input",ExpressionUUID->"b724c4b6-a2eb-4f9d-816c-3b5afb62e3f1"] 1083 | }, Open ]], 1084 | Cell[CellGroupData[{ 1085 | Cell[49028, 1017, 543, 8, 54, "Subsection",ExpressionUUID->"740923fd-dd9e-45ca-b781-36fcddb044a7"], 1086 | Cell[49574, 1027, 598, 9, 30, "Input",ExpressionUUID->"622a3868-cc93-4e9f-9244-dd90a3b0e230"], 1087 | Cell[50175, 1038, 636, 10, 30, "Input",ExpressionUUID->"d01a1f82-0634-497a-bd28-045fa1359270"], 1088 | Cell[50814, 1050, 626, 10, 30, "Input",ExpressionUUID->"d0960264-a1eb-4839-825b-0c85d421789c"], 1089 | Cell[51443, 1062, 636, 10, 30, "Input",ExpressionUUID->"43e88e09-b2cb-4b40-9ef3-257eb977fb9c"], 1090 | Cell[52082, 1074, 626, 10, 30, "Input",ExpressionUUID->"b7ce3257-a3a1-47e8-b3d8-3b4360a0a4a2"], 1091 | Cell[52711, 1086, 734, 14, 30, "Input",ExpressionUUID->"8430173d-a223-44f9-8854-a777595d6f28"], 1092 | Cell[53448, 1102, 734, 14, 30, "Input",ExpressionUUID->"6dac367c-012b-4f05-910e-5e1cdb6b9d36"], 1093 | Cell[54185, 1118, 657, 11, 30, "Input",ExpressionUUID->"e89b6c2c-4333-4c40-b1b7-71690b6227c0"], 1094 | Cell[54845, 1131, 764, 15, 30, "Input",ExpressionUUID->"e8909287-f2aa-46b1-82c2-11d3ae21304d"], 1095 | Cell[55612, 1148, 765, 15, 30, "Input",ExpressionUUID->"67fd3b61-19e7-4444-9c7b-8d4becc7480c"], 1096 | Cell[56380, 1165, 664, 11, 30, "Input",ExpressionUUID->"fdef6874-99c9-4558-8fca-639ab5cd2100"], 1097 | Cell[57047, 1178, 658, 11, 30, "Input",ExpressionUUID->"dd120ca1-848e-423b-8132-8a4ad1af66b7"] 1098 | }, Open ]], 1099 | Cell[CellGroupData[{ 1100 | Cell[57742, 1194, 176, 3, 54, "Subsection",ExpressionUUID->"f8397244-1ddc-4683-9ba2-1631f6f2ff53"], 1101 | Cell[57921, 1199, 659, 16, 30, "Input",ExpressionUUID->"4a484416-8716-4c9a-a177-e23d82b841bf"], 1102 | Cell[58583, 1217, 407, 7, 30, "Input",ExpressionUUID->"4124d2cf-9243-403b-88b8-8fc04ac56def"], 1103 | Cell[58993, 1226, 237, 5, 30, "Input",ExpressionUUID->"05090169-8f98-4d80-a8c4-a624f7083a03"], 1104 | Cell[59233, 1233, 728, 20, 30, "Input",ExpressionUUID->"47d0e7b8-7fc1-41ab-a340-d7245957e301"] 1105 | }, Open ]], 1106 | Cell[CellGroupData[{ 1107 | Cell[59998, 1258, 260, 4, 54, "Subsection",ExpressionUUID->"8b3d5e80-8e20-438b-87ee-ceea90da1c2e"], 1108 | Cell[60261, 1264, 306, 5, 30, "Input",ExpressionUUID->"37d2d871-953e-4c23-bc44-f83a3b622304"], 1109 | Cell[60570, 1271, 305, 5, 30, "Input",ExpressionUUID->"8f765bef-c3b4-4a72-889e-faed0af5e750"], 1110 | Cell[60878, 1278, 360, 7, 30, "Input",ExpressionUUID->"d58c4ae4-2ee3-4f60-8649-e005867fbd14"], 1111 | Cell[61241, 1287, 329, 6, 30, "Input",ExpressionUUID->"beed9989-7b46-45f6-b92e-d9534e983cae"] 1112 | }, Open ]], 1113 | Cell[CellGroupData[{ 1114 | Cell[61607, 1298, 505, 8, 54, "Subsection",ExpressionUUID->"292185a9-2fb5-4cee-ba04-979e10b4d536"], 1115 | Cell[62115, 1308, 603, 10, 30, "Input",ExpressionUUID->"9325edd7-eacf-45d9-a0aa-6cb7fc2b9707"], 1116 | Cell[62721, 1320, 626, 11, 30, "Input",ExpressionUUID->"8c4b586c-c3d0-42ee-a1e6-2e373492ac18"], 1117 | Cell[63350, 1333, 633, 11, 30, "Input",ExpressionUUID->"55454dae-6e1e-4815-94e6-523a2247c161"], 1118 | Cell[63986, 1346, 788, 17, 30, "Input",ExpressionUUID->"80f5a18a-2e1c-43d0-9b42-8e79c2facab6"] 1119 | }, Open ]], 1120 | Cell[CellGroupData[{ 1121 | Cell[64811, 1368, 431, 6, 54, "Subsection",ExpressionUUID->"9004b91b-2ef8-48dc-bf1f-39d9648a9831"], 1122 | Cell[65245, 1376, 850, 18, 52, "Input",ExpressionUUID->"0c207f89-6be0-4cb7-b228-331ba7e2e930"] 1123 | }, Open ]], 1124 | Cell[CellGroupData[{ 1125 | Cell[66132, 1399, 358, 5, 54, "Subsection",ExpressionUUID->"07df250e-87b1-4228-9a21-d011319228fc"], 1126 | Cell[66493, 1406, 607, 15, 30, "Input",ExpressionUUID->"9662f5ee-5f1f-4b30-aa68-fe818f5045fd"] 1127 | }, Open ]], 1128 | Cell[CellGroupData[{ 1129 | Cell[67137, 1426, 294, 4, 54, "Subsection",ExpressionUUID->"4e89ff29-6ed5-4222-b155-669840286e53"], 1130 | Cell[67434, 1432, 336, 7, 30, "Input",ExpressionUUID->"66c391ad-09e8-4146-b5f4-2fbcc12aa3d5"], 1131 | Cell[67773, 1441, 323, 6, 30, "Input",ExpressionUUID->"01377ee4-a30f-447b-8174-2568e047951d"] 1132 | }, Open ]] 1133 | }, Open ]] 1134 | } 1135 | ] 1136 | *) 1137 | --------------------------------------------------------------------------------