├── LICENSE ├── README.md ├── SimpleTensor.m ├── SimpleTensor.nb ├── SimpleTensor_example.nb └── SimpleTensor_test.nb /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Denys Rybalka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleTensor 2 | User-friendly Mathematica package for elementary tensor and differential geometric calculations. 3 | 4 | ### Supporting publication 5 | The detailed description and example session file with comments can be found in the [supporting publication](https://arxiv.org/pdf/2111.06718) on arxiv. 6 | 7 | ### Motivation 8 | Wolfram Mathematica is a popular symbolic computation program useful among other applications in physics computations. 9 | Standard Mathematica functions fulfill almost all mathematical needs of typical undergraduate level courses. 10 | The most obvious exception to that is tensor calculus and differential geometry. 11 | 12 | There already exist a few packages intended to provide this functionality, for example, xAct, TensoriaCalc, grt, Ricci just to name a few. 13 | However, in my opinion, they all suffer from one or more of the following flows: 14 | - The package is old, outdated, or not supported anymore; 15 | - The package is hard to master (or even to grasp), as it contains dozens or even hundreds public functions; 16 | - The package is focused primarily at the General Relativity computations; 17 | - The package is hard to modify for your personal needs. 18 | 19 | As the name suggests, SimpleTensor is intended to remedy these flows by being up-to-date, concise (only 11 public functions), all-purpose, and well-documented (hackable). 20 | It also provides basis for elementary in-basis differential geometric computations. 21 | On the other hand, some sacrifices had to be made in order to achieve these goals and so SimpleTensor loses on speed and number of readily available functions for GR to its competitors. 22 | 23 | ### Installation 24 | To install the package copy the [SimpleTensor.m](SimpleTensor.m) file to the Applications folder in your `$UserBaseDirectory`. 25 | The package can then be loaded as any other Mathematica package with ``Needs["SimpleTensor`"]``. 26 | Alternatively, if you would like to modify anything, you can simply edit and execute the content of [SimpleTensor.nb](SimpleTensor.nb) file. 27 | 28 | ### Usage 29 | To help with the familiarization in this repository also added a [test file](SimpleTensor_test.nb) and a documented [example session file](SimpleTensor_example.nb). 30 | The latter shows the most useful applications of SimpleTensor on the examples of electromagnetism, quantum mechanics of Dirac particles and chiral kinetic theory. 31 | The former helps to understand the edge cases and can also be used to check user-made modifications. 32 | 33 | As a convention we consider indices `i` and `-i` to be contravariant (top) and covariant (bottom) forms of the same index respectively. 34 | Here is the short info on each public function in SimpleTensor: 35 | 36 | - `DefineSpace[name, dim]` defines a space of dimension `dim` with a string `name` on which tensor calculations will be performed. The optional variables are: 37 | - `index` - a list of indices on this space or a string prefix to generate names automatically, if missing name is used as a prefix; 38 | - `coord` - a list of coordinates on this space or a string prefix to generate names automatically, if missing name is used as a prefix. 39 | 40 | - `SetTensor[t[µ], arr]` associates array `arr` to a tensor `t[µ]`. For convenience this function overrides the built-in Congruent function. To change the default behavior edit corresponding lines in the package file. 41 | 42 | - `GetArray[expr]` substitutes arrays into tensor variables and performs contractions and math operations. The optional variables are: 43 | - `indices` - a list of indices in which order the tensor should be transposed. If omitted indices are taken to be in standard order, i.e., the one returned by the standard `Sort[]` function. 44 | 45 | - `metric[-i1, -i2]` is the metric tensor for the space in which `i1` and `i2` are defined. 46 | `metric[i1, i2]` is the inverse metric tensor. If `i1` and `i2` belong to different spaces then it works as a tetrad (vielbein) tensor and represents the change of basis. 47 | 48 | - `basis[i]` is the tensor of basis forms for the space in which index `i` is defined. 49 | `basis[-i]` is the tensor of basis vectors. 50 | 51 | - `ð[±i]` is the tensor derivative for the space in which index `i` is defined. 52 | `ðspace[±i]` is also defined for a derivative in the space space, which can be used with any `i`. 53 | 54 | - `TensorPlus[args]` is used to add matrix-valued tensors (for example, the set of Dirac matrices `γ[µ]`) with explicit lists (for example, `IdentityMatrix[4]`). It is equivalent to `Plus[]` in most cases, except it prevents the automatic threading over lists. For convenience this function overrides the built-in `CirclePlus` function. 55 | 56 | 57 | - `DirectProduct[args]` represents the tensor product of basis vectors and forms. It expands `args` automatically until a sum of basis tensor products is achieved. For convenience this function overrides the built-in `CircleTimes` function. 58 | 59 | - `WedgeProduct[args]` represents the wedge product of basis forms. It expands `args` automatically until a sum of basis wedge products is achieved. For convenience this function overrides the built-in `Wedge` function. 60 | 61 | - `ExteriorDerivative[space][expr]` gives the exterior derivative of `expr` in `space`. If latter is a Sequence of spaces, the exterior derivative is taken in their product space. If `space` is empty, the exterior derivative is taken in the product space of all defined spaces. 62 | 63 | - `InteriorProduct[expr1, expr2]` is the symmetric interior product of basis vectors and forms in `expr1` and `expr2`. The DirectProducts of basises are multiplied successively starting from the first position. 64 | -------------------------------------------------------------------------------- /SimpleTensor.m: -------------------------------------------------------------------------------- 1 | (* ::Package:: *) 2 | 3 | (************************************************************************) 4 | (* This file was generated automatically by the Mathematica front end. *) 5 | (* It contains Initialization cells from a Notebook file, which *) 6 | (* typically will have the same name as this file except ending in *) 7 | (* ".nb" instead of ".m". *) 8 | (* *) 9 | (* This file is intended to be loaded into the Mathematica kernel using *) 10 | (* the package loading commands Get or Needs. Doing so is equivalent *) 11 | (* to using the Evaluate Initialization Cells menu command in the front *) 12 | (* end. *) 13 | (* *) 14 | (* DO NOT EDIT THIS FILE. This entire file is regenerated *) 15 | (* automatically each time the parent Notebook file is saved in the *) 16 | (* Mathematica front end. Any changes you make to this file will be *) 17 | (* overwritten. *) 18 | (************************************************************************) 19 | 20 | 21 | 22 | (* ::Input::Initialization:: *) 23 | BeginPackage["SimpleTensor`"] 24 | DefineSpace::usage= 25 | "DefineSpace[\!\(\* 26 | StyleBox[\"name\",\nFontSlant->\"Italic\"]\), \!\(\* 27 | StyleBox[\"dim\",\nFontSlant->\"Italic\"]\)] defines a space of dimension \!\(\* 28 | StyleBox[\"dim\",\nFontSlant->\"Italic\"]\)\!\(\* 29 | StyleBox[\" \",\nFontSlant->\"Italic\"]\)with a string \!\(\* 30 | StyleBox[\"name\",\nFontSlant->\"Italic\"]\) on which tensors live. The optional variables are: 31 | \!\(\* 32 | StyleBox[\"index\",\nFontSlant->\"Italic\"]\) - a list of indices on this space or a string prefix to generate names automatically; if missing, \!\(\* 33 | StyleBox[\"name\",\nFontSlant->\"Italic\"]\)\!\(\* 34 | StyleBox[\" \",\nFontSlant->\"Italic\"]\)is used as a prefix. 35 | \!\(\* 36 | StyleBox[\"coord\",\nFontSlant->\"Italic\"]\) - a list of coordinates on this space or a string prefix to generate names automatically; if missing, \!\(\* 37 | StyleBox[\"name\",\nFontSlant->\"Italic\"]\)\!\(\* 38 | StyleBox[\" \",\nFontSlant->\"Italic\"]\)is used as a prefix." 39 | 40 | SetTensor::usage= 41 | "SetTensor[\!\(\* 42 | StyleBox[\"t\",\nFontSlant->\"Italic\"]\)\!\(\* 43 | StyleBox[\"[\",\nFontSlant->\"Italic\"]\)\!\(\* 44 | StyleBox[\"\[Mu]\",\nFontSlant->\"Italic\"]\)\!\(\* 45 | StyleBox[\"]\",\nFontSlant->\"Italic\"]\), \!\(\* 46 | StyleBox[\"arr\",\nFontSlant->\"Italic\"]\)] associates array \!\(\* 47 | StyleBox[\"arr\",\nFontSlant->\"Italic\"]\) to a tensor \!\(\* 48 | StyleBox[\"t\",\nFontSlant->\"Italic\"]\)\!\(\* 49 | StyleBox[\"[\",\nFontSlant->\"Italic\"]\)\!\(\* 50 | StyleBox[\"\[Mu]\",\nFontSlant->\"Italic\"]\)\!\(\* 51 | StyleBox[\"]\",\nFontSlant->\"Italic\"]\). For convenience this function overrides the built-in Congruent function. To change the default behavior edit corresponding lines in the package file." 52 | 53 | GetArray::usage= 54 | "GetArray[\!\(\* 55 | StyleBox[\"expr\",\nFontSlant->\"Italic\"]\)] substitutes tensor variables with arrays and performs contractions and math operations. The optional variables are: 56 | \!\(\* 57 | StyleBox[\"indices\",\nFontSlant->\"Italic\"]\) - a list of indices in which order the tensor should be transposed. If omitted \!\(\* 58 | StyleBox[\"indices\",\nFontSlant->\"Italic\"]\) are taken to be the free indices in \!\(\* 59 | StyleBox[\"expr\",\nFontSlant->\"Italic\"]\) in standard order, i.e., the one returned by the standard Sort[] function." 60 | 61 | metric::usage= 62 | "metric[-\!\(\* 63 | StyleBox[\"i1\",\nFontSlant->\"Italic\"]\), -\!\(\* 64 | StyleBox[\"i2\",\nFontSlant->\"Italic\"]\)] is the metric tensor for the space in which \!\(\* 65 | StyleBox[\"i1\",\nFontSlant->\"Italic\"]\) and \!\(\* 66 | StyleBox[\"i2\",\nFontSlant->\"Italic\"]\) are defined. 67 | metric[\!\(\* 68 | StyleBox[\"i1\",\nFontSlant->\"Italic\"]\), \!\(\* 69 | StyleBox[\"i2\",\nFontSlant->\"Italic\"]\)] is the inverse metric tensor. If \!\(\* 70 | StyleBox[\"i1\",\nFontSlant->\"Italic\"]\) and \!\(\* 71 | StyleBox[\"i2\",\nFontSlant->\"Italic\"]\) belong to different spaces then it works as a tetrad (vielbein) tensor and represents the change of basis." 72 | 73 | basis::usage= 74 | "basis[\!\(\* 75 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\)] is the tensor of basis forms for the space in which index \!\(\* 76 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\) is defined. 77 | basis[-\!\(\* 78 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\)] is the tensor of basis vectors." 79 | 80 | \[Eth]::usage= 81 | "\[Eth][\!\(\* 82 | StyleBox[\"\[PlusMinus]\", \"OperatorCharacter\"]\)\!\(\* 83 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\)] is the tensor derivative for the space in which index \!\(\* 84 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\) is defined. 85 | \[Eth]\!\(\* 86 | StyleBox[\"space\",\nFontSlant->\"Italic\"]\)[\!\(\* 87 | StyleBox[\"\[PlusMinus]\", \"OperatorCharacter\"]\)\!\(\* 88 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\)\!\(\* 89 | StyleBox[\"]\",\nFontSlant->\"Italic\"]\)\!\(\* 90 | StyleBox[\" \",\nFontSlant->\"Italic\"]\)is also defined for a derivative in the space \!\(\* 91 | StyleBox[\"space\",\nFontSlant->\"Italic\"]\), which can be used with any \!\(\* 92 | StyleBox[\"i\",\nFontSlant->\"Italic\"]\)." 93 | 94 | TensorPlus::usage= 95 | "TensorPlus[\!\(\* 96 | StyleBox[\"args\",\nFontSlant->\"Italic\"]\)] is used to add matrix-valued tensors (for example, the set of Dirac matrices \[Gamma][\[Mu]]) with explicit lists (for example, IdentityMatrix[4]). It is equivalent to Plus[] in most cases, except it prevents the automatic threading over lists. For convenience this function overrides the built-in CirclePlus function." 97 | 98 | 99 | DirectProduct::usage= 100 | "DirectProduct[\!\(\* 101 | StyleBox[\"args\",\nFontSlant->\"Italic\"]\)] represents the tensor product of basis vectors and forms. It expands \!\(\* 102 | StyleBox[\"args\",\nFontSlant->\"Italic\"]\) automatically until a sum of basis tensor products is achieved. For convenience this function overrides the built-in CircleTimes function." 103 | 104 | WedgeProduct::usage= 105 | "WedgeProduct[\!\(\* 106 | StyleBox[\"args\",\nFontSlant->\"Italic\"]\)] represents the wedge product of basis forms. It expands \!\(\* 107 | StyleBox[\"args\",\nFontSlant->\"Italic\"]\) automatically until a sum of basis wedge products is achieved. For convenience this function overrides the built-in Wedge function." 108 | 109 | ExteriorDerivative::usage= 110 | "ExteriorDerivative[\!\(\* 111 | StyleBox[\"space\",\nFontSlant->\"Italic\"]\)][\!\(\* 112 | StyleBox[\"expr\",\nFontSlant->\"Italic\"]\)] gives the exterior derivative of \!\(\* 113 | StyleBox[\"expr\",\nFontSlant->\"Italic\"]\) in \!\(\* 114 | StyleBox[\"space\",\nFontSlant->\"Italic\"]\). If latter is a Sequence of spaces, the exterior derivative is taken in their product space. If \!\(\* 115 | StyleBox[\"space\",\nFontSlant->\"Italic\"]\) is empty, the exterior derivative is taken in the product space of all defined spaces." 116 | 117 | InteriorProduct::usage= 118 | "InteriorProduct[\!\(\* 119 | StyleBox[\"expr1\",\nFontSlant->\"Italic\"]\), \!\(\* 120 | StyleBox[\"expr2\",\nFontSlant->\"Italic\"]\)] is the symmetric interior product of basis vectors and forms in \!\(\* 121 | StyleBox[\"expr1\",\nFontSlant->\"Italic\"]\) and \!\(\* 122 | StyleBox[\"expr2\",\nFontSlant->\"Italic\"]\). The DirectProducts of basises are multiplied successively starting from the first position." 123 | 124 | 125 | 126 | 127 | 128 | Begin["`Private`"] 129 | 130 | (*Set to True to print debug information.*) 131 | $Verbose=False; 132 | (*Dictionary for the dimension of spaces.*) 133 | SpaceDim=<||>; 134 | (*Dictionary to save tensor values.*) 135 | TensorValues=<||>; 136 | (*Dictionary to save which index lives in which space*) 137 | IndexSpace=<||>; 138 | (*Dataset to save coordinate space information.*) 139 | CoordSpace=Dataset[{}]; 140 | 141 | 142 | (*Overriding for convenience the operators without built-in meaning. Comment these if you need the overriden operators for other purpuses.*) 143 | Format[HoldPattern@SetTensor[args__]]:=Defer@Congruent[args]; 144 | Congruent=SetTensor; 145 | Format[HoldPattern@TensorPlus[args__]]:=Defer@CirclePlus[args]; 146 | CirclePlus=TensorPlus; 147 | Format[HoldPattern@DirectProduct[args__]]:=Defer@CircleTimes[args]; 148 | CircleTimes=DirectProduct; 149 | Format[HoldPattern@WedgeProduct[args__]]:=Defer@Wedge[args]; 150 | Wedge=WedgeProduct; 151 | 152 | 153 | (*Helper functions for pattern recognition.*) 154 | IndexQ[ind_]:=MemberQ[Keys@IndexSpace,ind]; 155 | SpaceQ[space_]:=MemberQ[IndexSpace,IndexAbs@space]; 156 | BasisFormQ[arg_]:=MemberQ[CoordSpace[All,"BasisForm"],arg]; 157 | BasisVectorQ[arg_]:=MemberQ[CoordSpace[All,"BasisVector"],arg]; 158 | BasisQ[arg_]:=BasisFormQ[arg]||BasisVectorQ[arg]||MatchQ[arg,basis[_?IndexQ]]; 159 | TensorSymbolQ[arg_]:=MatchQ[arg,head_[inds__?IndexQ]/;MemberQ[Keys@TensorValues,head@@Table[_,Length@{inds}]]]; 160 | 161 | (*Helper functions for index and tensor operations.*) 162 | IndexSign[ind_]:=If[MatchQ[ind,Times[-1,_]],-1,1]; 163 | IndexAbs[ind_]:=IndexSign[ind]ind; 164 | IndexSignSpace[ind_]:=IndexSign[ind]IndexSpace[ind]; 165 | IndexDim[ind_]:=SpaceDim[IndexSpace[ind]]; 166 | SetAttributes[{IndexSign,IndexAbs,IndexSignSpace,IndexLocalize,PrivatizeIndex},Listable]; 167 | PrivatizeIndex[ind_]:=IndexSign[ind]Symbol["SimpleTensor`Private`Index`"<>SymbolName@IndexAbs@ind]; 168 | TensorIndices[Tensor[ind_,arr_]]:=ind; 169 | TensorArray[Tensor[ind_,arr_]]:=arr; 170 | 171 | 172 | Options[DefineSpace]={coord->Null,index->Null}; 173 | DefineSpace[space_String,dim_Integer?NonNegative,OptionsPattern[]]:=Module[{ind,crd}, 174 | (*Generate or use given space indices.*) 175 | ind=OptionValue[index]; 176 | If[ind==Null,ind="i"<>space]; 177 | If[MatchQ[ind,_String],ind=Table[Symbol[ind<>ToString[i]],{i,0,2dim-1}]]; 178 | If[!MatchQ[ind,{___Symbol}],Print["`index` must be a list of symbols or a string."];Abort[]]; 179 | 180 | (*Generate or use given space coordinates.*) 181 | crd=OptionValue[coord]; 182 | If[crd==Null,crd="x"<>space]; 183 | If[MatchQ[crd,_String],crd=Table[Symbol[crd<>ToString[i]],{i,0,dim-1}]]; 184 | If[!MatchQ[crd,{___Symbol}],Print["`coord` must be a list of symbols or a string."];Abort[]]; 185 | If[Length[crd]!=dim,Print["Invalid number of indices: ",Length@crd," given vs ",dim, " needed."];Abort[]]; 186 | 187 | If[$Verbose,Print["Defining space: ",space," with dimension: ", dim, ", coordinates: ",crd, ", and indices: ", ind]]; 188 | 189 | (*In case space is being overwritten delete old entries.*) 190 | KeyDropFrom[IndexSpace,PositionIndex[IndexSpace][space]]; 191 | CoordSpace=CoordSpace[Select[#Space!=space&]]; 192 | KeyDropFrom[TensorValues,Cases[Keys[TensorValues],_[___,space|-space,___]]]; 193 | 194 | AppendTo[SpaceDim,space->dim]; 195 | (*Zero dimensions effectively delete the space.*) 196 | If[dim==0,Return[]]; 197 | (*Adding both covariant and contravariant indices.*) 198 | AppendTo[IndexSpace,#->space]&/@ind; 199 | AppendTo[IndexSpace,-#->space]&/@ind; 200 | 201 | (*By convention for every coordinate x the corresponding basis form is dx and basis vector is \[Eth]x.*) 202 | AppendTo[CoordSpace,<|"Space"->space,"Coordinate"->#,"BasisForm"->ToExpression["d"<>ToString@#],"BasisVector"->ToExpression["\[Eth]"<>ToString@#]|>]&/@crd; 203 | 204 | (*Metric with one top and one bottom indices is always identity.*) 205 | AppendTo[TensorValues,metric[space,-space]->IdentityMatrix[dim]]; 206 | AppendTo[TensorValues,metric[-space,space]->IdentityMatrix[dim]]; 207 | 208 | AppendTo[TensorValues,basis[space]->Normal@CoordSpace[Select[#Space==space&],"BasisForm"]]; 209 | AppendTo[TensorValues,basis[-space]->Normal@CoordSpace[Select[#Space==space&],"BasisVector"]]; 210 | AppendTo[TensorValues,ToExpression["\[Eth]"<>space][-space]->(\!\( 211 | \*SubscriptBox[\(\[PartialD]\), \(arg\)]#\)&/.({arg->#}&/@crd))]; 212 | ]; 213 | 214 | 215 | SetTensor[head_Symbol[ind__?IndexQ],array_List]:= 216 | Module[{}, 217 | If[$Verbose,Print["Setting tensor: ",head[ind]," to have the following array: ", array]]; 218 | If[head===basis,Print["Cannot set the built-in tensor: ", head[ind]];Abort[]]; 219 | If[StringStartsQ[SymbolName[head],"\[Eth]"],Print["Cannot set tensor starting with \[Eth]: ", head[ind]];Abort[]]; 220 | If[IndexDim/@{ind}!=Take[Dimensions[array],Length[{ind}]], 221 | Print["Invalid dimension of array ",head[ind],": ",Dimensions[array]," given vs ", IndexDim[#]&/@{ind}, " required."];Abort[] 222 | ]; 223 | 224 | AppendTo[TensorValues,IndexSignSpace/@head[ind]-> array]; 225 | 226 | (*For convenience for metric tensor initialize also other signatures, if they are not already present.*) 227 | If[head===metric, 228 | With[{t=Minus/@IndexSignSpace/@head[ind]}, 229 | If[!MemberQ[Keys@TensorValues,t],AppendTo[TensorValues,t->Transpose@Inverse@array]]]; 230 | With[{t=IndexSignSpace/@Reverse@head[ind]}, 231 | If[!MemberQ[Keys@TensorValues,t],AppendTo[TensorValues,t->Transpose@array]]]; 232 | With[{t=Minus/@IndexSignSpace/@Reverse@head[ind]}, 233 | If[!MemberQ[Keys@TensorValues,t],AppendTo[TensorValues,t->Inverse@array]]]; 234 | ]; 235 | ]; 236 | 237 | 238 | GetArray[expr_,Optional[indices_List,Null]]:=Module[{res,ind}, 239 | If[$Verbose,Print["Getting array of the expression: ",expr," with indices order: ",If[indices=!=Null,indices,"standard"]]]; 240 | res=ToTensor[expr]; 241 | If[!MatchQ[res,_Tensor], 242 | If[indices===Null||indices==={},Return@res,Print["Cannot return tensor with indices: ",indices," from the scalar: ",res];Abort[]] 243 | ]; 244 | ind=If[indices=!=Null,indices,Sort@TensorIndices@res]; 245 | res=TensorPermute[res,ind]; 246 | TensorArray@res 247 | ]; 248 | 249 | 250 | (*Calculates the array of the tensor head with the signature sp via the shortest path to an already defined tensor.*) 251 | GetTensorArray[head_Symbol[sp__?SpaceQ]]:=Module[{need,have,res,path,mods}, 252 | If[$Verbose,Print["Calculating the tensor array of: ",head[sp]]]; 253 | res=TensorValues[head[sp]]; 254 | (*If signature already present return it.*) 255 | If[!MissingQ[res],Return@res]; 256 | 257 | have=Cases[Keys@TensorValues,head[i__]/;Length@{i}===Length@{sp}]; 258 | If[have=={},Print["Tensor not found: ",head[sp]];Abort[]]; 259 | need=head[sp]; 260 | path=ShortestSpacePath[need,have]; 261 | (*Contract metrics to get one transformation matrix for each index in 'sp'.*) 262 | mods=Apply[Dot][TensorValues[metric[First@#,-Last@#]]&/@Partition[#,2,1]]&/@path; 263 | res=TensorValues[head@@(Last/@path)]; 264 | (*Map each transformation on the correct level in array.*) 265 | MapIndexed[ 266 | If[MatchQ[#1,_List], 267 | res=TensorContract[#1\[TensorProduct]res,{{2,2+First[#2]}}]; 268 | res=Transpose[res,RotateRight@Range[First@#2]]; 269 | ]& 270 | ,mods]; 271 | res 272 | ]; 273 | 274 | (*A helping function to find the shortest path through metrics and basis changes from tensor need to a list of tensors have by building the graph of all space transformations.*) 275 | ShortestSpacePath[need_,have_List]:=Module[{vertices,edges,graph,paths}, 276 | vertices=Flatten[{#,-#}&/@Keys@SpaceDim]; 277 | edges=Cases[Keys@TensorValues,metric[__]]/.metric[a_,b_]:>(-a\[DirectedEdge]b); 278 | graph=Graph[vertices,edges,VertexLabels->"Name"]; 279 | If[$Verbose,Print["Using the following space transformation graph: "];Print[graph]]; 280 | 281 | paths=Transpose[{List@@need,List@@#}]&/@have; 282 | paths=Map[Apply@FindShortestPath[graph],paths,{2}]; 283 | paths=DeleteCases[paths,{}&/@List@@need]; 284 | If[paths==={}, 285 | Print["Unable to get the tensor array for: ",need];Abort[]]; 286 | First@MinimalBy[paths,Length@Flatten] 287 | ]; 288 | 289 | (*Permutes the array in the tens object into the order specified by ind.*) 290 | TensorPermute[tens_Tensor,{ind___?IndexQ}]:=Module[{tensInd,tensArr,perm}, 291 | If[$Verbose,Print["Permuting: ",tens," into order: ",{ind}]]; 292 | tensInd=TensorIndices[tens]; 293 | tensArr=TensorArray[tens]; 294 | If[Sort[{ind}]=!=Sort[tensInd], 295 | Print["Indices asked: ",{ind}," differ from indices present: ",tensInd];Abort[]]; 296 | perm=Table[First@FirstPosition[{ind},tensInd[[i]]],{i,1,Length@{ind}}]; 297 | If[Length[perm]!=0, 298 | Tensor[{ind},Transpose[tensArr,perm]], 299 | Tensor[{ind},tensArr]] 300 | ]; 301 | 302 | (*Pairs the indices in ind and returns the list of free indices and the list of dummy indices.*) 303 | PairIndices[{ind___?IndexQ}]:=Module[{freeRes,dummyRes,invalidIndices}, 304 | freeRes=ReverseSort/@GatherBy[{ind},Abs]; 305 | dummyRes={}; 306 | invalidIndices=Cases[freeRes,e_/;(Length[e]>2||Length[e]==2&&e[[1]]/e[[2]]!=-1)]; 307 | If[invalidIndices!={},Print["Invalid indices: ",invalidIndices];Abort[]]; 308 | freeRes=If[Length[#]==1,First@#,AppendTo[dummyRes,First@#];Nothing]&/@freeRes; 309 | invalidIndices=DeleteCases[GatherBy[freeRes~Join~dummyRes,Abs],e_/;Length[e]==1]; 310 | If[invalidIndices!={},Print["Invalid indices: ",invalidIndices];Abort[]]; 311 | {freeRes,dummyRes} 312 | ]; 313 | 314 | 315 | (*Transforms expr into a Tensor[inds, array] object or a scalar.*) 316 | ToTensor[expr_]:=Module[{res}, 317 | If[$Verbose,Print["Transforming ToTensor: ",expr]]; 318 | (*For all tensors of the form t[inds] in the expr substitutes them with the Tensor[inds, array] object, where the array is found from TensorValues. Mathematica then automatically applies algebraic rules to the expression until it is totally converted into a single Tensor object or a scalar.*) 319 | res=expr/.head_Symbol[ind__?IndexQ]/;MemberQ[Keys@TensorValues,el_head/;Length[el]===Length[{ind}]]:>Tensor[{ind},GetTensorArray[head@@IndexSignSpace[{ind}]]]; 320 | If[MatchQ[res,_Tensor]||FreeQ[res,_Tensor],res,Print["Failed to bring ToTensor: ",res];Abort[]] 321 | ]; 322 | 323 | (*Tensor object with no indices is just a scalar.*) 324 | Tensor[{},array_]:=array; 325 | 326 | (*Defines additive rules for any expressions with a Tensor object.*) 327 | Map[Function[{operation},Tensor/:operation[a___,t__Tensor,z___]:=Module[{tmp,ind}, 328 | tmp=Inactive[operation][a,t,z]; 329 | If[!AllTrue[tmp,MatchQ[_Tensor]], 330 | Print["Non-tensor expression dected in a sum: ",tmp];Abort[]]; 331 | If[$Verbose,Print["Summing tensors: ",tmp]]; 332 | ind=TensorIndices@t; 333 | (*Permute all addends to the same index order and extract arrays.*) 334 | tmp=(TensorArray@TensorPermute[#,ind])&/@tmp; 335 | (*Add the corresponding arrays.*) 336 | tmp=Activate@tmp; 337 | Tensor[ind,tmp] 338 | ]],{Plus,Complex,TensorPlus}]; 339 | 340 | (*Defines multiplicative rules for any expressions with a Tensor object.*) 341 | Map[Function[{operation},Tensor/:operation[a___,t__Tensor,z___]:=Module[{tmp,free,dummy}, 342 | tmp=Inactive[operation][a,t,z]; 343 | If[$Verbose,Print["Multiplying tensors: ",tmp]]; 344 | {free,dummy}=PairIndices[Join@@Cases[tmp,el_Tensor:>TensorIndices@el]]; 345 | (*Transform each Tensor[ind, arr] into `arr[[ind]]`*) 346 | tmp=tmp/.Tensor[ind_,arr_]:>Inactive[Part][arr,Sequence@@PrivatizeIndex@IndexAbs[ind]]; 347 | (*Sum over the dummy variables.*) 348 | tmp=If[Length[dummy]==0,tmp, 349 | With[{ind=Sequence@@({PrivatizeIndex[#],IndexDim[#]}&/@IndexAbs[dummy])},Sum[tmp,ind]]]; 350 | (*Arrange what is left into one array.*) 351 | tmp=If[Length[free]==0,tmp,With[{ind=Sequence@@({PrivatizeIndex[#],IndexDim[#]}&/@IndexAbs[free])},Table[tmp,ind]]]; 352 | (*Perform remaining multiplicative operations.*) 353 | tmp=Activate@tmp; 354 | Tensor[free,tmp] 355 | ]],{Times,Dot,DirectProduct,WedgeProduct,InteriorProduct}]; 356 | 357 | (*Defines some elementwise operations on a tensor.*) 358 | Map[Function[{operation},Tensor/:operation[args1___?(FreeQ[_Tensor]),t_Tensor,args2___?(FreeQ[_Tensor])]:=Module[{ind,arr}, 359 | If[$Verbose,Print["Performing elementwise operation: ",Inactive[operation][args1,t,args2]]]; 360 | ind=TensorIndices@t; 361 | arr=Map[operation[args1,#,args2]&,TensorArray@t,{Length@ind}]; 362 | Tensor[ind,arr] 363 | ]],{Tr,D,ExteriorDerivative}]; 364 | 365 | (*Defines anti-threading rules for a Tensor object, i.e., transforms a list of tensors into a tensor of lists. Note that Inactive[List][a,z] protects from applying this same function recursively in pattern checking.*) 366 | Tensor/:List[a___,t_Tensor,z___]/;AllTrue[Inactive[List][a,z],MatchQ[Tensor[TensorIndices@t,_List]|0]]:=Module[{tmp,dims}, 367 | tmp=Inactive[List][a,t,z]; 368 | If[$Verbose,Print["Anti-threading: ",tmp]]; 369 | dims=Dimensions[TensorArray@t]; 370 | tmp=If[#=!=0,TensorArray@#,Array[0&,dims]]&/@tmp; 371 | tmp=List@@tmp; 372 | tmp=With[{n=Length@TensorIndices@t},Transpose[tmp,Cycles@{Reverse@Range[n+1]}]]; 373 | Tensor[TensorIndices@t,tmp] 374 | ]; 375 | 376 | (*Defines rules for tensor operators acting on expr.*) 377 | Tensor[ind_List,arr_List][expr_]:=Module[{}, 378 | If[$Verbose,Print["Pulling Through the tensor: ",Inactive[Tensor][ind,arr][expr]]]; 379 | Tensor[ind,arr/.f_Function:>f[expr]] 380 | ]; 381 | 382 | (*Flattens tensor of tensors.*) 383 | Tensor[ind1_List,Tensor[ind2_List,arr_List]]:=Module[{}, 384 | If[$Verbose,Print["Joining the tensors: ",Inactive[Tensor][ind1,Tensor[ind2,arr]]]]; 385 | Tensor[ind2~Join~ind1,arr] 386 | ]; 387 | 388 | (*Contracts indices in a tensor.*) 389 | Tensor[ind_List,arr_List]/;!DuplicateFreeQ[ind,Abs[#1]===Abs[#2]&]:=Module[{free,dummy}, 390 | If[$Verbose,Print["Contracting indices in the tensor: ",Inactive[Tensor][ind,arr]]]; 391 | {free,dummy}=PairIndices[ind]; 392 | dummy=(Join@@Position[ind,#|-#,{1}])&/@dummy; 393 | Tensor[free,TensorContract[arr,dummy]] 394 | ]; 395 | 396 | 397 | (*TensorPlus of scalars is just a sum of scalars.*) 398 | TensorPlus[args__?(FreeQ[_Tensor|_Symbol[__?IndexQ]])]:=Plus[args]; 399 | 400 | (*Defining a shortcut to simply use \[Eth][\[PlusMinus]ind] instead of \[Eth]space[\[PlusMinus]ind] for obvious choice of space.*) 401 | \[Eth][ind_?IndexQ]:=ToExpression["\[Eth]"<>IndexSpace[ind]][ind]; 402 | 403 | 404 | 405 | (*DirectProduct is a non-commutative, listable, flat, linear operation.*) 406 | DirectProduct[arg_]:=arg; 407 | DirectProduct[a___,x_+y_,z___]:=DirectProduct[a,x,z]+DirectProduct[a,y,z]; 408 | DirectProduct[a___,s_*x_,z___]/;FreeQ[s,_?BasisQ]:=s*DirectProduct[a,x,z]; 409 | SetAttributes[DirectProduct,{Listable,OneIdentity,Flat}]; 410 | 411 | (*WedgeProduct is a listable, flat, linear, anti-symmetric, operation.*) 412 | (*Default[WedgeProduct]:=1;*) 413 | WedgeProduct[arg_]:=arg; 414 | WedgeProduct[a___,x_+y_,z___]:=WedgeProduct[a,x,z]+WedgeProduct[a,y,z]; 415 | WedgeProduct[a___,s_*x_,z___]/;FreeQ[s,_?BasisQ]:=s WedgeProduct[a,x,z]; 416 | WedgeProduct[a___?BasisFormQ,f_?BasisFormQ,m___?BasisFormQ,f_,z___?BasisFormQ]:=0; 417 | WedgeProduct[args__?BasisFormQ]/;!OrderedQ[{args}]:=Signature[{args}]WedgeProduct@@Sort[{args}]; 418 | SetAttributes[WedgeProduct,{Listable,OneIdentity,Flat}]; 419 | 420 | 421 | (*If no space is specified the derivative is taken in a product space of all defined spaces.*) 422 | ExteriorDerivative[][expr_]:= 423 | ExteriorDerivative[Sequence@@DeleteDuplicates@Normal@CoordSpace[All,"Space"]][expr]; 424 | 425 | (*If taken in a product space take the derivative in all spaces independently and then add.*) 426 | ExteriorDerivative[spaces__?SpaceQ][expr_]/;Length[{spaces}]>1:= 427 | ExteriorDerivative[#][expr]&/@Plus[spaces]; 428 | 429 | (*ExteriorDerivative is linear.*) 430 | ExteriorDerivative[space_?SpaceQ][x_+y_]:= 431 | ExteriorDerivative[space][x]+ExteriorDerivative[space][y]; 432 | 433 | (*ExteriorDerivative works with expanded arguments.*) 434 | ExteriorDerivative[space_?SpaceQ][x_*y_Plus]:= 435 | ExteriorDerivative[space][Expand[x*y]]; 436 | 437 | ExteriorDerivative[space_?SpaceQ][s_|s_.*x_WedgeProduct|s_.*x_DirectProduct|s_.*x_?BasisQ]/;FreeQ[s,_WedgeProduct|_DirectProduct|_?BasisQ|_?TensorSymbolQ]:=Module[{coord,basis}, 438 | coord=CoordSpace[Select[#Space==space&],"Coordinate"]//Normal; 439 | basis=CoordSpace[Select[#Space==space&],"BasisForm"]//Normal; 440 | Sum[D[s,coord[[i]]]WedgeProduct[basis[[i]], x ],{i,1,Length@coord}] 441 | ] 442 | 443 | 444 | (*InteriorProduct is symmetric.*) 445 | SetAttributes[InteriorProduct,Orderless]; 446 | 447 | (*InteriorProduct is linear.*) 448 | InteriorProduct[s_,z_]/;FreeQ[s,_?BasisQ]:=s z; 449 | InteriorProduct[s_*x_,z_]/;FreeQ[s,_?BasisQ]:=s InteriorProduct[x,z]; 450 | InteriorProduct[x_+y_,z_]:=InteriorProduct[x,z]+InteriorProduct[y,z]; 451 | 452 | (*InteriorProduct of a basis vector and a basis form is a Kronecker delta.*) 453 | InteriorProduct[v_?BasisVectorQ,f_?BasisFormQ]:=Length[CoordSpace[Select[#BasisVector==v&&#BasisForm==f&]]]; 454 | 455 | InteriorProduct[DirectProduct[x_?BasisQ,y_],z_]:=InteriorProduct[y,InteriorProduct[x,z]]; 456 | InteriorProduct[DirectProduct[x_,y_],z_?BasisQ]:=DirectProduct[InteriorProduct[x,z],y]; 457 | InteriorProduct[w_WedgeProduct,z_?BasisQ]:=Sum[(-1)^(1+i) InteriorProduct[#1,z]#2&@@TakeDrop[w,{i}],{i,Length[w]}] 458 | 459 | 460 | End[] 461 | 462 | EndPackage[] 463 | 464 | -------------------------------------------------------------------------------- /SimpleTensor_test.nb: -------------------------------------------------------------------------------- 1 | (* Content-type: application/vnd.wolfram.mathematica *) 2 | 3 | (*** Wolfram Notebook File ***) 4 | (* http://www.wolfram.com/nb *) 5 | 6 | (* CreatedBy='Mathematica 12.0' *) 7 | 8 | (*CacheID: 234*) 9 | (* Internal cache information: 10 | NotebookFileLineBreakTest 11 | NotebookFileLineBreakTest 12 | NotebookDataPosition[ 158, 7] 13 | NotebookDataLength[ 89112, 2256] 14 | NotebookOptionsPosition[ 87096, 2212] 15 | NotebookOutlinePosition[ 87428, 2227] 16 | CellTagsIndexPosition[ 87385, 2224] 17 | WindowFrame->Normal*) 18 | 19 | (* Beginning of Notebook Content *) 20 | Notebook[{ 21 | Cell[BoxData[{ 22 | RowBox[{ 23 | RowBox[{"Needs", "[", "\"\\"", "]"}], 24 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 25 | RowBox[{"DefineSpace", "[", 26 | RowBox[{"\"\\"", ",", "0"}], "]"}], "\[IndentingNewLine]", 27 | RowBox[{ 28 | RowBox[{"DefineSpace", "[", 29 | RowBox[{"\"\\"", ",", "4", ",", 30 | RowBox[{"index", "\[Rule]", 31 | RowBox[{"{", 32 | RowBox[{"\[Mu]", ",", "\[Nu]", ",", "\[Lambda]", ",", "\[Rho]"}], 33 | "}"}]}], ",", 34 | RowBox[{"coord", "\[Rule]", 35 | RowBox[{"{", 36 | RowBox[{"t", ",", "x", ",", "y", ",", "z"}], "}"}]}]}], "]"}], 37 | ";"}], "\[IndentingNewLine]", 38 | RowBox[{ 39 | RowBox[{"DefineSpace", "[", 40 | RowBox[{"\"\\"", ",", "4", ",", 41 | RowBox[{"index", "\[Rule]", 42 | RowBox[{"{", 43 | RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "}"}]}], ",", 44 | RowBox[{"coord", "\[Rule]", 45 | RowBox[{"{", 46 | RowBox[{"s0", ",", "s1", ",", "s2", ",", "s3"}], "}"}]}]}], "]"}], 47 | ";"}], "\[IndentingNewLine]", 48 | RowBox[{ 49 | RowBox[{ 50 | RowBox[{"metric", "[", 51 | RowBox[{ 52 | RowBox[{"-", "a"}], ",", 53 | RowBox[{"-", "b"}]}], "]"}], "\[Congruent]", 54 | RowBox[{"DiagonalMatrix", "[", 55 | RowBox[{"{", 56 | RowBox[{"1", ",", 57 | RowBox[{"-", "1"}], ",", 58 | RowBox[{"-", "1"}], ",", 59 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", 60 | RowBox[{ 61 | RowBox[{"DefineSpace", "[", 62 | RowBox[{"\"\\"", ",", "3", ",", 63 | RowBox[{"index", "\[Rule]", 64 | RowBox[{"{", 65 | RowBox[{"i\[Lambda]", ",", "i\[Eta]"}], "}"}]}], ",", 66 | RowBox[{"coord", "\[Rule]", 67 | RowBox[{"{", 68 | RowBox[{"\[Lambda]", ",", "\[Eta]", ",", "\[Xi]"}], "}"}]}]}], "]"}], 69 | ";"}], "\[IndentingNewLine]", 70 | RowBox[{ 71 | RowBox[{ 72 | RowBox[{"metric", "[", 73 | RowBox[{ 74 | RowBox[{"-", "i\[Lambda]"}], ",", 75 | RowBox[{"-", "i\[Eta]"}]}], "]"}], "\[Congruent]", 76 | RowBox[{"IdentityMatrix", "[", "3", "]"}]}], ";"}], "\[IndentingNewLine]", 77 | 78 | RowBox[{ 79 | RowBox[{ 80 | RowBox[{ 81 | RowBox[{"metric", "[", 82 | RowBox[{ 83 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "]"}], "\[Congruent]", 84 | TagBox[ 85 | RowBox[{"(", "\[NoBreak]", GridBox[{ 86 | {"1", "0", "0", "a"}, 87 | {"0", "1", "0", "0"}, 88 | {"0", "0", "1", "0"}, 89 | {"0", "0", "0", "1"} 90 | }, 91 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 92 | GridBoxSpacings->{"Columns" -> { 93 | Offset[0.27999999999999997`], { 94 | Offset[0.7]}, 95 | Offset[0.27999999999999997`]}, "Rows" -> { 96 | Offset[0.2], { 97 | Offset[0.4]}, 98 | Offset[0.2]}}], "\[NoBreak]", ")"}], 99 | Function[BoxForm`e$, 100 | MatrixForm[BoxForm`e$]]]}], ";"}], "\[IndentingNewLine]", 101 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 102 | RowBox[{ 103 | RowBox[{ 104 | RowBox[{ 105 | RowBox[{"\[Epsilon]", "[", 106 | RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "]"}], "\[Congruent]", 107 | RowBox[{"LeviCivitaTensor", "[", "4", "]"}]}], "//", "Normal"}], 108 | ";"}], "\[IndentingNewLine]", 109 | RowBox[{ 110 | RowBox[{ 111 | RowBox[{"s", "[", "a", "]"}], "\[Congruent]", 112 | RowBox[{"{", 113 | RowBox[{"s0", ",", "s1", ",", "s2", ",", "s3"}], "}"}]}], 114 | ";"}], "\[IndentingNewLine]", 115 | RowBox[{ 116 | RowBox[{ 117 | RowBox[{"T", "[", "a", "]"}], "\[Congruent]", 118 | RowBox[{"{", 119 | RowBox[{"T0", ",", "T1", ",", "T2", ",", "T3"}], "}"}]}], 120 | ";"}], "\[IndentingNewLine]", 121 | RowBox[{ 122 | RowBox[{ 123 | RowBox[{"p", "[", "\[Mu]", "]"}], "\[Congruent]", 124 | RowBox[{"{", 125 | RowBox[{"p0", ",", "p1", ",", "p2", ",", "p3"}], "}"}]}], 126 | ";"}], "\[IndentingNewLine]", 127 | RowBox[{ 128 | RowBox[{ 129 | RowBox[{"crd", "[", "\[Mu]", "]"}], "\[Congruent]", 130 | RowBox[{"{", 131 | RowBox[{"t", ",", "x", ",", "y", ",", "z"}], "}"}]}], 132 | ";"}], "\[IndentingNewLine]", 133 | RowBox[{ 134 | RowBox[{ 135 | RowBox[{"\[Sigma]", "[", "a", "]"}], "\[Congruent]", 136 | RowBox[{"Table", "[", 137 | RowBox[{ 138 | RowBox[{"PauliMatrix", "[", "i", "]"}], ",", 139 | RowBox[{"{", 140 | RowBox[{"i", ",", "0", ",", "3"}], "}"}]}], "]"}]}], 141 | ";"}], "\[IndentingNewLine]", 142 | RowBox[{ 143 | RowBox[{ 144 | RowBox[{"m", "[", 145 | RowBox[{"a", ",", "b"}], "]"}], "\[Congruent]", 146 | TagBox[ 147 | RowBox[{"(", "\[NoBreak]", GridBox[{ 148 | {"a", "b", "0", "0"}, 149 | {"c", "d", "0", "0"}, 150 | {"0", "0", "0", "0"}, 151 | {"0", "0", "0", "0"} 152 | }, 153 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 154 | GridBoxSpacings->{"Columns" -> { 155 | Offset[0.27999999999999997`], { 156 | Offset[0.7]}, 157 | Offset[0.27999999999999997`]}, "Rows" -> { 158 | Offset[0.2], { 159 | Offset[0.4]}, 160 | Offset[0.2]}}], "\[NoBreak]", ")"}], 161 | Function[BoxForm`e$, 162 | MatrixForm[BoxForm`e$]]]}], "\[IndentingNewLine]", "\[IndentingNewLine]", 163 | RowBox[{"(*", 164 | RowBox[{ 165 | "Convenient", " ", "place", " ", "to", " ", "test", " ", "various", " ", 166 | "calculations", " ", "in", " ", "more", " ", 167 | RowBox[{"detail", "."}]}], "*)"}]}], "\[IndentingNewLine]", 168 | RowBox[{ 169 | RowBox[{ 170 | RowBox[{"SimpleTensor`Private`$Verbose", "=", "True"}], ";"}], 171 | "\[IndentingNewLine]", 172 | RowBox[{"(*", 173 | RowBox[{ 174 | RowBox[{ 175 | RowBox[{ 176 | RowBox[{"\[Sigma]", "[", "a", "]"}], 177 | RowBox[{"p", "[", 178 | RowBox[{"-", "a"}], "]"}]}], "\[CirclePlus]", 179 | RowBox[{"-", 180 | RowBox[{"IdentityMatrix", "[", "2", "]"}]}]}], "//", "GetArray"}], 181 | "*)"}], "\[IndentingNewLine]", 182 | RowBox[{"(*", 183 | RowBox[{"GetArray", "[", 184 | RowBox[{ 185 | RowBox[{"\[Sigma]", "[", 186 | RowBox[{"-", "a"}], "]"}], 187 | RowBox[{"\[Sigma]", "[", "a", "]"}]}], "]"}], "*)"}], 188 | "\[IndentingNewLine]", 189 | RowBox[{"(*", 190 | RowBox[{"GetArray", "[", 191 | RowBox[{ 192 | RowBox[{"\[Eth]", "[", 193 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 194 | RowBox[{"{", 195 | RowBox[{"t", ",", "x"}], "}"}], "]"}], "]"}], "*)"}], 196 | "\[IndentingNewLine]", 197 | RowBox[{"(*", 198 | RowBox[{ 199 | RowBox[{ 200 | RowBox[{"\[Eth]", "[", 201 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 202 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}], "//", "GetArray"}], "*)"}], 203 | "\[IndentingNewLine]", 204 | RowBox[{"(*", 205 | RowBox[{ 206 | RowBox[{ 207 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 208 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}], "//", "GetArray"}], 209 | "*)"}]}], "\[IndentingNewLine]", 210 | RowBox[{ 211 | RowBox[{"SimpleTensor`Private`$Verbose", "=", "False"}], ";"}]}], "Input", 212 | CellChangeTimes->{{3.792158101212224*^9, 3.792158133572626*^9}, { 213 | 3.79217855558908*^9, 3.792178557012375*^9}, {3.792179877498859*^9, 214 | 3.79217988322101*^9}, {3.7926802770006104`*^9, 3.792680287572363*^9}, { 215 | 3.79438909938173*^9, 3.794389102436214*^9}, {3.794416661599671*^9, 216 | 3.794416706497932*^9}, {3.794419377443275*^9, 3.7944193842442513`*^9}, { 217 | 3.794419748756208*^9, 3.794419749654375*^9}, {3.794420909687642*^9, 218 | 3.794420910243675*^9}, {3.7944237857766943`*^9, 3.794423787099189*^9}, { 219 | 3.7944254627149773`*^9, 3.794425463840086*^9}, {3.794427337237609*^9, 220 | 3.794427337986458*^9}, {3.79447107200915*^9, 3.7944710863808393`*^9}, { 221 | 3.794496383052944*^9, 3.794496385052397*^9}, {3.7954265891100817`*^9, 222 | 3.795426594868133*^9}, 3.802500779431245*^9, {3.802500842442523*^9, 223 | 3.802500886113863*^9}, {3.802500936292262*^9, 3.8025009933676147`*^9}, { 224 | 3.802501056530636*^9, 3.802501123483637*^9}, {3.802501170701182*^9, 225 | 3.802501214715125*^9}, {3.802501266705518*^9, 3.802501316824952*^9}, { 226 | 3.8025013781328287`*^9, 3.802501378342856*^9}, {3.802502197413145*^9, 227 | 3.802502229058724*^9}, {3.802503059710434*^9, 3.802503066878943*^9}, { 228 | 3.802506844418606*^9, 3.802506846360426*^9}, {3.802515004370315*^9, 229 | 3.80251503713719*^9}, {3.802515079947701*^9, 3.8025151187780724`*^9}, { 230 | 3.802515359754859*^9, 3.802515375017024*^9}, {3.802515424375029*^9, 231 | 3.8025154258733*^9}, {3.802515466880274*^9, 3.8025154689697447`*^9}, { 232 | 3.802674781827366*^9, 3.802674856231616*^9}, {3.8026748959215097`*^9, 233 | 3.802674908429241*^9}, {3.8031381836802397`*^9, 3.803138184309264*^9}, { 234 | 3.803186668478435*^9, 3.803186682842999*^9}, {3.80318674348402*^9, 235 | 3.8031867544559317`*^9}, {3.803186939739455*^9, 3.803186962458692*^9}, 236 | 3.803187136665866*^9, {3.8031871711763353`*^9, 3.8031872251292152`*^9}, { 237 | 3.803187258672975*^9, 3.803187289679236*^9}, {3.803187320817037*^9, 238 | 3.8031873232953253`*^9}, {3.80318959443787*^9, 3.8031896109185123`*^9}, { 239 | 3.803193347292143*^9, 3.8031933475270147`*^9}, {3.8031934153582277`*^9, 240 | 3.803193415615905*^9}, {3.803193460110475*^9, 3.8031934603310633`*^9}, { 241 | 3.803193879954734*^9, 3.803194005277985*^9}, {3.803194070511567*^9, 242 | 3.803194081217708*^9}, {3.803194139842486*^9, 3.803194143361616*^9}, { 243 | 3.803194650400709*^9, 3.803194660045895*^9}, {3.8031947674582167`*^9, 244 | 3.803194778146142*^9}, {3.803204641701518*^9, 3.803204660874134*^9}, { 245 | 3.803204703925845*^9, 3.803204751152585*^9}, 3.8032048241781893`*^9, { 246 | 3.803632473312446*^9, 3.80363250447585*^9}, {3.80363616173252*^9, 247 | 3.80363616203681*^9}, {3.803892957241378*^9, 3.803893010387501*^9}, { 248 | 3.804765523234067*^9, 3.804765524479898*^9}, {3.80477776183132*^9, 249 | 3.804777762110461*^9}, {3.8049189165376387`*^9, 3.804918923873371*^9}, { 250 | 3.804919146545636*^9, 3.804919171961255*^9}, {3.804919360426113*^9, 251 | 3.804919362276569*^9}, {3.8049194682990513`*^9, 3.8049195243798447`*^9}, 252 | 3.8049195724574127`*^9, {3.805015570930566*^9, 3.8050155791536913`*^9}, { 253 | 3.8050156310727177`*^9, 3.8050156779800167`*^9}, {3.805016833420055*^9, 254 | 3.805016840442185*^9}, {3.805058912122734*^9, 3.805058921049439*^9}, { 255 | 3.805059021903172*^9, 3.805059116735174*^9}, {3.805111979641378*^9, 256 | 3.8051119992686234`*^9}, {3.805121707840776*^9, 3.805121727725626*^9}, { 257 | 3.8051217827487392`*^9, 3.805121840240177*^9}, {3.805121961268588*^9, 258 | 3.805121970403351*^9}, 3.805126156601728*^9, {3.805131832099592*^9, 259 | 3.805131842733227*^9}, {3.8051330319253893`*^9, 3.805133052318966*^9}, { 260 | 3.80513313438796*^9, 3.805133146005234*^9}, {3.8051338222565527`*^9, 261 | 3.805133829484221*^9}, {3.805133888229835*^9, 3.80513388840681*^9}, { 262 | 3.805922492457787*^9, 3.80592249305296*^9}, {3.805922601511983*^9, 263 | 3.8059226021991034`*^9}, 3.805952552326788*^9, {3.805959910699671*^9, 264 | 3.8059599165354424`*^9}, {3.80597428087368*^9, 3.80597430088721*^9}, 265 | 3.805980069158597*^9, {3.805980161077598*^9, 3.805980161281242*^9}, { 266 | 3.805992744765395*^9, 3.805992774659457*^9}, {3.805993188378312*^9, 267 | 3.805993242243968*^9}, {3.8059943267139263`*^9, 3.805994445023012*^9}, { 268 | 3.8059946812050877`*^9, 3.80599469934048*^9}, {3.8059964577734528`*^9, 269 | 3.8059965137886467`*^9}, {3.8060416267342787`*^9, 3.806041655647006*^9}, { 270 | 3.8060455710733*^9, 3.8060455718077183`*^9}, {3.806049072076445*^9, 271 | 3.8060490768979797`*^9}, {3.806049634596656*^9, 3.806049635031598*^9}, { 272 | 3.8060521264347763`*^9, 3.806052185058054*^9}, {3.806052220854334*^9, 273 | 3.806052239974804*^9}, {3.806052924821444*^9, 3.806053007350174*^9}, { 274 | 3.8060533989908237`*^9, 3.806053430144906*^9}, {3.806066782818604*^9, 275 | 3.806066791399349*^9}, {3.80606694203706*^9, 3.8060670077813787`*^9}, { 276 | 3.806067168623995*^9, 3.806067169432453*^9}, {3.806067272116242*^9, 277 | 3.8060672873964357`*^9}, {3.806067561570579*^9, 3.806067622240047*^9}, { 278 | 3.80606770373315*^9, 3.806067707494404*^9}, {3.8060687173332157`*^9, 279 | 3.806068725996172*^9}, 3.806069653555973*^9, 3.806070568247658*^9, 280 | 3.806083084648718*^9, 3.806084825519916*^9, {3.806085230845187*^9, 281 | 3.806085231939055*^9}, {3.8060919542752*^9, 3.8060919894977617`*^9}, { 282 | 3.806093367382636*^9, 3.806093367653778*^9}, {3.806093621835997*^9, 283 | 3.806093627946618*^9}, {3.806210128622924*^9, 3.806210150522869*^9}, { 284 | 3.806210186609551*^9, 3.806210196885161*^9}, {3.806210867488884*^9, 285 | 3.8062108758633547`*^9}, {3.806211055081794*^9, 3.806211055439418*^9}, { 286 | 3.807879278560236*^9, 3.807879331363978*^9}, {3.807879379002109*^9, 287 | 3.807879395242597*^9}, {3.807879437080687*^9, 3.8078795451674147`*^9}, { 288 | 3.8078796113434677`*^9, 3.807879620044242*^9}, {3.812628204500305*^9, 289 | 3.812628238414692*^9}, {3.834578430400145*^9, 3.834578430567853*^9}, 290 | 3.834578524585318*^9, {3.8345853705077133`*^9, 3.834585374383383*^9}, { 291 | 3.834587438698783*^9, 3.834587439124055*^9}, {3.834589596131024*^9, 292 | 3.834589610699333*^9}, {3.8345896551038218`*^9, 3.834589657722777*^9}, 293 | 3.8345990942553387`*^9, {3.83463335675198*^9, 3.834633365382333*^9}, 294 | 3.8346334204542227`*^9, {3.8346337196962633`*^9, 3.834633822096178*^9}, { 295 | 3.834633855798534*^9, 3.8346338570214767`*^9}, {3.834633890102364*^9, 296 | 3.834633893065802*^9}, {3.8346339590901213`*^9, 3.834633961284235*^9}, { 297 | 3.834634448345791*^9, 3.834634465922164*^9}, {3.834634562539426*^9, 298 | 3.834634625648705*^9}, {3.8346347279187727`*^9, 3.834634755475184*^9}, { 299 | 3.834635304171792*^9, 3.83463531481112*^9}, {3.834635708023491*^9, 300 | 3.834635709433445*^9}, {3.834636702424143*^9, 3.834636705305187*^9}, { 301 | 3.834719701419509*^9, 3.83471971054268*^9}, {3.83472189987735*^9, 302 | 3.8347219066471024`*^9}, {3.8347228553964567`*^9, 3.8347228565685*^9}, { 303 | 3.83472356145545*^9, 3.834723561661846*^9}, {3.834725060979465*^9, 304 | 3.834725071302268*^9}, {3.83472919567132*^9, 3.8347292157218447`*^9}, { 305 | 3.834731456369659*^9, 3.834731466538892*^9}, {3.834731586025537*^9, 306 | 3.834731624595015*^9}, 3.834731669261484*^9, {3.834735243615341*^9, 307 | 3.834735243885255*^9}, {3.834735532000471*^9, 3.834735571316886*^9}, { 308 | 3.834737415931181*^9, 3.834737420264737*^9}, {3.8347375819163113`*^9, 309 | 3.8347375824726057`*^9}, {3.8347384214912453`*^9, 3.834738433446999*^9}, { 310 | 3.834741831801189*^9, 3.834741836089098*^9}, {3.8347418891081047`*^9, 311 | 3.834741890344438*^9}, 3.8353293661316967`*^9, {3.83533049688465*^9, 312 | 3.835330497396742*^9}, {3.835440411596518*^9, 3.835440422780097*^9}, { 313 | 3.835441924457654*^9, 3.835441941306164*^9}, {3.835442003245885*^9, 314 | 3.8354420149013*^9}, {3.835443525635263*^9, 3.8354435718967867`*^9}, { 315 | 3.835443631226612*^9, 3.835443631301436*^9}, {3.835443665890154*^9, 316 | 3.8354436946844*^9}, {3.835446123846842*^9, 3.8354461486775703`*^9}, { 317 | 3.835446298380639*^9, 3.835446298690318*^9}, {3.835446346066381*^9, 318 | 3.835446347551485*^9}, {3.835446383824692*^9, 3.835446408931859*^9}, { 319 | 3.835447536080063*^9, 3.83544753759276*^9}, {3.835447781549374*^9, 320 | 3.835447781822872*^9}, {3.835514082579657*^9, 3.83551408440296*^9}, { 321 | 3.835514548485029*^9, 3.8355145546254873`*^9}, 3.835514685729157*^9, { 322 | 3.835515326799217*^9, 3.835515330444001*^9}, 3.835515417264423*^9, { 323 | 3.8355155594918957`*^9, 3.835515581950562*^9}, {3.83551650276152*^9, 324 | 3.8355165108142223`*^9}, {3.835516643225589*^9, 3.8355166434886503`*^9}, { 325 | 3.835516684308682*^9, 3.835516698961507*^9}, {3.835516771609502*^9, 326 | 3.835516778425336*^9}, {3.835517268239561*^9, 3.835517268492261*^9}, { 327 | 3.83552287516378*^9, 3.835522877674926*^9}, {3.83552391705693*^9, 328 | 3.835523925935677*^9}, {3.8355241010075397`*^9, 3.835524114515727*^9}, { 329 | 3.835524196704706*^9, 3.83552420514727*^9}, {3.83552423921999*^9, 330 | 3.8355242567547493`*^9}, {3.835524329801827*^9, 3.835524331599867*^9}, { 331 | 3.8442232016130323`*^9, 3.844223232833232*^9}, {3.844223574783929*^9, 332 | 3.844223586938817*^9}, {3.84422481030814*^9, 3.844224814603409*^9}, { 333 | 3.8442248811912193`*^9, 3.844224884473488*^9}, {3.844238650302904*^9, 334 | 3.844238656771151*^9}, {3.8442391949621477`*^9, 3.84423919635151*^9}, { 335 | 3.844239741159697*^9, 3.844239741575282*^9}, {3.84424404410526*^9, 336 | 3.844244044410096*^9}, {3.844941010977456*^9, 3.8449410113715754`*^9}, { 337 | 3.845280384013482*^9, 3.8452803843863688`*^9}}, 338 | CellLabel->"In[55]:=",ExpressionUUID->"c666a26b-ac47-4501-b7af-5a50f45ff1ef"], 339 | 340 | Cell[CellGroupData[{ 341 | 342 | Cell["Tests", "Chapter", 343 | CellChangeTimes->{{3.807863402407136*^9, 344 | 3.807863412749351*^9}},ExpressionUUID->"83fd7a4b-70f7-4a1c-93f5-\ 345 | 8ec4c19f6475"], 346 | 347 | Cell[CellGroupData[{ 348 | 349 | Cell["Space creations tests", "Section", 350 | CellChangeTimes->{{3.807863172971298*^9, 3.807863218598982*^9}, { 351 | 3.834585741361053*^9, 352 | 3.8345857464193993`*^9}},ExpressionUUID->"ca166e74-3fad-4bb9-8752-\ 353 | e4838a31451b"], 354 | 355 | Cell[BoxData[{ 356 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 357 | RowBox[{"DefineSpace", "[", 358 | RowBox[{"\"\\"", ",", "2"}], "]"}], "\[IndentingNewLine]", 359 | RowBox[{"Assert", "[", 360 | RowBox[{ 361 | RowBox[{"SimpleTensor`Private`SpaceDim", "[", "\"\\"", "]"}], "===", 362 | "2"}], "]"}], "\[IndentingNewLine]", 363 | RowBox[{"Assert", "[", 364 | RowBox[{ 365 | RowBox[{ 366 | RowBox[{"PositionIndex", "[", "SimpleTensor`Private`IndexSpace", "]"}], 367 | "[", "\"\\"", "]"}], "===", 368 | RowBox[{"{", 369 | RowBox[{"iTest0", ",", "iTest1", ",", "iTest2", ",", "iTest3", ",", 370 | RowBox[{"-", "iTest0"}], ",", 371 | RowBox[{"-", "iTest1"}], ",", 372 | RowBox[{"-", "iTest2"}], ",", 373 | RowBox[{"-", "iTest3"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 374 | RowBox[{"Assert", "[", 375 | RowBox[{ 376 | RowBox[{"Normal", "@", 377 | RowBox[{"SimpleTensor`Private`CoordSpace", "[", 378 | RowBox[{ 379 | RowBox[{"Select", "[", 380 | RowBox[{ 381 | RowBox[{"#Space", "\[Equal]", "\"\\""}], "&"}], "]"}], ",", 382 | "\"\\""}], "]"}]}], "===", 383 | RowBox[{"{", 384 | RowBox[{"xTest0", ",", "xTest1"}], "}"}]}], 385 | "]"}], "\[IndentingNewLine]", 386 | RowBox[{"Assert", "[", 387 | RowBox[{ 388 | RowBox[{"Normal", "@", 389 | RowBox[{"SimpleTensor`Private`CoordSpace", "[", 390 | RowBox[{ 391 | RowBox[{"Select", "[", 392 | RowBox[{ 393 | RowBox[{"#Space", "\[Equal]", "\"\\""}], "&"}], "]"}], ",", 394 | "\"\\""}], "]"}]}], "===", 395 | RowBox[{"{", 396 | RowBox[{"dxTest0", ",", "dxTest1"}], "}"}]}], 397 | "]"}], "\[IndentingNewLine]", 398 | RowBox[{"Assert", "[", 399 | RowBox[{ 400 | RowBox[{"Normal", "@", 401 | RowBox[{"SimpleTensor`Private`CoordSpace", "[", 402 | RowBox[{ 403 | RowBox[{"Select", "[", 404 | RowBox[{ 405 | RowBox[{"#Space", "\[Equal]", "\"\\""}], "&"}], "]"}], ",", 406 | "\"\\""}], "]"}]}], "===", 407 | RowBox[{"{", 408 | RowBox[{"\[Eth]xTest0", ",", "\[Eth]xTest1"}], "}"}]}], 409 | "]"}], "\[IndentingNewLine]", 410 | RowBox[{ 411 | RowBox[{"V", "[", "iTest0", "]"}], "\[Congruent]", 412 | RowBox[{"{", 413 | RowBox[{"1", ",", "0"}], "}"}]}], "\[IndentingNewLine]", 414 | RowBox[{"DefineSpace", "[", 415 | RowBox[{"\"\\"", ",", "0"}], "]"}], "\[IndentingNewLine]", 416 | RowBox[{"Assert", "[", 417 | RowBox[{ 418 | RowBox[{"SimpleTensor`Private`SpaceDim", "[", "\"\\"", "]"}], "===", 419 | "0"}], "]"}], "\[IndentingNewLine]", 420 | RowBox[{"Assert", "[", 421 | RowBox[{"!", 422 | RowBox[{"MemberQ", "[", 423 | RowBox[{"SimpleTensor`Private`IndexSpace", ",", "\"\\""}], "]"}]}], 424 | "]"}], "\[IndentingNewLine]", 425 | RowBox[{"Assert", "[", 426 | RowBox[{ 427 | RowBox[{"Length", "@", 428 | RowBox[{"SimpleTensor`Private`CoordSpace", "[", 429 | RowBox[{"Select", "[", 430 | RowBox[{ 431 | RowBox[{"#Space", "\[Equal]", "\"\\""}], "&"}], "]"}], "]"}]}], 432 | "===", "0"}], "]"}], "\[IndentingNewLine]", 433 | RowBox[{"Assert", "[", 434 | RowBox[{"!", 435 | RowBox[{"MemberQ", "[", 436 | RowBox[{ 437 | RowBox[{"Keys", "@", "SimpleTensor`Private`TensorValues"}], ",", 438 | RowBox[{"V", "[", "\"\\"", "]"}]}], "]"}]}], 439 | "]"}], "\[IndentingNewLine]", 440 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 441 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 442 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 443 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 444 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 445 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 446 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 447 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 448 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 449 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 450 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 451 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 452 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 453 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 454 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 455 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 456 | 3.807861411349864*^9}, 3.807863316125087*^9, {3.8078633664718637`*^9, 457 | 3.807863378786847*^9}, {3.834585894515271*^9, 3.834585918318718*^9}, { 458 | 3.834585969656974*^9, 3.8345859721553783`*^9}, {3.834586007223608*^9, 459 | 3.8345861233975267`*^9}, {3.83458637425976*^9, 3.834586393598296*^9}, { 460 | 3.8345864911734457`*^9, 3.834586522934647*^9}, {3.8345865596972113`*^9, 461 | 3.834586615883854*^9}, {3.834586728087956*^9, 3.834586825140315*^9}, { 462 | 3.834586856160581*^9, 3.834586925107829*^9}, {3.8345870008219023`*^9, 463 | 3.834587060225669*^9}, {3.834587111161913*^9, 3.834587183188249*^9}, { 464 | 3.8345872243012953`*^9, 3.834587228577209*^9}, {3.834587392956264*^9, 465 | 3.834587393263877*^9}, {3.8353623588502502`*^9, 3.8353624622633333`*^9}, { 466 | 3.835362492332287*^9, 3.835362537169842*^9}, {3.8355138360661592`*^9, 467 | 3.835513836373362*^9}, {3.835513872143519*^9, 3.835513902955702*^9}, { 468 | 3.835523801916238*^9, 3.835523881535359*^9}, {3.835770644751336*^9, 469 | 3.835770808037875*^9}}, 470 | CellLabel->"In[72]:=",ExpressionUUID->"e462386a-5886-4e68-80f6-85f32eaa5240"] 471 | }, Open ]], 472 | 473 | Cell[CellGroupData[{ 474 | 475 | Cell["SetTensor tests", "Section", 476 | CellChangeTimes->{{3.807863172971298*^9, 3.807863218598982*^9}, { 477 | 3.834585741361053*^9, 3.8345857464193993`*^9}, {3.844224969718521*^9, 478 | 3.844224971283514*^9}},ExpressionUUID->"34d4a51f-4707-4b7c-b1da-\ 479 | 1c162edfec9c"], 480 | 481 | Cell[BoxData[{ 482 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 483 | RowBox[{"Assert", "[", 484 | RowBox[{ 485 | RowBox[{"SetTensor", "[", 486 | RowBox[{ 487 | RowBox[{"t", "[", "]"}], ",", "42"}], "]"}], "===", 488 | RowBox[{"Unevaluated", "@", 489 | RowBox[{"SetTensor", "[", 490 | RowBox[{ 491 | RowBox[{"t", "[", "]"}], ",", "42"}], "]"}]}]}], 492 | "]"}], "\[IndentingNewLine]", 493 | RowBox[{"Assert", "[", 494 | RowBox[{"!", 495 | RowBox[{"MemberQ", "[", 496 | RowBox[{ 497 | RowBox[{"Keys", "@", "SimpleTensor`Private`TensorValues"}], ",", 498 | RowBox[{"t", "[", "]"}]}], "]"}]}], "]"}], "\[IndentingNewLine]", 499 | RowBox[{ 500 | RowBox[{ 501 | RowBox[{"t1", "[", 502 | RowBox[{"\[Mu]", ",", 503 | RowBox[{"-", "\[Nu]"}]}], "]"}], "\[Congruent]", 504 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 505 | ";"}], "\[IndentingNewLine]", 506 | RowBox[{ 507 | RowBox[{ 508 | RowBox[{"t2", "[", 509 | RowBox[{"\[Nu]", ",", 510 | RowBox[{"-", "\[Mu]"}]}], "]"}], "\[Congruent]", 511 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 512 | ";"}], "\[IndentingNewLine]", 513 | RowBox[{ 514 | RowBox[{ 515 | RowBox[{"t3", "[", 516 | RowBox[{"\[Mu]", ",", 517 | RowBox[{"-", "\[Mu]"}]}], "]"}], "\[Congruent]", 518 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 519 | ";"}], "\[IndentingNewLine]", 520 | RowBox[{"Assert", "[", 521 | RowBox[{ 522 | RowBox[{"GetArray", "[", 523 | RowBox[{"t1", "[", 524 | RowBox[{"\[Mu]", ",", 525 | RowBox[{"-", "\[Nu]"}]}], "]"}], "]"}], "===", 526 | RowBox[{"GetArray", "[", 527 | RowBox[{"t2", "[", 528 | RowBox[{"\[Mu]", ",", 529 | RowBox[{"-", "\[Nu]"}]}], "]"}], "]"}], "===", 530 | RowBox[{"GetArray", "[", 531 | RowBox[{"t3", "[", 532 | RowBox[{"\[Mu]", ",", 533 | RowBox[{"-", "\[Nu]"}]}], "]"}], "]"}]}], 534 | "]"}], "\[IndentingNewLine]", 535 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 536 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 537 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 538 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 539 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 540 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 541 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 542 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 543 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 544 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 545 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 546 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 547 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 548 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 549 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 550 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 551 | 3.807861411349864*^9}, 3.807863316125087*^9, {3.8078633664718637`*^9, 552 | 3.807863378786847*^9}, {3.834585894515271*^9, 3.834585918318718*^9}, { 553 | 3.834585969656974*^9, 3.8345859721553783`*^9}, {3.834586007223608*^9, 554 | 3.8345861233975267`*^9}, {3.83458637425976*^9, 3.834586393598296*^9}, { 555 | 3.8345864911734457`*^9, 3.834586522934647*^9}, {3.8345865596972113`*^9, 556 | 3.834586615883854*^9}, {3.834586728087956*^9, 3.834586825140315*^9}, { 557 | 3.834586856160581*^9, 3.834586925107829*^9}, {3.8345870008219023`*^9, 558 | 3.834587060225669*^9}, {3.834587111161913*^9, 3.834587183188249*^9}, { 559 | 3.8345872243012953`*^9, 3.834587228577209*^9}, {3.834587392956264*^9, 560 | 3.834587393263877*^9}, {3.8353623588502502`*^9, 3.8353624622633333`*^9}, { 561 | 3.835362492332287*^9, 3.835362537169842*^9}, {3.8355138360661592`*^9, 562 | 3.835513836373362*^9}, {3.835513872143519*^9, 3.835513902955702*^9}, { 563 | 3.835523801916238*^9, 3.835523881535359*^9}, {3.835770644751336*^9, 564 | 3.835770808037875*^9}, {3.84422507431813*^9, 3.844225092771422*^9}, { 565 | 3.844225161993664*^9, 3.844225163045844*^9}, {3.844225216062625*^9, 566 | 3.844225288937426*^9}, {3.844225383612124*^9, 3.84422538455826*^9}, { 567 | 3.844225450219982*^9, 3.844225505507454*^9}, {3.8442256159282722`*^9, 568 | 3.844225675600443*^9}, 3.8442262500265703`*^9, {3.8442264282189293`*^9, 569 | 3.844226509739573*^9}}, 570 | CellLabel->"In[86]:=",ExpressionUUID->"33fb5d39-0b48-47c5-b1b0-fc3feb297f45"] 571 | }, Open ]], 572 | 573 | Cell[CellGroupData[{ 574 | 575 | Cell["Metric contractions and basis changes", "Section", 576 | CellChangeTimes->{{3.807863172971298*^9, 577 | 3.807863218598982*^9}},ExpressionUUID->"8aef9d2f-d384-4cfd-a8d9-\ 578 | 2b26f93aaf0a"], 579 | 580 | Cell[BoxData[{ 581 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 582 | RowBox[{"Assert", "[", 583 | RowBox[{ 584 | RowBox[{"GetArray", "[", 585 | RowBox[{"metric", "[", 586 | RowBox[{ 587 | RowBox[{"-", "a"}], ",", "b"}], "]"}], "]"}], "===", 588 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 589 | "]"}], "\[IndentingNewLine]", 590 | RowBox[{"Assert", "[", 591 | RowBox[{ 592 | RowBox[{"GetArray", "[", 593 | RowBox[{"metric", "[", 594 | RowBox[{"a", ",", 595 | RowBox[{"-", "b"}]}], "]"}], "]"}], "===", 596 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 597 | "]"}], "\[IndentingNewLine]", 598 | RowBox[{"Assert", "[", 599 | RowBox[{ 600 | RowBox[{"GetArray", "[", 601 | RowBox[{"metric", "[", 602 | RowBox[{ 603 | RowBox[{"-", "a"}], ",", 604 | RowBox[{"-", "b"}]}], "]"}], "]"}], "===", 605 | RowBox[{"DiagonalMatrix", "[", 606 | RowBox[{"{", 607 | RowBox[{"1", ",", 608 | RowBox[{"-", "1"}], ",", 609 | RowBox[{"-", "1"}], ",", 610 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 611 | RowBox[{ 612 | RowBox[{"Assert", "[", 613 | RowBox[{ 614 | RowBox[{"GetArray", "[", 615 | RowBox[{"metric", "[", 616 | RowBox[{"a", ",", "b"}], "]"}], "]"}], "===", 617 | RowBox[{"DiagonalMatrix", "[", 618 | RowBox[{"{", 619 | RowBox[{"1", ",", 620 | RowBox[{"-", "1"}], ",", 621 | RowBox[{"-", "1"}], ",", 622 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], 623 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 624 | RowBox[{"Assert", "[", 625 | RowBox[{ 626 | RowBox[{"GetArray", "[", 627 | RowBox[{ 628 | RowBox[{"metric", "[", 629 | RowBox[{ 630 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "]"}], ",", 631 | RowBox[{"{", 632 | RowBox[{ 633 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "}"}]}], "]"}], "===", 634 | RowBox[{"(", "\[NoBreak]", GridBox[{ 635 | {"1", "0", "0", "a"}, 636 | {"0", "1", "0", "0"}, 637 | {"0", "0", "1", "0"}, 638 | {"0", "0", "0", "1"} 639 | }, 640 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 641 | GridBoxSpacings->{"Columns" -> { 642 | Offset[0.27999999999999997`], { 643 | Offset[0.7]}, 644 | Offset[0.27999999999999997`]}, "Rows" -> { 645 | Offset[0.2], { 646 | Offset[0.4]}, 647 | Offset[0.2]}}], "\[NoBreak]", ")"}]}], 648 | "]"}], "\[IndentingNewLine]", 649 | RowBox[{"Assert", "[", 650 | RowBox[{ 651 | RowBox[{"GetArray", "[", 652 | RowBox[{ 653 | RowBox[{"metric", "[", 654 | RowBox[{"\[Mu]", ",", 655 | RowBox[{"-", "a"}]}], "]"}], ",", 656 | RowBox[{"{", 657 | RowBox[{"\[Mu]", ",", 658 | RowBox[{"-", "a"}]}], "}"}]}], "]"}], "===", 659 | RowBox[{"(", "\[NoBreak]", GridBox[{ 660 | {"1", "0", "0", "0"}, 661 | {"0", "1", "0", "0"}, 662 | {"0", "0", "1", "0"}, 663 | {"a", "0", "0", "1"} 664 | }, 665 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 666 | GridBoxSpacings->{"Columns" -> { 667 | Offset[0.27999999999999997`], { 668 | Offset[0.7]}, 669 | Offset[0.27999999999999997`]}, "Rows" -> { 670 | Offset[0.2], { 671 | Offset[0.4]}, 672 | Offset[0.2]}}], "\[NoBreak]", ")"}]}], 673 | "]"}], "\[IndentingNewLine]", 674 | RowBox[{"Assert", "[", 675 | RowBox[{ 676 | RowBox[{"GetArray", "[", 677 | RowBox[{ 678 | RowBox[{"metric", "[", 679 | RowBox[{"a", ",", 680 | RowBox[{"-", "\[Mu]"}]}], "]"}], ",", 681 | RowBox[{"{", 682 | RowBox[{"a", ",", 683 | RowBox[{"-", "\[Mu]"}]}], "}"}]}], "]"}], "===", 684 | TagBox[ 685 | TagBox[ 686 | TagBox[ 687 | RowBox[{"(", "\[NoBreak]", GridBox[{ 688 | {"1", "0", "0", "0"}, 689 | {"0", "1", "0", "0"}, 690 | {"0", "0", "1", "0"}, 691 | { 692 | RowBox[{"-", "a"}], "0", "0", "1"} 693 | }, 694 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 695 | GridBoxSpacings->{"Columns" -> { 696 | Offset[0.27999999999999997`], { 697 | Offset[0.7]}, 698 | Offset[0.27999999999999997`]}, "Rows" -> { 699 | Offset[0.2], { 700 | Offset[0.4]}, 701 | Offset[0.2]}}], "\[NoBreak]", ")"}], 702 | Function[BoxForm`e$, 703 | MatrixForm[BoxForm`e$]]], 704 | Function[BoxForm`e$, 705 | MatrixForm[BoxForm`e$]]], 706 | Function[BoxForm`e$, 707 | MatrixForm[BoxForm`e$]]]}], "]"}], "\[IndentingNewLine]", 708 | RowBox[{ 709 | RowBox[{"Assert", "[", 710 | RowBox[{ 711 | RowBox[{"GetArray", "[", 712 | RowBox[{ 713 | RowBox[{"metric", "[", 714 | RowBox[{ 715 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "]"}], ",", 716 | RowBox[{"{", 717 | RowBox[{ 718 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "}"}]}], "]"}], "===", 719 | TagBox[ 720 | RowBox[{"(", "\[NoBreak]", GridBox[{ 721 | {"1", "0", "0", 722 | RowBox[{"-", "a"}]}, 723 | {"0", "1", "0", "0"}, 724 | {"0", "0", "1", "0"}, 725 | {"0", "0", "0", "1"} 726 | }, 727 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 728 | GridBoxSpacings->{"Columns" -> { 729 | Offset[0.27999999999999997`], { 730 | Offset[0.7]}, 731 | Offset[0.27999999999999997`]}, "Rows" -> { 732 | Offset[0.2], { 733 | Offset[0.4]}, 734 | Offset[0.2]}}], "\[NoBreak]", ")"}], 735 | Function[BoxForm`e$, 736 | MatrixForm[BoxForm`e$]]]}], "]"}], 737 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 738 | RowBox[{ 739 | RowBox[{"Assert", "[", 740 | RowBox[{ 741 | RowBox[{"GetArray", "[", 742 | RowBox[{ 743 | RowBox[{"metric", "[", 744 | RowBox[{"a", ",", "\[Mu]"}], "]"}], ",", 745 | RowBox[{"{", 746 | RowBox[{"a", ",", "\[Mu]"}], "}"}]}], "]"}], "===", 747 | TagBox[ 748 | RowBox[{"(", "\[NoBreak]", GridBox[{ 749 | {"1", "0", "0", "a"}, 750 | {"0", 751 | RowBox[{"-", "1"}], "0", "0"}, 752 | {"0", "0", 753 | RowBox[{"-", "1"}], "0"}, 754 | {"0", "0", "0", 755 | RowBox[{"-", "1"}]} 756 | }, 757 | GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}}, 758 | GridBoxSpacings->{"Columns" -> { 759 | Offset[0.27999999999999997`], { 760 | Offset[0.7]}, 761 | Offset[0.27999999999999997`]}, "Rows" -> { 762 | Offset[0.2], { 763 | Offset[0.4]}, 764 | Offset[0.2]}}], "\[NoBreak]", ")"}], 765 | Function[BoxForm`e$, 766 | MatrixForm[BoxForm`e$]]]}], "]"}], 767 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 768 | RowBox[{"Assert", "[", 769 | RowBox[{ 770 | RowBox[{"GetArray", "[", 771 | RowBox[{ 772 | RowBox[{"metric", "[", 773 | RowBox[{ 774 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "]"}], 775 | RowBox[{"metric", "[", 776 | RowBox[{ 777 | RowBox[{"-", "a"}], ",", "\[Nu]"}], "]"}]}], "]"}], "===", 778 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 779 | "]"}], "\[IndentingNewLine]", 780 | RowBox[{"Assert", "[", 781 | RowBox[{ 782 | RowBox[{"GetArray", "[", 783 | RowBox[{ 784 | RowBox[{"metric", "[", 785 | RowBox[{"a", ",", 786 | RowBox[{"-", "\[Mu]"}]}], "]"}], 787 | RowBox[{"metric", "[", 788 | RowBox[{ 789 | RowBox[{"-", "a"}], ",", "\[Nu]"}], "]"}]}], "]"}], "===", 790 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 791 | "]"}], "\[IndentingNewLine]", 792 | RowBox[{"Assert", "[", 793 | RowBox[{ 794 | RowBox[{"GetArray", "[", 795 | RowBox[{ 796 | RowBox[{"metric", "[", 797 | RowBox[{ 798 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "]"}], 799 | RowBox[{"metric", "[", 800 | RowBox[{"\[Nu]", ",", 801 | RowBox[{"-", "a"}]}], "]"}]}], "]"}], "===", 802 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], "]"}], "\[IndentingNewLine]", 803 | 804 | RowBox[{ 805 | RowBox[{"Assert", "[", 806 | RowBox[{ 807 | RowBox[{"GetArray", "[", 808 | RowBox[{ 809 | RowBox[{"metric", "[", 810 | RowBox[{"a", ",", 811 | RowBox[{"-", "\[Mu]"}]}], "]"}], 812 | RowBox[{"metric", "[", 813 | RowBox[{"\[Nu]", ",", 814 | RowBox[{"-", "a"}]}], "]"}]}], "]"}], "===", 815 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], "]"}], 816 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 817 | RowBox[{"Assert", "[", 818 | RowBox[{ 819 | RowBox[{"GetArray", "[", 820 | RowBox[{ 821 | RowBox[{"metric", "[", 822 | RowBox[{ 823 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "]"}], 824 | RowBox[{"metric", "[", 825 | RowBox[{ 826 | RowBox[{"-", "b"}], ",", "\[Mu]"}], "]"}]}], "]"}], "===", 827 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 828 | "]"}], "\[IndentingNewLine]", 829 | RowBox[{"Assert", "[", 830 | RowBox[{ 831 | RowBox[{"GetArray", "[", 832 | RowBox[{ 833 | RowBox[{"metric", "[", 834 | RowBox[{"a", ",", 835 | RowBox[{"-", "\[Mu]"}]}], "]"}], 836 | RowBox[{"metric", "[", 837 | RowBox[{ 838 | RowBox[{"-", "b"}], ",", "\[Mu]"}], "]"}]}], "]"}], "===", 839 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 840 | "]"}], "\[IndentingNewLine]", 841 | RowBox[{"Assert", "[", 842 | RowBox[{ 843 | RowBox[{"GetArray", "[", 844 | RowBox[{ 845 | RowBox[{"metric", "[", 846 | RowBox[{ 847 | RowBox[{"-", "\[Mu]"}], ",", "a"}], "]"}], 848 | RowBox[{"metric", "[", 849 | RowBox[{"\[Mu]", ",", 850 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 851 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], "]"}], "\[IndentingNewLine]", 852 | 853 | RowBox[{ 854 | RowBox[{"Assert", "[", 855 | RowBox[{ 856 | RowBox[{"GetArray", "[", 857 | RowBox[{ 858 | RowBox[{"metric", "[", 859 | RowBox[{"a", ",", 860 | RowBox[{"-", "\[Mu]"}]}], "]"}], 861 | RowBox[{"metric", "[", 862 | RowBox[{"\[Mu]", ",", 863 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 864 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], "]"}], 865 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 866 | RowBox[{"Assert", "[", 867 | RowBox[{ 868 | RowBox[{"GetArray", "[", 869 | RowBox[{ 870 | RowBox[{"metric", "[", 871 | RowBox[{ 872 | RowBox[{"-", "a"}], ",", 873 | RowBox[{"-", "\[Mu]"}]}], "]"}], 874 | RowBox[{"metric", "[", 875 | RowBox[{"\[Mu]", ",", 876 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 877 | RowBox[{"DiagonalMatrix", "[", 878 | RowBox[{"{", 879 | RowBox[{"1", ",", 880 | RowBox[{"-", "1"}], ",", 881 | RowBox[{"-", "1"}], ",", 882 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 883 | RowBox[{"Assert", "[", 884 | RowBox[{ 885 | RowBox[{"GetArray", "[", 886 | RowBox[{ 887 | RowBox[{"metric", "[", 888 | RowBox[{ 889 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "]"}], 890 | RowBox[{"metric", "[", 891 | RowBox[{ 892 | RowBox[{"-", "\[Mu]"}], ",", 893 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 894 | RowBox[{"DiagonalMatrix", "[", 895 | RowBox[{"{", 896 | RowBox[{"1", ",", 897 | RowBox[{"-", "1"}], ",", 898 | RowBox[{"-", "1"}], ",", 899 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 900 | RowBox[{"Assert", "[", 901 | RowBox[{ 902 | RowBox[{"GetArray", "[", 903 | RowBox[{ 904 | RowBox[{"metric", "[", 905 | RowBox[{ 906 | RowBox[{"-", "\[Mu]"}], ",", 907 | RowBox[{"-", "a"}]}], "]"}], 908 | RowBox[{"metric", "[", 909 | RowBox[{"\[Mu]", ",", 910 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 911 | RowBox[{"DiagonalMatrix", "[", 912 | RowBox[{"{", 913 | RowBox[{"1", ",", 914 | RowBox[{"-", "1"}], ",", 915 | RowBox[{"-", "1"}], ",", 916 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 917 | RowBox[{"Assert", "[", 918 | RowBox[{ 919 | RowBox[{"GetArray", "[", 920 | RowBox[{ 921 | RowBox[{"metric", "[", 922 | RowBox[{"\[Mu]", ",", 923 | RowBox[{"-", "a"}]}], "]"}], 924 | RowBox[{"metric", "[", 925 | RowBox[{ 926 | RowBox[{"-", "\[Mu]"}], ",", 927 | RowBox[{"-", "b"}]}], "]"}]}], "]"}], "===", 928 | RowBox[{"DiagonalMatrix", "[", 929 | RowBox[{"{", 930 | RowBox[{"1", ",", 931 | RowBox[{"-", "1"}], ",", 932 | RowBox[{"-", "1"}], ",", 933 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 934 | RowBox[{"Assert", "[", 935 | RowBox[{ 936 | RowBox[{"GetArray", "[", 937 | RowBox[{ 938 | RowBox[{"metric", "[", 939 | RowBox[{ 940 | RowBox[{"-", "a"}], ",", 941 | RowBox[{"-", "\[Mu]"}]}], "]"}], 942 | RowBox[{"metric", "[", 943 | RowBox[{ 944 | RowBox[{"-", "b"}], ",", "\[Mu]"}], "]"}]}], "]"}], "===", 945 | RowBox[{"DiagonalMatrix", "[", 946 | RowBox[{"{", 947 | RowBox[{"1", ",", 948 | RowBox[{"-", "1"}], ",", 949 | RowBox[{"-", "1"}], ",", 950 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 951 | RowBox[{"Assert", "[", 952 | RowBox[{ 953 | RowBox[{"GetArray", "[", 954 | RowBox[{ 955 | RowBox[{"metric", "[", 956 | RowBox[{ 957 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "]"}], 958 | RowBox[{"metric", "[", 959 | RowBox[{ 960 | RowBox[{"-", "b"}], ",", 961 | RowBox[{"-", "\[Mu]"}]}], "]"}]}], "]"}], "===", 962 | RowBox[{"DiagonalMatrix", "[", 963 | RowBox[{"{", 964 | RowBox[{"1", ",", 965 | RowBox[{"-", "1"}], ",", 966 | RowBox[{"-", "1"}], ",", 967 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 968 | RowBox[{"Assert", "[", 969 | RowBox[{ 970 | RowBox[{"GetArray", "[", 971 | RowBox[{ 972 | RowBox[{"metric", "[", 973 | RowBox[{ 974 | RowBox[{"-", "\[Mu]"}], ",", 975 | RowBox[{"-", "a"}]}], "]"}], 976 | RowBox[{"metric", "[", 977 | RowBox[{ 978 | RowBox[{"-", "b"}], ",", "\[Mu]"}], "]"}]}], "]"}], "===", 979 | RowBox[{"DiagonalMatrix", "[", 980 | RowBox[{"{", 981 | RowBox[{"1", ",", 982 | RowBox[{"-", "1"}], ",", 983 | RowBox[{"-", "1"}], ",", 984 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], "\[IndentingNewLine]", 985 | RowBox[{ 986 | RowBox[{"Assert", "[", 987 | RowBox[{ 988 | RowBox[{"GetArray", "[", 989 | RowBox[{ 990 | RowBox[{"metric", "[", 991 | RowBox[{"\[Mu]", ",", 992 | RowBox[{"-", "a"}]}], "]"}], 993 | RowBox[{"metric", "[", 994 | RowBox[{ 995 | RowBox[{"-", "b"}], ",", 996 | RowBox[{"-", "\[Mu]"}]}], "]"}]}], "]"}], "===", 997 | RowBox[{"DiagonalMatrix", "[", 998 | RowBox[{"{", 999 | RowBox[{"1", ",", 1000 | RowBox[{"-", "1"}], ",", 1001 | RowBox[{"-", "1"}], ",", 1002 | RowBox[{"-", "1"}]}], "}"}], "]"}]}], "]"}], 1003 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1004 | RowBox[{ 1005 | RowBox[{"Assert", "[", 1006 | RowBox[{ 1007 | RowBox[{ 1008 | RowBox[{"GetArray", "[", 1009 | RowBox[{ 1010 | RowBox[{"metric", "[", 1011 | RowBox[{"\[Mu]", ",", "\[Nu]"}], "]"}], 1012 | RowBox[{"metric", "[", 1013 | RowBox[{ 1014 | RowBox[{"-", "\[Nu]"}], ",", 1015 | RowBox[{"-", "\[Lambda]"}]}], "]"}]}], "]"}], "==", 1016 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], "//", "Simplify"}], "]"}], 1017 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1018 | RowBox[{"Assert", "[", 1019 | RowBox[{ 1020 | RowBox[{ 1021 | RowBox[{"GetArray", "[", 1022 | RowBox[{ 1023 | RowBox[{"metric", "[", 1024 | RowBox[{ 1025 | RowBox[{"-", "a"}], ",", 1026 | RowBox[{"-", "b"}]}], "]"}], 1027 | RowBox[{"s", "[", "b", "]"}]}], "]"}], "==", 1028 | RowBox[{"GetArray", "[", 1029 | RowBox[{"s", "[", 1030 | RowBox[{"-", "a"}], "]"}], "]"}]}], "//", "Simplify"}], 1031 | "]"}], "\[IndentingNewLine]", 1032 | RowBox[{"Assert", "[", 1033 | RowBox[{ 1034 | RowBox[{ 1035 | RowBox[{"GetArray", "[", 1036 | RowBox[{ 1037 | RowBox[{"metric", "[", 1038 | RowBox[{ 1039 | RowBox[{"-", "a"}], ",", "\[Mu]"}], "]"}], 1040 | RowBox[{"s", "[", "a", "]"}]}], "]"}], "==", 1041 | RowBox[{"GetArray", "[", 1042 | RowBox[{"s", "[", "\[Mu]", "]"}], "]"}]}], "//", "Simplify"}], 1043 | "]"}], "\[IndentingNewLine]", 1044 | RowBox[{"Assert", "[", 1045 | RowBox[{ 1046 | RowBox[{ 1047 | RowBox[{"GetArray", "[", 1048 | RowBox[{ 1049 | RowBox[{"metric", "[", 1050 | RowBox[{"b", ",", 1051 | RowBox[{"-", "\[Mu]"}]}], "]"}], 1052 | RowBox[{"metric", "[", 1053 | RowBox[{ 1054 | RowBox[{"-", "a"}], ",", 1055 | RowBox[{"-", "b"}]}], "]"}], 1056 | RowBox[{"s", "[", "a", "]"}]}], "]"}], "==", 1057 | RowBox[{"GetArray", "[", 1058 | RowBox[{"s", "[", 1059 | RowBox[{"-", "\[Mu]"}], "]"}], "]"}]}], "//", "Simplify"}], 1060 | "]"}], "\[IndentingNewLine]", 1061 | RowBox[{"Assert", "[", 1062 | RowBox[{ 1063 | RowBox[{ 1064 | RowBox[{"GetArray", "[", 1065 | RowBox[{ 1066 | RowBox[{"s", "[", "\[Mu]", "]"}], 1067 | RowBox[{"s", "[", 1068 | RowBox[{"-", "\[Mu]"}], "]"}]}], "]"}], "==", 1069 | RowBox[{"GetArray", "[", 1070 | RowBox[{ 1071 | RowBox[{"s", "[", "a", "]"}], 1072 | RowBox[{"s", "[", 1073 | RowBox[{"-", "a"}], "]"}]}], "]"}]}], "//", "Simplify"}], 1074 | "]"}], "\[IndentingNewLine]", 1075 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 1076 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 1077 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 1078 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 1079 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 1080 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 1081 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 1082 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 1083 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 1084 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 1085 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 1086 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 1087 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 1088 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 1089 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 1090 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 1091 | 3.807861411349864*^9}, 3.807863316125087*^9, {3.8078633664718637`*^9, 1092 | 3.807863378786847*^9}, {3.8345990366137238`*^9, 3.834599037478118*^9}, { 1093 | 3.834599067744738*^9, 3.8345990755879087`*^9}, {3.834599122166129*^9, 1094 | 3.834599149797717*^9}, {3.8347351817505827`*^9, 3.834735182253962*^9}, { 1095 | 3.834739318973908*^9, 3.8347393317046556`*^9}, {3.834739367316915*^9, 1096 | 3.834739375862414*^9}, {3.8347394422030573`*^9, 3.8347394959957857`*^9}, { 1097 | 3.8354402402214327`*^9, 3.835440246162114*^9}, {3.835440312918202*^9, 1098 | 3.835440340548016*^9}, {3.835442107021994*^9, 3.8354421365354443`*^9}, { 1099 | 3.83544285210262*^9, 3.8354428795302687`*^9}, {3.835443013391247*^9, 1100 | 3.8354430472799883`*^9}, {3.835443222265045*^9, 3.835443243124209*^9}}, 1101 | CellLabel->"In[94]:=",ExpressionUUID->"8e4a1888-8019-4dbb-b5f7-1ec05ace894f"] 1102 | }, Open ]], 1103 | 1104 | Cell[CellGroupData[{ 1105 | 1106 | Cell["Tests of GetArray and matrix operations", "Section", 1107 | CellChangeTimes->{{3.807863172971298*^9, 3.8078632539345217`*^9}, { 1108 | 3.8347312786545753`*^9, 1109 | 3.834731282523183*^9}},ExpressionUUID->"686a734b-0d9c-4412-8127-\ 1110 | c8d639363858"], 1111 | 1112 | Cell[BoxData[{ 1113 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 1114 | RowBox[{"Assert", "[", 1115 | RowBox[{ 1116 | RowBox[{"GetArray", "[", 1117 | RowBox[{"m", "[", 1118 | RowBox[{"a", ",", "b"}], "]"}], "]"}], "===", 1119 | RowBox[{"GetArray", "[", 1120 | RowBox[{"m", "[", 1121 | RowBox[{"c", ",", "d"}], "]"}], "]"}]}], "]"}], "\[IndentingNewLine]", 1122 | RowBox[{"Assert", "[", 1123 | RowBox[{ 1124 | RowBox[{"GetArray", "[", 1125 | RowBox[{ 1126 | RowBox[{"m", "[", 1127 | RowBox[{"b", ",", "a"}], "]"}], ",", 1128 | RowBox[{"{", 1129 | RowBox[{"b", ",", "a"}], "}"}]}], "]"}], "===", 1130 | RowBox[{"GetArray", "[", 1131 | RowBox[{"m", "[", 1132 | RowBox[{"a", ",", "b"}], "]"}], "]"}]}], "]"}], "\[IndentingNewLine]", 1133 | RowBox[{ 1134 | RowBox[{"Assert", "[", 1135 | RowBox[{ 1136 | RowBox[{"GetArray", "[", 1137 | RowBox[{"m", "[", 1138 | RowBox[{"b", ",", "a"}], "]"}], "]"}], "===", 1139 | RowBox[{"Transpose", "@", 1140 | RowBox[{"GetArray", "[", 1141 | RowBox[{"m", "[", 1142 | RowBox[{"a", ",", "b"}], "]"}], "]"}]}]}], "]"}], 1143 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1144 | RowBox[{"Assert", "[", 1145 | RowBox[{ 1146 | RowBox[{"GetArray", "[", 1147 | RowBox[{"2", "+", 1148 | RowBox[{"5", "*", "8"}]}], "]"}], "===", "42"}], 1149 | "]"}], "\[IndentingNewLine]", 1150 | RowBox[{"Assert", "[", 1151 | RowBox[{ 1152 | RowBox[{"2", "\[CirclePlus]", 1153 | RowBox[{"5", "*", "8"}]}], "===", "42"}], "]"}], "\[IndentingNewLine]", 1154 | RowBox[{"Assert", "[", 1155 | RowBox[{ 1156 | RowBox[{"GetArray", "[", 1157 | RowBox[{ 1158 | RowBox[{"s", "[", "a", "]"}], "+", 1159 | RowBox[{"T", "[", "a", "]"}]}], "]"}], "===", 1160 | RowBox[{"{", 1161 | RowBox[{ 1162 | RowBox[{"s0", "+", "T0"}], ",", 1163 | RowBox[{"s1", "+", "T1"}], ",", 1164 | RowBox[{"s2", "+", "T2"}], ",", 1165 | RowBox[{"s3", "+", "T3"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 1166 | RowBox[{"Assert", "[", 1167 | RowBox[{ 1168 | RowBox[{"GetArray", "[", 1169 | RowBox[{ 1170 | RowBox[{"s", "[", "a", "]"}], "\[CirclePlus]", 1171 | RowBox[{"T", "[", "a", "]"}]}], "]"}], "===", 1172 | RowBox[{"{", 1173 | RowBox[{ 1174 | RowBox[{"s0", "+", "T0"}], ",", 1175 | RowBox[{"s1", "+", "T1"}], ",", 1176 | RowBox[{"s2", "+", "T2"}], ",", 1177 | RowBox[{"s3", "+", "T3"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 1178 | RowBox[{"Assert", "[", 1179 | RowBox[{ 1180 | RowBox[{"GetArray", "[", 1181 | RowBox[{ 1182 | RowBox[{"s", "[", "a", "]"}], "+", 1183 | RowBox[{"\[ImaginaryI]", " ", 1184 | RowBox[{"T", "[", "a", "]"}]}]}], "]"}], "===", 1185 | RowBox[{"{", 1186 | RowBox[{ 1187 | RowBox[{"s0", "+", 1188 | RowBox[{"\[ImaginaryI]", " ", "T0"}]}], ",", 1189 | RowBox[{"s1", "+", 1190 | RowBox[{"\[ImaginaryI]", " ", "T1"}]}], ",", 1191 | RowBox[{"s2", "+", 1192 | RowBox[{"\[ImaginaryI]", " ", "T2"}]}], ",", 1193 | RowBox[{"s3", "+", 1194 | RowBox[{"\[ImaginaryI]", " ", "T3"}]}]}], "}"}]}], 1195 | "]"}], "\[IndentingNewLine]", 1196 | RowBox[{ 1197 | RowBox[{"Assert", "[", 1198 | RowBox[{ 1199 | RowBox[{"GetArray", "[", 1200 | RowBox[{ 1201 | RowBox[{ 1202 | RowBox[{"s", "[", 1203 | RowBox[{"-", "a"}], "]"}], 1204 | RowBox[{"\[Sigma]", "[", "a", "]"}]}], "\[CirclePlus]", 1205 | RowBox[{"IdentityMatrix", "[", "2", "]"}]}], "]"}], "===", 1206 | RowBox[{"(", GridBox[{ 1207 | { 1208 | RowBox[{"s0", "-", "s3", "+", "1"}], 1209 | RowBox[{ 1210 | RowBox[{"-", "s1"}], "+", 1211 | RowBox[{"\[ImaginaryI]", " ", "s2"}]}]}, 1212 | { 1213 | RowBox[{ 1214 | RowBox[{"-", "s1"}], "-", 1215 | RowBox[{"\[ImaginaryI]", " ", "s2"}]}], 1216 | RowBox[{"s0", "+", "s3", "+", "1"}]} 1217 | }], ")"}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1218 | RowBox[{"Assert", "[", 1219 | RowBox[{ 1220 | RowBox[{"GetArray", "[", 1221 | RowBox[{ 1222 | RowBox[{"s", "[", 1223 | RowBox[{"-", "a"}], "]"}], 1224 | RowBox[{"s", "[", "a", "]"}]}], "]"}], "===", 1225 | RowBox[{ 1226 | SuperscriptBox["s0", "2"], "-", 1227 | SuperscriptBox["s1", "2"], "-", 1228 | SuperscriptBox["s2", "2"], "-", 1229 | SuperscriptBox["s3", "2"]}]}], "]"}], "\[IndentingNewLine]", 1230 | RowBox[{"Assert", "[", 1231 | RowBox[{ 1232 | RowBox[{"GetArray", "[", 1233 | RowBox[{ 1234 | RowBox[{"s", "[", 1235 | RowBox[{"-", "a"}], "]"}], 1236 | RowBox[{"T", "[", "a", "]"}]}], "]"}], "===", 1237 | RowBox[{ 1238 | RowBox[{"s0", " ", "T0"}], "-", 1239 | RowBox[{"s1", " ", "T1"}], "-", 1240 | RowBox[{"s2", " ", "T2"}], "-", 1241 | RowBox[{"s3", " ", "T3"}]}]}], "]"}], "\[IndentingNewLine]", 1242 | RowBox[{"Assert", "[", 1243 | RowBox[{ 1244 | RowBox[{"GetArray", "[", 1245 | RowBox[{ 1246 | RowBox[{"s", "[", 1247 | RowBox[{"-", "a"}], "]"}], 1248 | RowBox[{"\[Sigma]", "[", "a", "]"}]}], "]"}], "===", 1249 | RowBox[{"(", GridBox[{ 1250 | { 1251 | RowBox[{"s0", "-", "s3"}], 1252 | RowBox[{ 1253 | RowBox[{"-", "s1"}], "+", 1254 | RowBox[{"\[ImaginaryI]", " ", "s2"}]}]}, 1255 | { 1256 | RowBox[{ 1257 | RowBox[{"-", "s1"}], "-", 1258 | RowBox[{"\[ImaginaryI]", " ", "s2"}]}], 1259 | RowBox[{"s0", "+", "s3"}]} 1260 | }], ")"}]}], "]"}], "\[IndentingNewLine]", 1261 | RowBox[{ 1262 | RowBox[{"Assert", "[", 1263 | RowBox[{ 1264 | RowBox[{"GetArray", "[", 1265 | RowBox[{ 1266 | RowBox[{"\[Sigma]", "[", 1267 | RowBox[{"-", "a"}], "]"}], ".", 1268 | RowBox[{"\[Sigma]", "[", "a", "]"}]}], "]"}], "===", 1269 | RowBox[{"(", GridBox[{ 1270 | { 1271 | RowBox[{"-", "2"}], "0"}, 1272 | {"0", 1273 | RowBox[{"-", "2"}]} 1274 | }], ")"}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1275 | RowBox[{"Assert", "[", 1276 | RowBox[{ 1277 | RowBox[{"GetArray", "[", 1278 | RowBox[{"Tr", "[", 1279 | RowBox[{ 1280 | RowBox[{"s", "[", 1281 | RowBox[{"-", "a"}], "]"}], 1282 | RowBox[{"\[Sigma]", "[", "a", "]"}]}], "]"}], "]"}], "===", 1283 | RowBox[{"2", "s0"}]}], "]"}], "\[IndentingNewLine]", 1284 | RowBox[{"Assert", "[", 1285 | RowBox[{ 1286 | RowBox[{"GetArray", "[", 1287 | RowBox[{ 1288 | RowBox[{"\[Eth]", "[", 1289 | RowBox[{"-", "\[Mu]"}], "]"}], "[", "t", "]"}], "]"}], "===", 1290 | RowBox[{"{", 1291 | RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}]}], 1292 | "]"}], "\[IndentingNewLine]", 1293 | RowBox[{"Assert", "[", 1294 | RowBox[{ 1295 | RowBox[{"GetArray", "[", 1296 | RowBox[{ 1297 | RowBox[{"\[Eth]", "[", "a", "]"}], "[", "s3", "]"}], "]"}], "===", 1298 | RowBox[{"{", 1299 | RowBox[{"0", ",", "0", ",", "0", ",", 1300 | RowBox[{"-", "1"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 1301 | RowBox[{"Assert", "[", 1302 | RowBox[{ 1303 | RowBox[{"GetArray", "[", 1304 | RowBox[{ 1305 | RowBox[{"\[Eth]", "[", "\[Mu]", "]"}], "[", "s3", "]"}], "]"}], "===", 1306 | RowBox[{"{", 1307 | RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], 1308 | "]"}], "\[IndentingNewLine]", 1309 | RowBox[{"Assert", "[", 1310 | RowBox[{ 1311 | RowBox[{"GetArray", "[", 1312 | RowBox[{ 1313 | RowBox[{"\[Eth]Lorentz", "[", "\[Mu]", "]"}], "[", "s3", "]"}], "]"}], "===", 1314 | RowBox[{"{", 1315 | RowBox[{"0", ",", "0", ",", "0", ",", 1316 | RowBox[{"-", "1"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 1317 | RowBox[{ 1318 | RowBox[{"Assert", "[", 1319 | RowBox[{ 1320 | RowBox[{"GetArray", "[", 1321 | RowBox[{ 1322 | RowBox[{"\[Eth]", "[", 1323 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1324 | RowBox[{"{", 1325 | RowBox[{"t", ",", "x"}], "}"}], "]"}], "]"}], "===", 1326 | RowBox[{"{", 1327 | RowBox[{ 1328 | RowBox[{"{", 1329 | RowBox[{"1", ",", "0"}], "}"}], ",", 1330 | RowBox[{"{", 1331 | RowBox[{"0", ",", "1"}], "}"}], ",", 1332 | RowBox[{"{", 1333 | RowBox[{"0", ",", "0"}], "}"}], ",", 1334 | RowBox[{"{", 1335 | RowBox[{"0", ",", "0"}], "}"}]}], "}"}]}], "]"}], 1336 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1337 | RowBox[{"Assert", "[", 1338 | RowBox[{ 1339 | RowBox[{"GetArray", "[", 1340 | RowBox[{ 1341 | RowBox[{"\[Eth]", "[", 1342 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1343 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}], "]"}], "===", "4"}], 1344 | "]"}], "\[IndentingNewLine]", 1345 | RowBox[{"Assert", "[", 1346 | RowBox[{ 1347 | RowBox[{"GetArray", "[", 1348 | RowBox[{ 1349 | RowBox[{"\[Eth]", "[", 1350 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1351 | RowBox[{"crd", "[", "\[Nu]", "]"}], "]"}], "]"}], "===", 1352 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 1353 | "]"}], "\[IndentingNewLine]", 1354 | RowBox[{"Assert", "[", 1355 | RowBox[{ 1356 | RowBox[{ 1357 | RowBox[{"GetArray", "[", 1358 | RowBox[{ 1359 | RowBox[{"\[Eth]", "[", 1360 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1361 | RowBox[{ 1362 | RowBox[{"crd", "[", "\[Nu]", "]"}], 1363 | RowBox[{"crd", "[", 1364 | RowBox[{"-", "\[Nu]"}], "]"}]}], "]"}], "]"}], "==", 1365 | RowBox[{"GetArray", "[", 1366 | RowBox[{"2", 1367 | RowBox[{"crd", "[", 1368 | RowBox[{"-", "\[Mu]"}], "]"}]}], "]"}]}], "//", "Simplify"}], 1369 | "]"}], "\[IndentingNewLine]", 1370 | RowBox[{"Assert", "[", 1371 | RowBox[{ 1372 | RowBox[{"GetArray", "[", 1373 | RowBox[{ 1374 | RowBox[{"p", "[", "\[Nu]", "]"}], 1375 | RowBox[{ 1376 | RowBox[{"\[Eth]", "[", 1377 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1378 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}]}], "]"}], "===", 1379 | RowBox[{"GetArray", "[", 1380 | RowBox[{ 1381 | RowBox[{"\[Eth]", "[", 1382 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1383 | RowBox[{ 1384 | RowBox[{"p", "[", "\[Nu]", "]"}], 1385 | RowBox[{"crd", "[", "\[Mu]", "]"}]}], "]"}], "]"}]}], 1386 | "]"}], "\[IndentingNewLine]", 1387 | RowBox[{ 1388 | RowBox[{"Assert", "[", 1389 | RowBox[{ 1390 | RowBox[{"GetArray", "[", 1391 | RowBox[{ 1392 | RowBox[{"p", "[", "\[Nu]", "]"}], 1393 | RowBox[{ 1394 | RowBox[{"\[Eth]", "[", 1395 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1396 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}]}], "]"}], "===", 1397 | RowBox[{"GetArray", "[", 1398 | RowBox[{ 1399 | RowBox[{"p", "[", "\[Mu]", "]"}], 1400 | RowBox[{ 1401 | RowBox[{"\[Eth]", "[", 1402 | RowBox[{"-", "\[Mu]"}], "]"}], "[", 1403 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}]}], "]"}]}], "]"}], 1404 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1405 | RowBox[{"Assert", "[", 1406 | RowBox[{ 1407 | RowBox[{"GetArray", "[", 1408 | RowBox[{"basis", "[", "\[Mu]", "]"}], "]"}], "===", 1409 | RowBox[{"{", 1410 | RowBox[{"dt", ",", "dx", ",", "dy", ",", "dz"}], "}"}]}], 1411 | "]"}], "\[IndentingNewLine]", 1412 | RowBox[{"Assert", "[", 1413 | RowBox[{ 1414 | RowBox[{"GetArray", "[", 1415 | RowBox[{"basis", "[", 1416 | RowBox[{"-", "\[Nu]"}], "]"}], "]"}], "===", 1417 | RowBox[{"{", 1418 | RowBox[{"\[Eth]t", ",", "\[Eth]x", ",", "\[Eth]y", ",", "\[Eth]z"}], 1419 | "}"}]}], "]"}], "\[IndentingNewLine]", 1420 | RowBox[{"Assert", "[", 1421 | RowBox[{ 1422 | RowBox[{"GetArray", "[", 1423 | RowBox[{ 1424 | RowBox[{"p", "[", "\[Mu]", "]"}], 1425 | RowBox[{"basis", "[", 1426 | RowBox[{"-", "\[Mu]"}], "]"}]}], "]"}], "===", 1427 | RowBox[{ 1428 | RowBox[{"p0", " ", "\[Eth]t"}], "+", 1429 | RowBox[{"p1", " ", "\[Eth]x"}], "+", 1430 | RowBox[{"p2", " ", "\[Eth]y"}], "+", 1431 | RowBox[{"p3", " ", "\[Eth]z"}]}]}], "]"}], "\[IndentingNewLine]", 1432 | RowBox[{"Assert", "[", 1433 | RowBox[{ 1434 | RowBox[{"GetArray", "[", 1435 | RowBox[{ 1436 | RowBox[{"s", "[", 1437 | RowBox[{"-", "a"}], "]"}], 1438 | RowBox[{"basis", "[", "a", "]"}]}], "]"}], "===", 1439 | RowBox[{ 1440 | RowBox[{"s0", " ", "ds0"}], "-", 1441 | RowBox[{"s1", " ", "ds1"}], "-", 1442 | RowBox[{"s2", " ", "ds2"}], "-", 1443 | RowBox[{"s3", " ", "ds3"}]}]}], "]"}], "\[IndentingNewLine]", 1444 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 1445 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 1446 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 1447 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 1448 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 1449 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 1450 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 1451 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 1452 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 1453 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 1454 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 1455 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 1456 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 1457 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 1458 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 1459 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 1460 | 3.807861411349864*^9}, {3.807863322745809*^9, 3.807863324699108*^9}, { 1461 | 3.8078633717872877`*^9, 3.807863380478299*^9}, {3.8078635081911182`*^9, 1462 | 3.8078635686375017`*^9}, {3.807863792460644*^9, 3.807863831836978*^9}, { 1463 | 3.807863866618134*^9, 3.807863896515491*^9}, {3.8078639271252203`*^9, 1464 | 3.80786398818477*^9}, {3.8078640203297873`*^9, 3.807864020989401*^9}, { 1465 | 3.834735293952471*^9, 3.83473550288118*^9}, {3.8347356001787567`*^9, 1466 | 3.834735841591673*^9}, {3.834735912275783*^9, 3.834735939626031*^9}, { 1467 | 3.834735974194274*^9, 3.834736003580613*^9}, {3.834736388847249*^9, 1468 | 3.834736542997323*^9}, {3.834736589321327*^9, 3.83473660057544*^9}, { 1469 | 3.8347369309010363`*^9, 3.8347369385848837`*^9}, {3.8347369709036703`*^9, 1470 | 3.834737009071884*^9}, {3.834737044789217*^9, 3.8347371085459747`*^9}, { 1471 | 3.83473735019734*^9, 3.8347374072839603`*^9}, 3.834737781440679*^9, { 1472 | 3.834737834957636*^9, 3.8347378682591*^9}, {3.8347379330415707`*^9, 1473 | 3.834737970205638*^9}, {3.834738001133408*^9, 3.8347380091434393`*^9}, { 1474 | 3.834738053986218*^9, 3.834738068241111*^9}, {3.834738196259383*^9, 1475 | 3.834738344387575*^9}, 3.834738413087002*^9, {3.834738462482868*^9, 1476 | 3.834738487058433*^9}, {3.834739503708926*^9, 3.8347395266810083`*^9}, { 1477 | 3.835437369592677*^9, 3.835437397361429*^9}, {3.835437607250634*^9, 1478 | 3.835437622787112*^9}, {3.835437732419158*^9, 3.835437732670176*^9}, { 1479 | 3.83543786496902*^9, 3.835437951493277*^9}, {3.8354379920093946`*^9, 1480 | 3.835438024829446*^9}, {3.835438431257435*^9, 3.835438437000216*^9}, { 1481 | 3.835438632414735*^9, 3.83543864353354*^9}, {3.835438701621277*^9, 1482 | 3.8354387266775103`*^9}, {3.83544323026786*^9, 3.835443236998212*^9}, { 1483 | 3.8354459488202963`*^9, 3.83544599864165*^9}, {3.83551654074128*^9, 1484 | 3.835516542836351*^9}, {3.835516598974188*^9, 3.83551660408358*^9}, { 1485 | 3.8355167227954893`*^9, 3.8355167361074743`*^9}, {3.835516790560527*^9, 1486 | 3.835516814793442*^9}, {3.83551687760802*^9, 3.835516934295483*^9}}, 1487 | CellLabel-> 1488 | "In[126]:=",ExpressionUUID->"da86ea05-defb-4c08-836a-f3a1f97bf8dc"] 1489 | }, Open ]], 1490 | 1491 | Cell[CellGroupData[{ 1492 | 1493 | Cell["Tests of DirectProduct and WedgeProduct", "Section", 1494 | CellChangeTimes->{{3.807863172971298*^9, 3.8078632539345217`*^9}, { 1495 | 3.807874853720084*^9, 1496 | 3.8078748606373873`*^9}},ExpressionUUID->"7557a460-6b7f-4b61-971f-\ 1497 | a48c2fcac3fd"], 1498 | 1499 | Cell[BoxData[{ 1500 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 1501 | RowBox[{"Assert", "[", 1502 | RowBox[{ 1503 | RowBox[{"DirectProduct", "[", "dx", "]"}], "===", "dx"}], 1504 | "]"}], "\[IndentingNewLine]", 1505 | RowBox[{"Assert", "[", 1506 | RowBox[{ 1507 | RowBox[{"DirectProduct", "[", 1508 | RowBox[{"dx", ",", 1509 | RowBox[{"dy", "\[CircleTimes]", "dz"}], ",", "dt"}], "]"}], "===", 1510 | RowBox[{ 1511 | "dx", "\[CircleTimes]", "dy", "\[CircleTimes]", "dz", "\[CircleTimes]", 1512 | "dt"}]}], "]"}], "\[IndentingNewLine]", 1513 | RowBox[{"Assert", "[", 1514 | RowBox[{ 1515 | RowBox[{"DirectProduct", "[", 1516 | RowBox[{"dx", ",", 1517 | RowBox[{"dy", "+", "dz"}], ",", "dt"}], "]"}], "===", 1518 | RowBox[{ 1519 | RowBox[{"dx", "\[CircleTimes]", "dy", "\[CircleTimes]", "dt"}], "+", 1520 | RowBox[{"dx", "\[CircleTimes]", "dz", "\[CircleTimes]", "dt"}]}]}], 1521 | "]"}], "\[IndentingNewLine]", 1522 | RowBox[{"Assert", "[", 1523 | RowBox[{ 1524 | RowBox[{"dy", "\[CircleTimes]", "dx"}], "===", 1525 | RowBox[{"Unevaluated", "@", 1526 | RowBox[{"DirectProduct", "[", 1527 | RowBox[{"dy", ",", "dx"}], "]"}]}]}], "]"}], "\[IndentingNewLine]", 1528 | RowBox[{"Assert", "[", 1529 | RowBox[{ 1530 | RowBox[{"\[Eth]y", "\[CircleTimes]", "\[Eth]x"}], "===", 1531 | RowBox[{"Unevaluated", "@", 1532 | RowBox[{"DirectProduct", "[", 1533 | RowBox[{"\[Eth]y", ",", "\[Eth]x"}], "]"}]}]}], 1534 | "]"}], "\[IndentingNewLine]", 1535 | RowBox[{"Assert", "[", 1536 | RowBox[{ 1537 | RowBox[{"\[Eth]x", "\[CircleTimes]", "dx"}], "===", 1538 | RowBox[{"Unevaluated", "@", 1539 | RowBox[{"DirectProduct", "[", 1540 | RowBox[{"\[Eth]x", ",", "dx"}], "]"}]}]}], 1541 | "]"}], "\[IndentingNewLine]", 1542 | RowBox[{"Assert", "[", 1543 | RowBox[{ 1544 | RowBox[{ 1545 | RowBox[{"basis", "[", "\[Nu]", "]"}], "\[CircleTimes]", 1546 | RowBox[{"basis", "[", "\[Mu]", "]"}]}], "===", 1547 | RowBox[{"Unevaluated", "@", 1548 | RowBox[{"DirectProduct", "[", 1549 | RowBox[{ 1550 | RowBox[{"basis", "[", "\[Nu]", "]"}], ",", 1551 | RowBox[{"basis", "[", "\[Mu]", "]"}]}], "]"}]}]}], 1552 | "]"}], "\[IndentingNewLine]", 1553 | RowBox[{"Assert", "[", 1554 | RowBox[{ 1555 | RowBox[{"dx", "\[CircleTimes]", 1556 | RowBox[{"basis", "[", "\[Mu]", "]"}]}], "===", 1557 | RowBox[{"Unevaluated", "@", 1558 | RowBox[{"DirectProduct", "[", 1559 | RowBox[{"dx", ",", 1560 | RowBox[{"basis", "[", "\[Mu]", "]"}]}], "]"}]}]}], 1561 | "]"}], "\[IndentingNewLine]", 1562 | RowBox[{ 1563 | RowBox[{"Assert", "[", 1564 | RowBox[{ 1565 | RowBox[{ 1566 | RowBox[{"basis", "[", "\[Mu]", "]"}], "\[CircleTimes]", "dx"}], "===", 1567 | RowBox[{"Unevaluated", "@", 1568 | RowBox[{"DirectProduct", "[", 1569 | RowBox[{ 1570 | RowBox[{"basis", "[", "\[Mu]", "]"}], ",", "dx"}], "]"}]}]}], "]"}], 1571 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1572 | RowBox[{"Assert", "[", 1573 | RowBox[{ 1574 | RowBox[{"WedgeProduct", "[", "dx", "]"}], "===", "dx"}], 1575 | "]"}], "\[IndentingNewLine]", 1576 | RowBox[{"Assert", "[", 1577 | RowBox[{ 1578 | RowBox[{"WedgeProduct", "[", 1579 | RowBox[{"dt", ",", 1580 | RowBox[{"dx", "\[Wedge]", "dy"}], ",", "dz"}], "]"}], "===", 1581 | RowBox[{"dt", "\[Wedge]", "dx", "\[Wedge]", "dy", "\[Wedge]", "dz"}]}], 1582 | "]"}], "\[IndentingNewLine]", 1583 | RowBox[{"Assert", "[", 1584 | RowBox[{ 1585 | RowBox[{"WedgeProduct", "[", 1586 | RowBox[{"dt", ",", 1587 | RowBox[{"dx", "+", "dy"}], ",", "dz"}], "]"}], "===", 1588 | RowBox[{ 1589 | RowBox[{"dt", "\[Wedge]", "dx", "\[Wedge]", "dz"}], "+", 1590 | RowBox[{"dt", "\[Wedge]", "dy", "\[Wedge]", "dz"}]}]}], 1591 | "]"}], "\[IndentingNewLine]", 1592 | RowBox[{"Assert", "[", 1593 | RowBox[{ 1594 | RowBox[{"WedgeProduct", "[", 1595 | RowBox[{"dt", ",", 1596 | RowBox[{"dx", "+", "dy"}], ",", "dz"}], "]"}], "===", 1597 | RowBox[{ 1598 | RowBox[{"dt", "\[Wedge]", "dx", "\[Wedge]", "dz"}], "+", 1599 | RowBox[{"dt", "\[Wedge]", "dy", "\[Wedge]", "dz"}]}]}], 1600 | "]"}], "\[IndentingNewLine]", 1601 | RowBox[{"Assert", "[", 1602 | RowBox[{ 1603 | RowBox[{"dy", "\[Wedge]", "dx"}], "===", 1604 | RowBox[{"Unevaluated", "@", 1605 | RowBox[{"-", 1606 | RowBox[{"WedgeProduct", "[", 1607 | RowBox[{"dx", ",", "dy"}], "]"}]}]}]}], "]"}], "\[IndentingNewLine]", 1608 | RowBox[{"Assert", "[", 1609 | RowBox[{ 1610 | RowBox[{"dz", "\[Wedge]", "dx", "\[Wedge]", "dz"}], "===", "0"}], 1611 | "]"}], "\[IndentingNewLine]", 1612 | RowBox[{"Assert", "[", 1613 | RowBox[{ 1614 | RowBox[{"dz", "\[Wedge]", "\[Eth]y", "\[Wedge]", "dx"}], "===", 1615 | RowBox[{"Unevaluated", "@", 1616 | RowBox[{"WedgeProduct", "[", 1617 | RowBox[{"dz", ",", "\[Eth]y", ",", "dx"}], "]"}]}]}], 1618 | "]"}], "\[IndentingNewLine]", 1619 | RowBox[{ 1620 | RowBox[{"Assert", "[", 1621 | RowBox[{ 1622 | RowBox[{"dx", "\[Wedge]", "\[Eth]y", "\[Wedge]", "dx"}], "===", 1623 | RowBox[{"Unevaluated", "@", 1624 | RowBox[{"WedgeProduct", "[", 1625 | RowBox[{"dx", ",", "\[Eth]y", ",", "dx"}], "]"}]}]}], "]"}], 1626 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1627 | RowBox[{"Assert", "[", 1628 | RowBox[{ 1629 | RowBox[{"GetArray", "[", 1630 | RowBox[{ 1631 | RowBox[{"basis", "[", "\[Mu]", "]"}], "\[CircleTimes]", 1632 | RowBox[{"basis", "[", 1633 | RowBox[{"-", "\[Mu]"}], "]"}]}], "]"}], "===", 1634 | RowBox[{ 1635 | RowBox[{"dt", "\[CircleTimes]", "\[Eth]t"}], "+", 1636 | RowBox[{"dx", "\[CircleTimes]", "\[Eth]x"}], "+", 1637 | RowBox[{"dy", "\[CircleTimes]", "\[Eth]y"}], "+", 1638 | RowBox[{"dz", "\[CircleTimes]", "\[Eth]z"}]}]}], 1639 | "]"}], "\[IndentingNewLine]", 1640 | RowBox[{"Assert", "[", 1641 | RowBox[{ 1642 | RowBox[{"GetArray", "[", 1643 | RowBox[{ 1644 | RowBox[{"p", "[", 1645 | RowBox[{"-", "\[Mu]"}], "]"}], 1646 | RowBox[{"p", "[", 1647 | RowBox[{"-", "\[Nu]"}], "]"}], 1648 | RowBox[{ 1649 | RowBox[{"basis", "[", "\[Mu]", "]"}], "\[Wedge]", 1650 | RowBox[{"basis", "[", "\[Nu]", "]"}]}]}], "]"}], "===", "0"}], 1651 | "]"}], "\[IndentingNewLine]", 1652 | RowBox[{"Assert", "[", 1653 | RowBox[{ 1654 | RowBox[{"GetArray", "[", 1655 | RowBox[{ 1656 | RowBox[{"\[Epsilon]", "[", 1657 | RowBox[{ 1658 | RowBox[{"-", "a"}], ",", 1659 | RowBox[{"-", "b"}], ",", 1660 | RowBox[{"-", "c"}], ",", 1661 | RowBox[{"-", "d"}]}], "]"}], 1662 | RowBox[{ 1663 | RowBox[{"basis", "[", "a", "]"}], "\[Wedge]", 1664 | RowBox[{"basis", "[", "b", "]"}], "\[Wedge]", 1665 | RowBox[{"basis", "[", "c", "]"}], "\[Wedge]", 1666 | RowBox[{"basis", "[", "d", "]"}]}]}], "]"}], "===", 1667 | RowBox[{ 1668 | RowBox[{"-", "24"}], 1669 | RowBox[{ 1670 | "ds0", "\[Wedge]", "ds1", "\[Wedge]", "ds2", "\[Wedge]", "ds3"}]}]}], 1671 | "]"}], "\[IndentingNewLine]", 1672 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 1673 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 1674 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 1675 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 1676 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 1677 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 1678 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 1679 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 1680 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 1681 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 1682 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 1683 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 1684 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 1685 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 1686 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 1687 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 1688 | 3.807861411349864*^9}, {3.807863322745809*^9, 3.807863324699108*^9}, { 1689 | 3.8078633717872877`*^9, 3.807863380478299*^9}, {3.8078635081911182`*^9, 1690 | 3.8078635686375017`*^9}, {3.807863792460644*^9, 3.807863831836978*^9}, { 1691 | 3.807863866618134*^9, 3.807863896515491*^9}, {3.8078639271252203`*^9, 1692 | 3.80786398818477*^9}, {3.8078640203297873`*^9, 3.807864020989401*^9}, { 1693 | 3.807874868610263*^9, 3.807874965903171*^9}, {3.8078750123669987`*^9, 1694 | 3.807875040907687*^9}, {3.80787540515784*^9, 3.80787540539783*^9}, { 1695 | 3.807876111356189*^9, 3.807876375942917*^9}, {3.807876494916844*^9, 1696 | 3.8078766416323442`*^9}, 3.807878270695189*^9, {3.807878324247703*^9, 1697 | 3.807878370227016*^9}, {3.807878431331604*^9, 3.807878558386895*^9}, { 1698 | 3.807878806330503*^9, 3.80787881510326*^9}, {3.8347392989166517`*^9, 1699 | 3.834739302879018*^9}, {3.834739551684966*^9, 3.8347396851798077`*^9}, { 1700 | 3.8347397509516907`*^9, 3.834739755985937*^9}, {3.834739823065791*^9, 1701 | 3.834739830836795*^9}, {3.834739931978402*^9, 3.8347399552236757`*^9}, { 1702 | 3.834741131997821*^9, 3.8347411485446167`*^9}, {3.8347413043748913`*^9, 1703 | 3.834741306381926*^9}, {3.8353278905464153`*^9, 3.835327894379821*^9}, { 1704 | 3.835327933390708*^9, 3.835327933735939*^9}, {3.8353279804352217`*^9, 1705 | 3.835328020643738*^9}, {3.83532808615336*^9, 3.835328134888533*^9}, { 1706 | 3.8353283522053957`*^9, 3.8353286433114023`*^9}, {3.8353288051354723`*^9, 1707 | 3.835328821849702*^9}, {3.8353289082421923`*^9, 3.835328939862261*^9}, { 1708 | 3.835329072564279*^9, 3.8353290852255573`*^9}, {3.835329445882324*^9, 1709 | 3.835329476446398*^9}, {3.835440694007071*^9, 3.8354406975490294`*^9}, { 1710 | 3.835445994819833*^9, 3.835445995200158*^9}, {3.844225688672626*^9, 1711 | 3.844225739628072*^9}, {3.844225797557274*^9, 3.8442258398792057`*^9}, { 1712 | 3.8442258746414557`*^9, 3.844226039974093*^9}, {3.844226077342195*^9, 1713 | 3.8442260924667463`*^9}, {3.8442261531702023`*^9, 3.844226213130816*^9}}, 1714 | CellLabel-> 1715 | "In[156]:=",ExpressionUUID->"63325ac0-60aa-4621-8297-0c8389aee498"] 1716 | }, Open ]], 1717 | 1718 | Cell[CellGroupData[{ 1719 | 1720 | Cell["Tests of ExteriorDerivative", "Section", 1721 | CellChangeTimes->{{3.807863172971298*^9, 3.8078632539345217`*^9}, { 1722 | 3.807863357179035*^9, 1723 | 3.807863361605198*^9}},ExpressionUUID->"aa44a200-2e76-4969-bbef-\ 1724 | f4e654019788"], 1725 | 1726 | Cell[BoxData[{ 1727 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 1728 | RowBox[{"Assert", "[", 1729 | RowBox[{ 1730 | RowBox[{ 1731 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", "dx", 1732 | "]"}], "===", "0"}], "]"}], "\[IndentingNewLine]", 1733 | RowBox[{"Assert", "[", 1734 | RowBox[{ 1735 | RowBox[{ 1736 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1737 | RowBox[{"x", " ", "dx"}], "]"}], "===", "0"}], 1738 | "]"}], "\[IndentingNewLine]", 1739 | RowBox[{"Assert", "[", 1740 | RowBox[{ 1741 | RowBox[{ 1742 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1743 | RowBox[{"y", " ", "dx"}], "]"}], "===", 1744 | RowBox[{"dy", "\[Wedge]", "dx"}]}], "]"}], "\[IndentingNewLine]", 1745 | RowBox[{"Assert", "[", 1746 | RowBox[{ 1747 | RowBox[{ 1748 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1749 | RowBox[{ 1750 | RowBox[{"28", "y", " ", "dx"}], "+", 1751 | RowBox[{"42", "z", " ", "dt"}]}], "]"}], "===", 1752 | RowBox[{ 1753 | RowBox[{"28", 1754 | RowBox[{"dy", "\[Wedge]", "dx"}]}], "+", 1755 | RowBox[{"42", 1756 | RowBox[{"dz", "\[Wedge]", "dt"}]}]}]}], "]"}], "\[IndentingNewLine]", 1757 | RowBox[{"Assert", "[", 1758 | RowBox[{ 1759 | RowBox[{ 1760 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1761 | RowBox[{"28", 1762 | RowBox[{"(", 1763 | RowBox[{ 1764 | RowBox[{"y", " ", "dx"}], "+", 1765 | RowBox[{"z", " ", "dt"}]}], ")"}]}], "]"}], "===", 1766 | RowBox[{ 1767 | RowBox[{"28", 1768 | RowBox[{"dy", "\[Wedge]", "dx"}]}], "+", 1769 | RowBox[{"28", 1770 | RowBox[{"dz", "\[Wedge]", "dt"}]}]}]}], "]"}], "\[IndentingNewLine]", 1771 | RowBox[{"Assert", "[", 1772 | RowBox[{ 1773 | RowBox[{ 1774 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1775 | RowBox[{"f", "[", 1776 | RowBox[{"x", ",", "y"}], "]"}], "]"}], "===", 1777 | RowBox[{ 1778 | RowBox[{ 1779 | RowBox[{ 1780 | SuperscriptBox["f", 1781 | TagBox[ 1782 | RowBox[{"(", 1783 | RowBox[{"1", ",", "0"}], ")"}], 1784 | Derivative], 1785 | MultilineFunction->None], "[", 1786 | RowBox[{"x", ",", "y"}], "]"}], "dx"}], "+", 1787 | RowBox[{ 1788 | RowBox[{ 1789 | SuperscriptBox["f", 1790 | TagBox[ 1791 | RowBox[{"(", 1792 | RowBox[{"0", ",", "1"}], ")"}], 1793 | Derivative], 1794 | MultilineFunction->None], "[", 1795 | RowBox[{"x", ",", "y"}], "]"}], "dy"}]}]}], 1796 | "]"}], "\[IndentingNewLine]", 1797 | RowBox[{"Assert", "[", 1798 | RowBox[{ 1799 | RowBox[{ 1800 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1801 | RowBox[{"z", " ", 1802 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", 1803 | RowBox[{"dz", "\[Wedge]", "dx", "\[Wedge]", "dy"}]}], 1804 | "]"}], "\[IndentingNewLine]", 1805 | RowBox[{"Assert", "[", 1806 | RowBox[{ 1807 | RowBox[{ 1808 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], "[", 1809 | RowBox[{"z", " ", 1810 | RowBox[{"dx", "\[CircleTimes]", "dy"}]}], "]"}], "===", 1811 | RowBox[{"dz", "\[Wedge]", 1812 | RowBox[{"(", 1813 | RowBox[{"dx", "\[CircleTimes]", "dy"}], ")"}]}]}], 1814 | "]"}], "\[IndentingNewLine]", 1815 | RowBox[{ 1816 | RowBox[{"Assert", "[", 1817 | RowBox[{ 1818 | RowBox[{"Nest", "[", 1819 | RowBox[{ 1820 | RowBox[{"ExteriorDerivative", "[", "\"\\"", "]"}], ",", 1821 | RowBox[{"f", "[", 1822 | RowBox[{"t", ",", "x", ",", "y", ",", "z"}], "]"}], ",", "2"}], "]"}], 1823 | "===", "0"}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1824 | RowBox[{"Assert", "[", 1825 | RowBox[{ 1826 | RowBox[{ 1827 | RowBox[{"ExteriorDerivative", "[", 1828 | RowBox[{"\"\\"", ",", "\"\\""}], "]"}], "[", 1829 | RowBox[{"f", "[", 1830 | RowBox[{"x", ",", "\[Lambda]"}], "]"}], "]"}], "===", 1831 | RowBox[{ 1832 | RowBox[{ 1833 | RowBox[{ 1834 | SuperscriptBox["f", 1835 | TagBox[ 1836 | RowBox[{"(", 1837 | RowBox[{"1", ",", "0"}], ")"}], 1838 | Derivative], 1839 | MultilineFunction->None], "[", 1840 | RowBox[{"x", ",", "\[Lambda]"}], "]"}], "dx"}], "+", 1841 | RowBox[{ 1842 | RowBox[{ 1843 | SuperscriptBox["f", 1844 | TagBox[ 1845 | RowBox[{"(", 1846 | RowBox[{"0", ",", "1"}], ")"}], 1847 | Derivative], 1848 | MultilineFunction->None], "[", 1849 | RowBox[{"x", ",", "\[Lambda]"}], "]"}], "d\[Lambda]"}]}]}], 1850 | "]"}], "\[IndentingNewLine]", 1851 | RowBox[{"Assert", "[", 1852 | RowBox[{ 1853 | RowBox[{ 1854 | RowBox[{"ExteriorDerivative", "[", "]"}], "[", 1855 | RowBox[{"\[Lambda]", " ", "dx"}], "]"}], "===", 1856 | RowBox[{"d\[Lambda]", "\[Wedge]", "dx"}]}], "]"}], "\[IndentingNewLine]", 1857 | RowBox[{"Assert", "[", 1858 | RowBox[{ 1859 | RowBox[{ 1860 | RowBox[{"ExteriorDerivative", "[", "]"}], "[", 1861 | RowBox[{"f", "[", 1862 | RowBox[{"x", ",", "\[Lambda]", ",", "s0"}], "]"}], "]"}], "===", 1863 | RowBox[{ 1864 | RowBox[{ 1865 | RowBox[{ 1866 | SuperscriptBox["f", 1867 | TagBox[ 1868 | RowBox[{"(", 1869 | RowBox[{"1", ",", "0", ",", "0"}], ")"}], 1870 | Derivative], 1871 | MultilineFunction->None], "[", 1872 | RowBox[{"x", ",", "\[Lambda]", ",", "s0"}], "]"}], "dx"}], "+", 1873 | RowBox[{ 1874 | RowBox[{ 1875 | SuperscriptBox["f", 1876 | TagBox[ 1877 | RowBox[{"(", 1878 | RowBox[{"0", ",", "1", ",", "0"}], ")"}], 1879 | Derivative], 1880 | MultilineFunction->None], "[", 1881 | RowBox[{"x", ",", "\[Lambda]", ",", "s0"}], "]"}], "d\[Lambda]"}], "+", 1882 | 1883 | RowBox[{ 1884 | RowBox[{ 1885 | SuperscriptBox["f", 1886 | TagBox[ 1887 | RowBox[{"(", 1888 | RowBox[{"0", ",", "0", ",", "1"}], ")"}], 1889 | Derivative], 1890 | MultilineFunction->None], "[", 1891 | RowBox[{"x", ",", "\[Lambda]", ",", "s0"}], "]"}], "ds0"}]}]}], 1892 | "]"}], "\[IndentingNewLine]", 1893 | RowBox[{ 1894 | RowBox[{"Assert", "[", 1895 | RowBox[{ 1896 | RowBox[{ 1897 | RowBox[{"ExteriorDerivative", "[", "]"}], "[", 1898 | RowBox[{"\[Lambda]", " ", "dx"}], "]"}], "===", 1899 | RowBox[{"d\[Lambda]", "\[Wedge]", "dx"}]}], "]"}], 1900 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 1901 | RowBox[{"Assert", "[", 1902 | RowBox[{ 1903 | RowBox[{"GetArray", "@", 1904 | RowBox[{ 1905 | RowBox[{"ExteriorDerivative", "[", "]"}], "[", 1906 | RowBox[{"crd", "[", "\[Mu]", "]"}], "]"}]}], "===", 1907 | RowBox[{"{", 1908 | RowBox[{"dt", ",", "dx", ",", "dy", ",", "dz"}], "}"}]}], 1909 | "]"}], "\[IndentingNewLine]", 1910 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 1911 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 1912 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 1913 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 1914 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 1915 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 1916 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 1917 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 1918 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 1919 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 1920 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 1921 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 1922 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 1923 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 1924 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 1925 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 1926 | 3.807861411349864*^9}, {3.807863322745809*^9, 3.807863324699108*^9}, { 1927 | 3.807863384075686*^9, 3.8078633847997837`*^9}, {3.8353441574702272`*^9, 1928 | 3.8353442011527348`*^9}, {3.835344235886341*^9, 3.8353442565649567`*^9}, { 1929 | 3.8353442896013412`*^9, 3.835344445489543*^9}, {3.835344482040037*^9, 1930 | 3.835344635243104*^9}, {3.835344762326725*^9, 3.835344782661544*^9}, { 1931 | 3.835345110541958*^9, 3.8353451234191628`*^9}, 3.835345181708467*^9, { 1932 | 3.8354459018814793`*^9, 3.835445937163924*^9}, {3.836104604164331*^9, 1933 | 3.836104628838133*^9}}, 1934 | CellLabel-> 1935 | "In[178]:=",ExpressionUUID->"b4fbe79f-ef21-44e8-b59c-22874d288aa1"] 1936 | }, Open ]], 1937 | 1938 | Cell[CellGroupData[{ 1939 | 1940 | Cell["Tests of InteriorProduct", "Section", 1941 | CellChangeTimes->{{3.807863172971298*^9, 3.8078632539345217`*^9}, { 1942 | 3.807874853720084*^9, 3.8078748606373873`*^9}, {3.835362747772208*^9, 1943 | 3.83536275091625*^9}},ExpressionUUID->"7fe17cf9-2e06-4528-bff6-\ 1944 | 29b20878eaff"], 1945 | 1946 | Cell[BoxData[{ 1947 | RowBox[{"On", "[", "Assert", "]"}], "\[IndentingNewLine]", 1948 | RowBox[{"Assert", "[", 1949 | RowBox[{ 1950 | RowBox[{"InteriorProduct", "[", 1951 | RowBox[{"a", ",", "dx"}], "]"}], "===", 1952 | RowBox[{"a", " ", "dx"}]}], "]"}], "\[IndentingNewLine]", 1953 | RowBox[{"Assert", "[", 1954 | RowBox[{ 1955 | RowBox[{"InteriorProduct", "[", 1956 | RowBox[{"dx", ",", "\[Eth]x"}], "]"}], "===", "1"}], 1957 | "]"}], "\[IndentingNewLine]", 1958 | RowBox[{"Assert", "[", 1959 | RowBox[{ 1960 | RowBox[{"InteriorProduct", "[", 1961 | RowBox[{"\[Eth]x", ",", "dx"}], "]"}], "===", "1"}], 1962 | "]"}], "\[IndentingNewLine]", 1963 | RowBox[{"Assert", "[", 1964 | RowBox[{ 1965 | RowBox[{"InteriorProduct", "[", 1966 | RowBox[{"dx", ",", "\[Eth]y"}], "]"}], "===", "0"}], 1967 | "]"}], "\[IndentingNewLine]", 1968 | RowBox[{"Assert", "[", 1969 | RowBox[{ 1970 | RowBox[{"InteriorProduct", "[", 1971 | RowBox[{"dx", ",", "\[Eth]\[Lambda]"}], "]"}], "===", "0"}], 1972 | "]"}], "\[IndentingNewLine]", 1973 | RowBox[{"Assert", "[", 1974 | RowBox[{"MatchQ", "[", 1975 | RowBox[{ 1976 | RowBox[{"InteriorProduct", "[", 1977 | RowBox[{"dx", ",", "dx"}], "]"}], ",", 1978 | RowBox[{"HoldPattern", "@", 1979 | RowBox[{"InteriorProduct", "[", 1980 | RowBox[{"dx", ",", "dx"}], "]"}]}]}], "]"}], 1981 | "]"}], "\[IndentingNewLine]", 1982 | RowBox[{"Assert", "[", 1983 | RowBox[{ 1984 | RowBox[{"InteriorProduct", "[", 1985 | RowBox[{ 1986 | RowBox[{ 1987 | RowBox[{"a", " ", "dx"}], "+", 1988 | RowBox[{"b", " ", "dy"}]}], ",", 1989 | RowBox[{ 1990 | RowBox[{"c", " ", "\[Eth]x"}], "+", 1991 | RowBox[{"d", " ", "\[Eth]y"}]}]}], "]"}], "===", 1992 | RowBox[{ 1993 | RowBox[{"a", " ", "c"}], "+", 1994 | RowBox[{"b", " ", "d"}]}]}], "]"}], "\[IndentingNewLine]", 1995 | RowBox[{ 1996 | RowBox[{"Assert", "[", 1997 | RowBox[{ 1998 | RowBox[{"InteriorProduct", "[", 1999 | RowBox[{ 2000 | RowBox[{"42", 2001 | RowBox[{"(", " ", 2002 | RowBox[{"dx", "+", "dy"}], ")"}]}], ",", "\[Eth]x"}], "]"}], "===", 2003 | "42"}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 2004 | RowBox[{"Assert", "[", 2005 | RowBox[{ 2006 | RowBox[{"InteriorProduct", "[", 2007 | RowBox[{"\[Eth]x", ",", 2008 | RowBox[{"dx", "\[CircleTimes]", "dy"}]}], "]"}], "===", "dy"}], 2009 | "]"}], "\[IndentingNewLine]", 2010 | RowBox[{"Assert", "[", 2011 | RowBox[{ 2012 | RowBox[{"InteriorProduct", "[", 2013 | RowBox[{"\[Eth]x", ",", 2014 | RowBox[{"dy", "\[CircleTimes]", "dx"}]}], "]"}], "===", "0"}], 2015 | "]"}], "\[IndentingNewLine]", 2016 | RowBox[{"Assert", "[", 2017 | RowBox[{ 2018 | RowBox[{"InteriorProduct", "[", 2019 | RowBox[{ 2020 | RowBox[{"dx", "\[CircleTimes]", "dy"}], ",", "\[Eth]x"}], "]"}], "===", 2021 | "dy"}], "]"}], "\[IndentingNewLine]", 2022 | RowBox[{"Assert", "[", 2023 | RowBox[{ 2024 | RowBox[{"InteriorProduct", "[", 2025 | RowBox[{ 2026 | RowBox[{"\[Eth]x", "\[CircleTimes]", "\[Eth]y"}], ",", "dx"}], "]"}], "===", 2027 | "\[Eth]y"}], "]"}], "\[IndentingNewLine]", 2028 | RowBox[{ 2029 | RowBox[{"Assert", "[", 2030 | RowBox[{ 2031 | RowBox[{"InteriorProduct", "[", 2032 | RowBox[{ 2033 | RowBox[{"\[Eth]x", "\[CircleTimes]", "\[Eth]y"}], ",", 2034 | RowBox[{"dx", "\[CircleTimes]", "dy"}]}], "]"}], "===", "1"}], "]"}], 2035 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 2036 | RowBox[{"Assert", "[", 2037 | RowBox[{ 2038 | RowBox[{"InteriorProduct", "[", 2039 | RowBox[{"\[Eth]x", ",", 2040 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", "dy"}], 2041 | "]"}], "\[IndentingNewLine]", 2042 | RowBox[{"Assert", "[", 2043 | RowBox[{ 2044 | RowBox[{"InteriorProduct", "[", 2045 | RowBox[{"\[Eth]y", ",", 2046 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", 2047 | RowBox[{"-", "dx"}]}], "]"}], "\[IndentingNewLine]", 2048 | RowBox[{"Assert", "[", 2049 | RowBox[{ 2050 | RowBox[{"InteriorProduct", "[", 2051 | RowBox[{"\[Eth]z", ",", 2052 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", "0"}], 2053 | "]"}], "\[IndentingNewLine]", 2054 | RowBox[{"Assert", "[", 2055 | RowBox[{ 2056 | RowBox[{"InteriorProduct", "[", 2057 | RowBox[{"\[Eth]y", ",", 2058 | RowBox[{"dx", "\[Wedge]", "dy", "\[Wedge]", "dz"}]}], "]"}], "===", 2059 | RowBox[{ 2060 | RowBox[{"-", "dx"}], "\[Wedge]", "dz"}]}], "]"}], "\[IndentingNewLine]", 2061 | RowBox[{ 2062 | RowBox[{"Assert", "[", 2063 | RowBox[{ 2064 | RowBox[{"InteriorProduct", "[", 2065 | RowBox[{"\[Eth]z", ",", 2066 | RowBox[{"dx", "\[Wedge]", "dy", "\[Wedge]", "dz"}]}], "]"}], "===", 2067 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], 2068 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 2069 | RowBox[{"Assert", "[", 2070 | RowBox[{ 2071 | RowBox[{"InteriorProduct", "[", 2072 | RowBox[{ 2073 | RowBox[{"\[Eth]x", "\[CircleTimes]", "\[Eth]y"}], ",", 2074 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", "1"}], 2075 | "]"}], "\[IndentingNewLine]", 2076 | RowBox[{"Assert", "[", 2077 | RowBox[{ 2078 | RowBox[{"InteriorProduct", "[", 2079 | RowBox[{ 2080 | RowBox[{"\[Eth]y", "\[CircleTimes]", "\[Eth]x"}], ",", 2081 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", 2082 | RowBox[{"-", "1"}]}], "]"}], "\[IndentingNewLine]", 2083 | RowBox[{"Assert", "[", 2084 | RowBox[{ 2085 | RowBox[{"InteriorProduct", "[", 2086 | RowBox[{ 2087 | RowBox[{"\[Eth]y", "\[CircleTimes]", "\[Eth]x"}], ",", 2088 | RowBox[{"dx", "\[Wedge]", "dy"}]}], "]"}], "===", 2089 | RowBox[{"-", "1"}]}], "]"}], "\[IndentingNewLine]", 2090 | RowBox[{"Assert", "[", 2091 | RowBox[{ 2092 | RowBox[{"InteriorProduct", "[", 2093 | RowBox[{"\[Eth]x", ",", 2094 | RowBox[{ 2095 | RowBox[{"dx", "\[Wedge]", "dy"}], "\[CircleTimes]", "dz"}]}], "]"}], "===", 2096 | RowBox[{"dy", "\[CircleTimes]", "dz"}]}], "]"}], "\[IndentingNewLine]", 2097 | RowBox[{ 2098 | RowBox[{"Assert", "[", 2099 | RowBox[{ 2100 | RowBox[{"InteriorProduct", "[", 2101 | RowBox[{ 2102 | RowBox[{ 2103 | "\[Eth]y", "\[CircleTimes]", "\[Eth]x", "\[CircleTimes]", "\[Eth]z"}], 2104 | ",", 2105 | RowBox[{ 2106 | RowBox[{"dx", "\[Wedge]", "dy"}], "\[CircleTimes]", "dz"}]}], "]"}], "===", 2107 | RowBox[{"-", "1"}]}], "]"}], 2108 | "\[IndentingNewLine]"}], "\[IndentingNewLine]", 2109 | RowBox[{"Assert", "[", 2110 | RowBox[{ 2111 | RowBox[{"GetArray", "[", 2112 | RowBox[{"InteriorProduct", "[", 2113 | RowBox[{ 2114 | RowBox[{"basis", "[", 2115 | RowBox[{"-", "a"}], "]"}], ",", 2116 | RowBox[{"basis", "[", "b", "]"}]}], "]"}], "]"}], "===", 2117 | RowBox[{"IdentityMatrix", "[", "4", "]"}]}], 2118 | "]"}], "\[IndentingNewLine]", 2119 | RowBox[{"Assert", "[", 2120 | RowBox[{ 2121 | RowBox[{"GetArray", "[", 2122 | RowBox[{"InteriorProduct", "[", 2123 | RowBox[{ 2124 | RowBox[{"basis", "[", 2125 | RowBox[{"-", "a"}], "]"}], ",", 2126 | RowBox[{"basis", "[", "a", "]"}]}], "]"}], "]"}], "===", "4"}], 2127 | "]"}], "\[IndentingNewLine]", 2128 | RowBox[{"Assert", "[", 2129 | RowBox[{ 2130 | RowBox[{"GetArray", "[", 2131 | RowBox[{"InteriorProduct", "[", 2132 | RowBox[{ 2133 | RowBox[{"basis", "[", 2134 | RowBox[{"-", "a"}], "]"}], ",", 2135 | RowBox[{ 2136 | RowBox[{"basis", "[", "a", "]"}], "\[Wedge]", 2137 | RowBox[{"basis", "[", "b", "]"}]}]}], "]"}], "]"}], "===", 2138 | RowBox[{"3", 2139 | RowBox[{"GetArray", "[", 2140 | RowBox[{"basis", "[", "b", "]"}], "]"}]}]}], 2141 | "]"}], "\[IndentingNewLine]", 2142 | RowBox[{"Assert", "[", 2143 | RowBox[{ 2144 | RowBox[{"GetArray", "[", 2145 | RowBox[{"InteriorProduct", "[", 2146 | RowBox[{ 2147 | RowBox[{ 2148 | RowBox[{"s", "[", "a", "]"}], 2149 | RowBox[{"basis", "[", 2150 | RowBox[{"-", "a"}], "]"}]}], ",", 2151 | RowBox[{ 2152 | RowBox[{"T", "[", 2153 | RowBox[{"-", "b"}], "]"}], 2154 | RowBox[{"basis", "[", "b", "]"}]}]}], "]"}], "]"}], "===", 2155 | RowBox[{"GetArray", "[", 2156 | RowBox[{ 2157 | RowBox[{"s", "[", "a", "]"}], 2158 | RowBox[{"T", "[", 2159 | RowBox[{"-", "a"}], "]"}]}], "]"}]}], "]"}], "\[IndentingNewLine]", 2160 | RowBox[{"Off", "[", "Assert", "]"}]}], "Input", 2161 | CellChangeTimes->{{3.8060672944567537`*^9, 3.8060673277027807`*^9}, { 2162 | 3.8060673636512947`*^9, 3.806067376671853*^9}, {3.806067425084051*^9, 2163 | 3.806067442020536*^9}, {3.8060690879250727`*^9, 3.806069199781932*^9}, { 2164 | 3.806069258592132*^9, 3.8060692984262323`*^9}, {3.806069828610973*^9, 2165 | 3.806069839145651*^9}, {3.8060698774396877`*^9, 3.806069896095023*^9}, { 2166 | 3.806069939184375*^9, 3.8060699940099382`*^9}, {3.80607002597836*^9, 2167 | 3.806070046244899*^9}, {3.806070138270679*^9, 3.8060701659404984`*^9}, { 2168 | 3.806070213258851*^9, 3.806070243512038*^9}, {3.806070337842065*^9, 2169 | 3.806070422589768*^9}, {3.8060704587430363`*^9, 3.806070550699338*^9}, { 2170 | 3.8060827828280277`*^9, 3.806082798503413*^9}, {3.8060829045007877`*^9, 2171 | 3.806082933295081*^9}, 3.80608433194433*^9, {3.8060843688733797`*^9, 2172 | 3.8060843803381853`*^9}, {3.806086086492738*^9, 3.806086251848518*^9}, { 2173 | 3.806092925572728*^9, 3.806092931089246*^9}, {3.806093000231883*^9, 2174 | 3.80609317607897*^9}, {3.806093228438509*^9, 3.806093272635148*^9}, { 2175 | 3.806210913605846*^9, 3.806211036733309*^9}, {3.807861409927079*^9, 2176 | 3.807861411349864*^9}, {3.807863322745809*^9, 3.807863324699108*^9}, { 2177 | 3.8078633717872877`*^9, 3.807863380478299*^9}, {3.8078635081911182`*^9, 2178 | 3.8078635686375017`*^9}, {3.807863792460644*^9, 3.807863831836978*^9}, { 2179 | 3.807863866618134*^9, 3.807863896515491*^9}, {3.8078639271252203`*^9, 2180 | 3.80786398818477*^9}, {3.8078640203297873`*^9, 3.807864020989401*^9}, { 2181 | 3.807874868610263*^9, 3.807874965903171*^9}, {3.8078750123669987`*^9, 2182 | 3.807875040907687*^9}, {3.80787540515784*^9, 3.80787540539783*^9}, { 2183 | 3.807876111356189*^9, 3.807876375942917*^9}, {3.807876494916844*^9, 2184 | 3.8078766416323442`*^9}, 3.807878270695189*^9, {3.807878324247703*^9, 2185 | 3.807878370227016*^9}, {3.807878431331604*^9, 3.807878558386895*^9}, { 2186 | 3.807878806330503*^9, 3.80787881510326*^9}, {3.8347392989166517`*^9, 2187 | 3.834739302879018*^9}, {3.834739551684966*^9, 3.8347396851798077`*^9}, { 2188 | 3.8347397509516907`*^9, 3.834739755985937*^9}, {3.834739823065791*^9, 2189 | 3.834739830836795*^9}, {3.834739931978402*^9, 3.8347399552236757`*^9}, { 2190 | 3.834741131997821*^9, 3.8347411485446167`*^9}, {3.8347413043748913`*^9, 2191 | 3.834741306381926*^9}, {3.8353278905464153`*^9, 3.835327894379821*^9}, { 2192 | 3.835327933390708*^9, 3.835327933735939*^9}, {3.8353279804352217`*^9, 2193 | 3.835328020643738*^9}, {3.83532808615336*^9, 3.835328134888533*^9}, { 2194 | 3.8353283522053957`*^9, 3.8353286433114023`*^9}, {3.8353288051354723`*^9, 2195 | 3.835328821849702*^9}, {3.8353289082421923`*^9, 3.835328939862261*^9}, { 2196 | 3.835329072564279*^9, 3.8353290852255573`*^9}, {3.835329445882324*^9, 2197 | 3.835329476446398*^9}, {3.835362772188714*^9, 3.8353627986321917`*^9}, { 2198 | 3.83536296236093*^9, 3.83536306887788*^9}, {3.8353631875454197`*^9, 2199 | 3.835363227002483*^9}, {3.835371085083083*^9, 3.835371175038568*^9}, { 2200 | 3.835371321945704*^9, 3.835371330472622*^9}, {3.8353771857970343`*^9, 2201 | 3.835377275218246*^9}, {3.835377412682673*^9, 3.835377432212057*^9}, { 2202 | 3.835377702473981*^9, 3.8353777790336933`*^9}, {3.835435553231861*^9, 2203 | 3.835435767994791*^9}, {3.8354358050773907`*^9, 3.835435809841099*^9}, { 2204 | 3.8354363338323174`*^9, 3.835436377741825*^9}, {3.835436784607698*^9, 2205 | 3.835436792055615*^9}, {3.8354459515307293`*^9, 3.835445951946619*^9}, { 2206 | 3.836104790029099*^9, 3.836104814075494*^9}, {3.844244571683298*^9, 2207 | 3.844244580420329*^9}}, 2208 | CellLabel-> 2209 | "In[194]:=",ExpressionUUID->"6140e06b-bb06-4a2d-9fd1-a6d5e08c2227"] 2210 | }, Open ]] 2211 | }, Open ]] 2212 | }, 2213 | WindowSize->{1920, 1062}, 2214 | WindowMargins->{{0, Automatic}, {-2, Automatic}}, 2215 | FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)", 2216 | StyleDefinitions->"Dark.nb" 2217 | ] 2218 | (* End of Notebook Content *) 2219 | 2220 | (* Internal cache information *) 2221 | (*CellTagsOutline 2222 | CellTagsIndex->{} 2223 | *) 2224 | (*CellTagsIndex 2225 | CellTagsIndex->{} 2226 | *) 2227 | (*NotebookFileOutline 2228 | Notebook[{ 2229 | Cell[558, 20, 15681, 317, 756, "Input",ExpressionUUID->"c666a26b-ac47-4501-b7af-5a50f45ff1ef"], 2230 | Cell[CellGroupData[{ 2231 | Cell[16264, 341, 150, 3, 70, "Chapter",ExpressionUUID->"83fd7a4b-70f7-4a1c-93f5-8ec4c19f6475"], 2232 | Cell[CellGroupData[{ 2233 | Cell[16439, 348, 217, 4, 68, "Section",ExpressionUUID->"ca166e74-3fad-4bb9-8752-e4838a31451b"], 2234 | Cell[16659, 354, 5316, 115, 349, "Input",ExpressionUUID->"e462386a-5886-4e68-80f6-85f32eaa5240"] 2235 | }, Open ]], 2236 | Cell[CellGroupData[{ 2237 | Cell[22012, 474, 257, 4, 68, "Section",ExpressionUUID->"34d4a51f-4707-4b7c-b1da-1c162edfec9c"], 2238 | Cell[22272, 480, 4296, 89, 195, "Input",ExpressionUUID->"33fb5d39-0b48-47c5-b1b0-fc3feb297f45"] 2239 | }, Open ]], 2240 | Cell[CellGroupData[{ 2241 | Cell[26605, 574, 182, 3, 68, "Section",ExpressionUUID->"8aef9d2f-d384-4cfd-a8d9-2b26f93aaf0a"], 2242 | Cell[26790, 579, 17426, 521, 1213, "Input",ExpressionUUID->"8e4a1888-8019-4dbb-b5f7-1ec05ace894f"] 2243 | }, Open ]], 2244 | Cell[CellGroupData[{ 2245 | Cell[44253, 1105, 237, 4, 68, "Section",ExpressionUUID->"686a734b-0d9c-4412-8127-c8d639363858"], 2246 | Cell[44493, 1111, 13893, 376, 870, "Input",ExpressionUUID->"da86ea05-defb-4c08-836a-f3a1f97bf8dc"] 2247 | }, Open ]], 2248 | Cell[CellGroupData[{ 2249 | Cell[58423, 1492, 237, 4, 68, "Section",ExpressionUUID->"7557a460-6b7f-4b61-971f-a48c2fcac3fd"], 2250 | Cell[58663, 1498, 9301, 216, 561, "Input",ExpressionUUID->"63325ac0-60aa-4621-8297-0c8389aee498"] 2251 | }, Open ]], 2252 | Cell[CellGroupData[{ 2253 | Cell[68001, 1719, 223, 4, 68, "Section",ExpressionUUID->"aa44a200-2e76-4969-bbef-f4e654019788"], 2254 | Cell[68227, 1725, 7715, 209, 447, "Input",ExpressionUUID->"b4fbe79f-ef21-44e8-b59c-22874d288aa1"] 2255 | }, Open ]], 2256 | Cell[CellGroupData[{ 2257 | Cell[75979, 1939, 267, 4, 68, "Section",ExpressionUUID->"7fe17cf9-2e06-4528-bff6-29b20878eaff"], 2258 | Cell[76249, 1945, 10819, 263, 768, "Input",ExpressionUUID->"6140e06b-bb06-4a2d-9fd1-a6d5e08c2227"] 2259 | }, Open ]] 2260 | }, Open ]] 2261 | } 2262 | ] 2263 | *) 2264 | 2265 | --------------------------------------------------------------------------------