{VERSION 4 0 "IBM INTEL LINUX22" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 1659 "I'm writing up some samp le problems here in the hopes that they can act as something of a \"wa lking tour\" of the relativistically relevant corners of Maple. I won 't do anything fancy, all we really need to do is convert our usual fo rmulas into algorithms for the computer to follow, giving us back the \+ necessary results in multivalent arrays. When you get down to it, the se algorithms will really only require a lot of partial derivatives an d sums over dummy indices, within a framework of multi-index arrays. \+ Once you know how to pack things into arrays, take partial derivatives , and compute sums, you know essentially all there is to know about do ing simple tensorial manipulations in Maple. So, in my view, there re ally is no need for the \"tensor\" package, or the \"GRTensor\" packag e (or the \"mathtensor\" package in Mathematica). Some people, I'm su re, will disagree with me here, but I think the only benefit of these \+ packages is that they allow one to spend less time thinking about thin gs like sign conventions (this is as much a drawback as it is a benifi t), and that they keep track of whether each index of your various arr ays is meant to be written upstairs or downstairs (you'd think that th is would be very nice, but the \"index_character\" notation of Maple's tensor package is clunky enough that I prefer to do without it). Not e that I make no claim that the methods I use below are particularly e fficient, only that they work. None of the methods below are set in s tone, and you should feel free to find and employ whatever methods wor k best for you. I tend to change my approach to a few things with jus t about every new calculation I do." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 196 "So I wil l start with some computations related to the de Sitter spacetime. Th is is an extremely simple cosmological solution with a great deal of s ymmetry, no matter, but a cosmological constant." }{MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 332 "We start by defining our coordinates. We construct a 1-index array, \+ where the index ranges from 1 to 4. As a relativist, I'm personally t empted to take index ranges from 0 to 3. This would be okay, but for \+ some reason Maple only likes to think about 2-index arrays as matrices if the indexing is from 1 to n. You get used to it." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "x := array(1..4):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "x[1]:=t: x[2]:=chi: x[3]:=th eta: x[4]:=phi:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 162 "chi is sort o f like a 'reduced' a radial coordinate. This is common in cosmology, \+ and you can read about it in any GR book which mentions cosmological s olutions." }}{PARA 0 "" 0 "" {TEXT -1 349 "\nIf you're unfamiliar with Maple, you should note that the symbol \":=\" is used for definitions , and each command is followed with a colon or semicolon. If it's a s emicolon, the command is executed and an output, if any, is spit back \+ out to the screen. If you just want the computer to execute your comm and and be quiet about it, you use the colon." }{MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "Now, we enter the metric. That is , an array with the down-index components of the metric:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "g:=array(1..4, 1..4):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 228 "We start by setting all components to zero, then we change those that shouldn't be zero. We set all components to zero i n two nested \"for\" loops. Note the quirky notation for these loops, \"for _ from _ to _ do _______ end do;\"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 236 "for mu from 1 to 4 do \nfor nu from 1 to 4 do\ng[mu, nu]:=0\nend do\nend do;\ng[1,1] := -1:\ng[2,2] := a[0]^2*exp(2*sqrt(La mbda/3)*t):\ng[3,3] := chi^2*a[0]^2*exp(2*sqrt(Lambda/3)*t):\ng[4,4] : = chi^2*sin(theta)^2*a[0]^2*exp(2*sqrt(Lambda/3)*t):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "If we want to see what we've entered, we use th e \"print\" command." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "print(g);" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'matrixG6#7&7&!\"\"\"\"!F)F)7&F)*&) &%\"aG6#F)\"\"#\"\"\"-%$expG6#,$*(-%%sqrtG6#\"\"$F1-F86#%'LambdaGF1%\" tGF1#F0F:F1F)F)7&F)F)*()%$chiGF0F1F,F1F2F1F)7&F)F)F)**FBF1)-%$sinG6#%& thetaGF0F1F,F1F2F1" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 383 "We'll also need the inverse metric. We can easily invert the above matrix, but \+ in more complicated problems, it's helpful to use Maple's matrix inver ter. To use it, we load the \"linalg\" package. (again for the Maple novices, when you first load a package, you will probably get some st range warning messages. They're almost always irrelevant, and you wil l learn to ignore them). " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(l inalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "ginv:=inverse(g) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%ginvG-%'matrixG6#7&7&!\"\"\"\" !F+F+7&F+*&\"\"\"F.*&)&%\"aG6#F+\"\"#F.-%$expG6#,$*(-%%sqrtG6#\"\"$F.- F;6#%'LambdaGF.%\"tGF.#F4F=F.F*F+F+7&F+F+*&F.F.*(F0F.F5F.)%$chiGF4F.F* F+7&F+F+F+*&F.F.**F0F.F5F.FFF.)-%$sinG6#%&thetaGF4F.F*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 120 "Now we compute the Christoffel symbols, \+ in the notation of MTW, where the first index is up, and the other two are down." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "christoffel := array( 1..4, 1..4, 1..4):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 236 "for \+ mu from 1 to 4 do\nfor nu from 1 to 4 do\nfor rho from 1 to 4 do\nchri stoffel[mu,nu,rho] := (1/2) * sum('ginv[mu,sigma]*(diff(g[sigma,nu],x [rho])+diff(g[rho,sigma],x[nu])-diff(g[nu,rho],x[sigma]))', 'sigma'=1. .4)\nend do\nend do\nend do:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 446 " Note the sum over the dummy index \"sigma\" above. The sum operation \+ is kinda funny. If you want to protect yourself from whatever other i nformation might happen to be stored in the computer's memory, you hav e to put the summand in single quotes, as well as the index in the ind ex-range expression. This is a hassle, especially when you're doing n ested sums, but I haven't found a good way around it. Perhaps I'm jus t too lazy to look, though.\n" }}{PARA 0 "" 0 "" {TEXT -1 220 "Now, if you want to see the Christoffel symbols you just computed, you can \" print(christoffel);\", but Maple will return a list of all 64 componen ts, most of which are zero, so just to save some space, I won't print \+ them." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 134 "Now we compute the components of the Rie mann tensor in essentially the same way. Now, however, there are four indices to loop over. " }}{PARA 0 "" 0 "" {TEXT -1 137 "Note that ho wever complicated all of these expressions may appear, they are all ju st really precise ways of writing our usual formulas. " }}{PARA 0 "" 0 "" {TEXT -1 347 "To make things somewhat legible, I've broken up man y of my expressions over many lines. If I'd just hit \"enter\" to do \+ this, Maple would have tried to compute something, and would have comp lained that the expression wasn't finished yet. If you just want to g et to a new line, but aren't finished with your expression yet, you hi t \"shift + enter\"." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "Riemann := \+ array[1..4, 1..4, 1..4, 1..4]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 395 "for mu from 1 to 4 do\nfor nu from 1 to 4 do\nfor rho from 1 \+ to 4 do\nfor sigma from 1 to 4 do\nRiemann[mu,nu,rho,sigma] := simplif y( diff(christoffel[mu,nu,sigma], x[rho])\n - diff(christoffel[mu,n u,rho], x[sigma])\n + sum('christoffel[mu,tau,rho]*christoffel[tau, nu,sigma]', 'tau'=1..4)\n - sum('christoffel[mu,tau,sigma]*christof fel[tau,nu,rho]', 'tau'=1..4) )\nend do\nend do\nend do\nend do;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 234 "In case you're wondering, the fir st index is up, the other three are down. This is the index positioni ng (and sign convention) of MTW, equivalent (sort of) to that in Wald. Feel free to change it if you prefer some other convention." } {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Now we take t he trace of the Riemann tensor." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 27 "Ricci := array(1..4, 1..4):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 128 "for mu from 1 to 4 do\nfor nu from 1 to 4 do \nRicci[mu,nu] := simplify( sum('Riemann[rho,mu,rho,nu]', 'rho'=1..4) \+ )\nend do\nend do;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "print (Ricci);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'matrixG6#7&7&,$%'Lambda G!\"\"\"\"!F+F+7&F+*()&%\"aG6#F+\"\"#\"\"\"F)F3-%$expG6#,$*(-%%sqrtG6# \"\"$F3-F:6#F)F3%\"tGF3#F2F " 0 "" {MPLTEXT 1 0 86 "Rscalar := simplify( sum('sum('ginv[mu,nu]*Ricc i[mu,nu]', 'mu'=1..4)', 'nu'=1..4) );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(RscalarG,$%'LambdaG\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "21 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }