Maxima 5.14.0cvs http://maxima.sourceforge.net Using Lisp CLISP 2.35 (2005-08-29) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) batching /home/vttoth/dev/maxima/share/tensor/tensor.dem At the _ prompt, type ';' followed by enter to get next demo (%i2) load(tendemo.mac) This is the main demonstration program for MAXIMA tensors. The following demos are available: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 1; batching /home/vttoth/dev/maxima/share/tensor/itensor1.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Tensors are indexed objects. To show a tensor use ishow() (%i3) ishow(g([a, b], [c, i], i2, i1)) c i (%t3) g a b,i2 i1 (%i4) Tensor components can be assigned using components(). As an example, consider a conformally flat metric: (%i5) declare(e, constant) (%o5) done (%i6) remcomps(g) (%o6) done (%i7) imetric(g) (%o7) done (%i8) components(g([i, j], []), e([i, j], []) p([], [])) (%o8) done e([], [i, j]) (%i9) components(g([], [i, j]), -------------) p([], []) (%o9) done (%i10) ishow(g([i, j], [])) (%t10) p e i j (%i11) ishow(g([], [i, j])) i j e (%t11) ---- p (%i12) Tensor components can also be assigned as MAXIMA functions: (%i13) t(l1, l2) := b(l1, l2) + c a(l1, l2) (%i14) ishow(t([i, k], [])) (%t14) b + c a i k i k (%i15) ishow(t([], [j, m])) j m j m (%t15) a c + b (%i16) Here is the Euler equation diff(p([], []), l1 ) 1 (%i17) Eu(l1, l2) := diff(phi([], []), l1 ) + -------------------- 1 rho([]) + v([], [j]) v(l1, [], j) + d_t v(l1, []) (%i18) ishow(Eu([i], [])) j (%t18) v v + d_t v i,j i (%i19) Another definition can be given using the metric g (%i20) Eu(l1, l2) := block([j1 : idummy()], diff(p([], []), l1 ) 1 if l2 = [] then diff(phi([], []), l1 ) + -------------------- 1 rho([]) + v([], [j1]) v(l1, [], j1) + d_t v(l1, []) diff(p([], []), j1) else g([], [l2 , j1]) (diff(phi([], []), j1) + -------------------) 1 rho([]) + v([], [j1]) v([], l2, j1) + d_t v([], l2)) (%i21) ishow(Eu([i], [])) %1 (%t21) v v + d_t v i,%1 i (%i22) ishow(Eu([], [i])) i %2 i (%t22) v d_t + v v ,%2 (%i23) The dummy index character can be changed from % using idummyx: (%i24) idummyx : n (%i25) ishow(Eu([i], [])) n3 (%t25) v v + d_t v i,n3 i (%i26) The indices() command lists the free and dummy indices (%i27) indices(Eu([i], [])) (%o27) [[i], [n4]] (%i28) The variable icounter controls the dummy index numbering (%i29) icounter (%o29) 4 (%i30) icounter : 100 (%o30) 100 (%i31) ishow(Eu([i], [])) n101 (%t31) v v + d_t v i,n101 i (%i32) idummyx : % INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 2; batching /home/vttoth/dev/maxima/share/tensor/itensor2.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) defcon() assigns contraction properties to tensors (%i3) defcon(e, f, g) (%i4) ishow(e([a], [b]) f([b], [c])) b c (%t4) e f a b (%i5) ishow(contract(%)) c (%t5) g a (%i6) kdelta is the Kronecker delta with special contraction properties (%i7) dim : 3 (%o7) 3 (%i8) ishow(contract(kdelta([a], [b]) kdelta([b], [a]))) (%t8) kdelta (%i9) ishow(ev(%, kdelta)) (%t9) 3 (%i10) The imetric() function sets up contraction properties for the metric (%i11) remcomps(g) (%o11) done (%i12) imetric(g) (%i13) ishow(g([i, j], [])) (%t13) g i j (%i14) ishow(g([], [j, k])) j k (%t14) g (%i15) ishow(%th(1) %th(2)) j k (%t15) g g i j (%i16) ishow(contract(rename(expand(%)))) k (%t16) kdelta i (%i17) The contract() function can also raise and lower indices (%i18) defcon(Ti) (%o18) done (%i19) ishow(Te([i, j], [k, l]) Ti([k, m]) Ti([l, n])) k l (%t19) Te Ti Ti i j k m l n (%i20) ishow(contract(%)) (%t20) Te i j n m (%i21) ishow(Te([i, j], [k, l]) Ti([], [i, n]) Ti([], [j, m])) i n j m k l (%t21) Ti Ti Te i j (%i22) ishow(contract(%)) n m k l (%t22) Te INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 3; batching /home/vttoth/dev/maxima/share/tensor/itensor3.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Take a tensor s. Remove any symmetry rules (%i3) remsym(s, 2, 0) (%o3) done (%i4) exp : ishow(s([i, j], []) - s([j, i], [])) (%t4) s - s i j j i (%i5) The canform function applies symmetry rules. None yet defined (%i6) ishow(canform(exp)) (%t6) s - s i j j i (%i7) We tell MAXIMA that s is symmetric using decsym (%i8) decsym(s, 2, 0, [sym(all)], []) (%i9) canform(exp) (%o9) 0 (%i10) The flag allsym causes all tensors to be treated as symmetric (%i11) allsym : true (%o11) true (%i12) canform(a([i, j], []) - a([j, i], [])) (%o12) 0 (%i13) But this setting can lead to incorrect results, so it's off by default (%i14) allsym : false (%o14) false (%i15) The function rename can be used on dummy indices (%i16) exp : ishow(a([i, j2], []) b([], [j2, k]) + a([i, j1], []) b([], [j1, k])) j2 k j1 k (%t16) b a + b a i j2 i j1 (%i17) ishow(rename(exp)) %1 k (%t17) 2 b a i %1 (%i18) The variable idummyx controls the dummy name, icounter is the counter (%i19) idummyx : n (%o19) n (%i20) ishow(rename(exp)) n1 k (%t20) 2 b a i n1 (%i21) To simplify tensor expressions, use rename, canform and canten (%i22) declare(e, constant) (%o22) done (%i23) In this example, we want to drop terms higher order in l (%i24) (ratfac : false, ratvars(l), ratweight(l, 1), ratwtlvl : 1) (%o24) 1 (%i25) remcomps(g) (%o25) done (%i26) imetric(g) (%o26) done (%i27) components(g([i, j], []), 2 l p([i, j], []) + e([i, j], [])) (%o27) done (%i28) components(g([], [i, j]), e([], [i, j]) - 2 l p([], [i, j])) (%o28) done (%i29) ishow(g([i, j], [])) (%t29) 2 p l + e i j i j (%i30) ishow(g([], [i, j])) i j i j (%t30) e - 2 p l (%i31) exp : ishow(icurvature([s, u, n], [y])) y y n1 y y n1 (%t31) ichr2 + ichr2 ichr2 - ichr2 - ichr2 ichr2 s u,n n1 n s u s n,u n1 u s n (%i32) exp : ev(exp) (%i33) Look the number of terms with nterms (%i34) nterms(exp) (%o34) 90 (%i35) ishow(canform(contract(rename(ratexpand(exp))))) y n1 y n1 y y (%t35) l p + e l p + e l p + l p u,n s s u,n n1 n s,n1 u n,s u INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 4; batching /home/vttoth/dev/maxima/share/tensor/itensor4.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) the Kronecker delta is defined the usual way (%i3) ishow(kdelta([i], [j])) j (%t3) kdelta i (%i4) ishow(kdelta([i, j], [n, m])) n m m n (%t4) kdelta kdelta - kdelta kdelta i j i j (%i5) ishow(kdelta([i, j, k], [l, n, m])) l n m m n (%t5) kdelta (kdelta kdelta - kdelta kdelta ) i j k j k l n m m n - kdelta (kdelta kdelta - kdelta kdelta ) j i k i k n m m n l + (kdelta kdelta - kdelta kdelta ) kdelta i j i j k (%i6) A symmetricized version is also defined, useful in many calculations: (%i7) ishow(kdels([i], [l])) l (%t7) kdelta i (%i8) ishow(kdels([i, j], [l, k])) k l l k (%t8) kdelta kdelta + kdelta kdelta i j i j (%i9) ishow(kdels([i, j, k], [l, m, n])) l m n n m (%t9) kdelta (kdelta kdelta + kdelta kdelta ) i j k j k l m n n m + kdelta (kdelta kdelta + kdelta kdelta ) j i k i k m n n m l + (kdelta kdelta + kdelta kdelta ) kdelta i j i j k (%i10) ishow(ev(kdels([], []), kdelta)) (%t10) 4 (%i11) Contraction of such kdels and kdelta gives zero. Look at the huge sum (%i12) ishow(expand(kdels([i, j, k], [l, m, n]) kdelta([l, m, n], [i1, i2, i3]))) l m n i1 i2 i3 (%t12) kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i1 i2 i3 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i1 i2 i3 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i1 i2 i3 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i1 i2 i3 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i1 i2 i3 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l m n i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i2 i1 i3 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l m n i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i1 i3 i2 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l m n i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i3 i1 i2 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l m n i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i2 i3 i1 + kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l m n i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m l n i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n l n m i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n l m i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n m n l i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n n m l i3 i2 i1 - kdelta kdelta kdelta kdelta kdelta kdelta i j k l m n (%i13) ishow(contract(%)) (%t13) 0 (%i14) Another example (%i15) take the symmetrization of A_ijk (%i16) ishow(contract(expand(a([i1, j1, k1], []) kdels([i, j, k], [i1, j1, k1])))) (%t16) a + a + a + a + a + a k j i k i j j k i j i k i k j i j k (%i17) The Levi-Civita symbol accepts numeric and symbolic arguments: (%i18) dim : 3 (%o18) 3 (%i19) levi_civita([1, 2, 3]) (%o19) 1 (%i20) levi_civita([i, j, j], []) (%o20) kdelta([i, j, j], [1, 2, 3]) (%i21) ev(%, kdelta) (%o21) 0 (%i22) The lc2kdt function simplifies the unevaluated Levi-Civita symbol (%i23) ishow(levi_civita([i, j, k], []) a([], [j]) levi_civita([], [k, l, n]) b([l], []) c([n], [])) j k l n (%t23) a levi_civita levi_civita b c i j k l n (%i24) ishow(contract(expand(lc2kdt(%)))) n l (%t24) a b c - a c b i n i l (%i25) ishow(levi_civita([i, j, k], []) a([], [j]) b([], [k]) levi_civita([], [i, l, n]) c([l], []) u([n], [])) i l n j k (%t25) levi_civita a b levi_civita c u i j k l n (%i26) ishow(contract(expand(lc2kdt(%)))) l n l n (%t26) a b c u - b a c u l n l n (%i27) Two simplification rules process Levi-Civita index patterns (%i28) ishow(levi_civita([], [i, j, k]) a([j]) b([k]) + levi_civita([i, j, k], []) a([], [j]) a([], [k])) i j k j k (%t28) levi_civita a b + a a levi_civita j k i j k (%i29) applyb1(%, lc_l, lc_u) (%i30) ishow(factor(canform(contract(expand(%))))) %1 %2 i levi_civita (a b - b a ) %1 %2 %1 %2 (%t30) -------------------------------------- 2 (%i31) Finally look for the dualization of the antisymmetric tensor B (%i32) decsym(B, 2, 0, [anti(all)], []) (%o32) done (%i33) ishow(B([i, j], [])) (%t33) B i j (%i34) Compute the dualization (%i35) rank : length(covi(B([i, j], []))) levi_civita([], [l, i, j]) B([i, j], []) (%i36) dual : ishow(----------------------------------------) rank! l i j levi_civita B i j (%t36) --------------------- 2 (%i37) Return to the original (%i38) ishow(levi_civita([i2, j2, l], []) dual) l i j levi_civita B levi_civita i j i2 j2 l (%t38) ---------------------------------------- 2 (%i39) ishow(canform(contract(expand(lc2kdt(%))))) (%t39) B i2 j2 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 5; batching /home/vttoth/dev/maxima/share/tensor/itensor5.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Partial differentiation with respect to a coordinate (%i3) ishow(idiff(f([], []), k)) (%t3) f ,k (%i4) ishow(idiff(v([i], []), k)) (%t4) v i,k (%i5) ishow(idiff(a([i], [j]), k)) j (%t5) a i,k (%i6) Partial differentiation is a commutative operation (%i7) ishow(idiff(idiff(v([i], []), k), l) - idiff(idiff(v([i], []), l), k)) (%t7) 0 (%i8) Unless a frame base is used (%i9) iframe_flag : true (%o9) true (%i10) ishow(idiff(idiff(v([i], []), k), l) - idiff(idiff(v([i], []), l), k)) (%t10) v - v i,k l i,l k (%i11) iframe_flag : false (%o11) false (%i12) To undo a partial differentation, use the undiff function (%i13) ishow(v([i], [], k)) (%t13) v i,k (%i14) exp : ishow(undiff(%)) (%t14) idiff(v , k, 1) i (%i15) Use rediff to evaluate all occurrences of idiff() again (%i16) ishow(rediff(exp)) (%t16) v i,k (%i17) These are useful for tensors that cannot be evaluated in derivative form (%i18) exp : ishow(icurvature([i, j, k], [m], n)) m (%t18) icurvature i j k,n (%i19) Evaluation of this expression causes an error (%i20) errcatch(ev(exp, nouns)) (%o20) [] (%i21) Here is when undiff, ev, rediff helps, which is what evundiff does (%i22) ishow(evundiff(exp)) m m %1 m %1 (%t22) - ichr2 - ichr2 ichr2 - ichr2 ichr2 i k,j n %1 j i k,n %1 j,n i k m m %1 m %1 + ichr2 + ichr2 ichr2 + ichr2 ichr2 i j,k n %1 k i j,n %1 k,n i j INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 6; batching /home/vttoth/dev/maxima/share/tensor/itensor6.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Covariant differentiation is carried out relative to a metric (%i3) remcomps(g) (%o3) done (%i4) imetric(g) (%o4) done (%i5) We declare the metric's symmetry properties (%i6) decsym(g, 2, 0, [sym(all)], []) (%o6) done (%i7) decsym(g, 0, 2, [], [sym(all)]) (%o7) done (%i8) MAXIMA can express both kinds of Christoffel symbols (%i9) ishow(ichr1([i, j, k])) g + g - g j k,i i k,j i j,k (%t9) ------------------------ 2 (%i10) ishow(ichr2([i, j], [k])) k %1 g (g - g + g ) j %1,i i j,%1 i %1,j (%t10) ----------------------------------- 2 (%i11) The covariant derivative uses the Christoffel symbols (%i12) ishow(covdiff(a([j, k], [i]), i)) i %2 i i %2 i %2 (%t12) - a ichr2 + a + ichr2 a - a ichr2 j %2 k i j k,i %2 i j k %2 k j i (%i13) exp : ishow(canform(contract(expand(ev(%, ichr2))))) %36 %37 %1 %2 %34 %35 %1 %2 g g g a g g g a ,%1 %2 %36 %37 j k ,%2 %1 %34 %35 j k (%t13) - ------------------------------ + ------------------------------ 2 2 %32 %33 %1 %2 g g g a ,j %1 %32 %2 %33 k %1 + ------------------------------- + a 2 j k,%1 %2 %3 %30 %31 %1 %2 %3 %28 %29 %1 g g g g a g g g g a ,%1 %2 %30 %3 %31 j k ,%3 %1 %28 %2 %29 j k - ------------------------------------ + ------------------------------------ 2 2 %2 %3 %26 %27 %1 %40 %41 %2 %1 g g g g a g g g a ,%3 %1 %26 %2 %27 j k ,%2 %1 %40 %41 k j - ------------------------------------ - ------------------------------ 2 2 %24 %25 %2 %1 %38 %39 %1 %2 g g g a g g g a ,k %1 %24 %2 %25 j ,%2 %1 %38 %39 k j + ------------------------------- + ------------------------------ 2 2 (%i14) To drop first derivatives of the metric, use igeodesic_coords (%i15) ishow(igeodesic_coords(exp, g)) %1 (%t15) a j k,%1 (%i16) Covariant derivatives of a vector do not commute (%i17) covdiff(v([], [i]), k, l) - covdiff(v([], [i]), l, k) (%i18) comm : ishow(factor(canform(%))) %1 %2 i %2 i i (%t18) v (ichr2 ichr2 - ichr2 ichr2 - ichr2 %1 k %2 l %1 l %2 k %1 l,k i + ichr2 ) %1 k,l (%i19) The curvature tensor is the same as the commutator (%i20) curv : ishow(v([], [j]) icurvature([j, k, l], [i])) j i i %54 i (%t20) v (- ichr2 - ichr2 ichr2 + ichr2 j l,k %54 k j l j k,l i %54 + ichr2 ichr2 ) %54 l j k (%i21) canform(comm - curv) (%o21) 0 (%i22) The function flush and relatives can drop derivative expressions (%i23) exp : u([i, k, r], [j, r]) + b([i, k], [j, r], r) + a([i], [j, r, s], k, r, s) + u([i], [j, r], k, r) (%i24) ishow(exp) j r j r j r s j r (%t24) u + b + a + u i k r i k,r i,k r s i,k r (%i25) ishow(flush(exp, u)) j r j r s j r (%t25) b + a + u i k,r i,k r s i,k r (%i26) ishow(flushd(exp, u, b)) j r j r s (%t26) u + a i k r i,k r s (%i27) ishow(flushnd(exp, a, 1)) j r j r j r (%t27) u + b + u i k r i k,r i,k r (%i28) The function lorentz() can be used to remove divergence free terms (%i29) defcon(e, e, kdelta) (%i30) defcon(e, p, p) (%i31) defcon(p, e, p) (%i32) decsym(e, 0, 2, [], [sym(all)]) (%o32) done (%i33) declare(e, constant) (%o33) done (%i34) (ratfac : false, ratvars(l), ratweight(l, 1), ratwtlvl : 1) (%o34) 1 (%i35) components(g([i, j], []), 2 l p([i, j], []) + e([i, j], [])) (%o35) done (%i36) components(g([], [i, j]), e([], [i, j]) - 2 l p([], [i, j])) (%o36) done (%i37) rinv : g([], [r, t]) icurvature([r, s, t], [s]) (%i38) ricci : g([], [i, r]) g([], [j, t]) icurvature([r, s, t], [s]) rinv g([], [i, j]) (%i39) - (ricci - ------------------) 2 (%i40) ishow(canform(rename(contract(ratexpand(ev(%)))))) %1 j %2 i %3 %2 %3 i j %1 %1 %2 j i (%t40) - e e p l + e e p l - e p l %3,%1 %2 %1,%2 %3 ,%1 %2 %1 %2 i j %1 j %2 i %1 j %2 i - p e l + e p l + p e l ,%1 %2 ,%1 %2 ,%1 %2 (%i41) ishow(lorentz_gauge(%, p)) %1 j %2 i %3 %2 %3 i j %1 %1 %2 j i (%t41) - e e p l + e e p l - e p l %3,%1 %2 %1,%2 %3 ,%1 %2 (%i42) The conmetderiv function relates derivatives of the metric tensor (%i43) ishow(q([], [a, b], c)) a b (%t43) q ,c (%i44) ishow(conmetderiv(%, q)) %69 b a %69 a b (%t44) - q ichr2 - q ichr2 %69 c %69 c INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 7; batching /home/vttoth/dev/maxima/share/tensor/ex_calc.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Exterior algebra for fully antisymmetric covariant tensors (%i3) The exterior product is denoted by ~. Apply it to two 1-forms (%i4) ishow(a([i]) ~ b([j])) a b - b a i j i j (%t4) ------------- 2 (%i5) The exterior product of the three 1-forms (%i6) ishow(a([i]) ~ b([j]) ~ c([k])) a b c - b a c - a c b + c a b + b c a - c b a i j k i j k i j k i j k i j k i j k (%t6) --------------------------------------------------------------- 6 (%i7) Take a sum of two 3 forms (%i8) ishow(factor((ak a([i])) ~ c([j]) ~ b([k]) + a([i]) ~ (bk b([j])) ~ c([k]))) (%t8) bk a c + ak a b i k i k (%i9) declare a 2-form and compute its exterior product with a 1-form (%i10) decsym(p, 2, 0, [anti(all)], []) (%o10) done (%i11) ishow(q([i]) ~ p([j, k])) p q + q p - p q i j k i j k i k j (%t11) --------------------------- 3 (%i12) the exterior derivative by index k is denoted by extdiff(x,k) (%i13) ishow(extdiff(p([j, k]), i)) p - p + p k j,i k i,j j i,k (%t13) - ------------------------ 3 (%i14) In other words, instead of 'd_k~f' we write extdiff(f,k) (%i15) ishow(extdiff(a([j]) ~ b([k]), i)) (%t15) - (a b - b a - a b + b a - a b + a b + b a i k,j i k,j j k,i j k,i j,i k i,j k j,i k - b a - a b + b a - a b + b a )/6 i,j k i j,k i j,k i,k j i,k j (%i16) ishow(extdiff(a([j]) ~ b([k]), k)) (%t16) 0 (%i17) Contraction (interior product) with a vector v is denoted by f|v (%i18) ishow(a([i]) | a) %1 (%t18) a a %1 (%i19) ishow(a([i]) ~ b([j]) | a) %1 %1 a a b a b a %1 j %1 j (%t19) ---------- - ---------- 2 2 (%i20) This operator always uses the first index in literal order (%i21) ishow(factor(a([i1]) ~ b([i2]) | a + a([i2]) ~ b([i1]) | a)) (%t21) 0 (%i22) The Lie derivative is liediff(v,x); v is a vector name, x a tensor (%i23) ishow(liediff(v, a([i1]))) %30 %30 (%t23) v a + v a i1,%30 ,i1 %30 (%i24) The Lie-derivative works on all tensors (but not on functions) (%i25) ishow(liediff(v, a([i, j], [k, l], m))) %31 k l %31 k l l k %31 k %31 l (%t25) v a + v a - v a - v a i j,%31 m ,m i j,%31 ,%31 i j,m ,%31 i j,m %31 k l %31 k l + v a + v a ,j i %31,m ,i %31 j,m (%i26) To see all these at work, we verify the Cartan identity for 1-forms (%i27) ishow(canform(liediff(v, extdiff(a([i1]), i2)) - extdiff(liediff(v, a([i1])), i2))) (%t27) 0 (%i28) Where liediff(v,extdiff(a([i1]),i2)) evaluates to: (%i29) ishow(liediff(v, extdiff(a([i1]), i2))) %44 %44 %43 %43 (%t29) (v a + v a - v a - v a i2,%44 i1 ,i1 i2,%44 i1,%43 i2 ,i2 i1,%43 %44 %43 + v a - v a )/2 ,i2 %44,i1 ,i1 %43,i2 (%i30) Cartan identities for higher-order forms are shown in car_iden.dem INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 8; batching /home/vttoth/dev/maxima/share/tensor/itensor8.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) The RHS of the heat transport equation (%i4) dim : 3 (%o4) 3 (%i5) remcomps(g) (%o5) done (%i6) imetric(g) (%o6) done (%i7) eqn : ishow(td = source + canform(rename(expand(covdiff(- k([], []) covdiff(t([], []), i), j) g([], [i, j]))))) %1 %2 %3 %1 %2 (%t7) td = source + k t g ichr2 - t k g ,%3 %1 %2 ,%1 ,%2 %1 %2 - k t g ,%1 %2 (%i8) Convert it to a CTENSOR program (%i9) heat : ic_convert(eqn) (%o9) td : source + k sum(sum(sum(diff(t, ct_coords ) ug mcs , %3 %1, %2 %1, %2, %3 %1, 1, dim), %2, 1, dim), %3, 1, dim) - sum(sum(diff(t, ct_coords ) %1 diff(k, ct_coords ) ug , %1, 1, dim), %2, 1, dim) %2 %1, %2 - k sum(sum(diff(diff(t, ct_coords ), ct_coords ) ug , %1, 1, dim), %1 %2 %1, %2 %2, 1, dim) (%i10) Next, write the equation in Cartesian coordinates: (%i11) ct_coords : [x, y, z] (%o11) [x, y, z] (%i12) lg : ident(3) [ 1 0 0 ] [ ] (%o12) [ 0 1 0 ] [ ] [ 0 0 1 ] (%i13) ug : invert(lg) [ 1 0 0 ] [ ] (%o13) [ 0 1 0 ] [ ] [ 0 0 1 ] (%i14) christof(mcs) (%o14) done (%i15) depends([t, k], ct_coords) (%o15) [t(x, y, z), k(x, y, z)] (%i16) ev(heat) 2 2 2 d t d t d t dk dt dk dt dk dt (%o16) - k (--- + --- + ---) - -- -- - -- -- - -- -- + source 2 2 2 dz dz dy dy dx dx dz dy dx (%i17) Now get the equation in spherical coordinates. (%i18) ct_coords : [r, th, ph] (%o18) [r, th, ph] 2 2 2 (%i19) lg : matrix([1, 0, 0], [0, r , 0], [0, 0, r sin (th)]) (%i20) ug : invert(lg) (%i21) christof(all) (%t21) lcs = r 1, 2, 2 2 (%t22) lcs = r sin (th) 1, 3, 3 (%t23) lcs = - r 2, 2, 1 2 (%t24) lcs = r cos(th) sin(th) 2, 3, 3 2 (%t25) lcs = - r sin (th) 3, 3, 1 2 (%t26) lcs = - r cos(th) sin(th) 3, 3, 2 1 (%t27) mcs = - 1, 2, 2 r 1 (%t28) mcs = - 1, 3, 3 r (%t29) mcs = - r 2, 2, 1 cos(th) (%t30) mcs = ------- 2, 3, 3 sin(th) 2 (%t31) mcs = - r sin (th) 3, 3, 1 (%t32) mcs = - cos(th) sin(th) 3, 3, 2 (%o32) done (%i33) remove([t, k], dependency) (%o33) done (%i34) depends(t, ct_coords) (%o34) [t(r, th, ph)] (%i35) ev(heat) 2 2 d t d t dt dt ---- ---- --- cos(th) 2 -- 2 2 2 dth dr dph dth d t (%o35) k (- ----------- - ----) - k (----------- + ---- + ---) + source 2 r 2 2 2 2 r sin(th) r sin (th) r dr INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 9; batching /home/vttoth/dev/maxima/share/tensor/itensor9.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) In a frame base, partial derivatives do not commute (%i3) idiff(v([i], []), j, 1, k, 1) - idiff(v([i], []), k, 1, j, 1) (%o3) 0 (%i4) iframe_flag : true (%o4) true (%i5) ishow(idiff(v([i], []), j, 1, k, 1) - idiff(v([i], []), k, 1, j, 1)) (%t5) v - v i,j k i,k j (%i6) The Christoffel-symbols are replaced by connection coefficients (%i7) ishow(covdiff(v([i], []), j)) %1 (%t7) v - v icc2 i,j %1 i j (%i8) Which in turn are the sum of Christoffel-symbols and frame coefficients (%i9) ishow(icc2([i, j], [k])) k (%t9) ifc2 i j (%i10) The latter are defined in terms of the frame bracket and frame metric (%i11) ishow(ifc2([i, j], [k])) k %2 (%t11) ifg ifc1 i j %2 (%i12) The frame bracket has two definitions which are equivalent (%i13) block([iframe_bracket_form : false], ishow(ifb([i, j, k]))) %4 %3 %3 %4 (%t13) ifri (ifr ifr - ifr ifr ) i %3 j k,%4 j,%4 k (%i14) block([iframe_bracket_form : true], ishow(ifb([i, j, k]))) %5 %6 (%t14) (ifri - ifri ) ifr ifr i %5,%6 i %6,%5 j k (%i15) To explore torsion, we set up a metric but no contraction properties (%i16) remcomps(g) (%o16) done (%i17) imetric : g (%o17) g (%i18) decsym(g, 2, 0, [sym(all)], []) (%o18) done (%i19) decsym(g, 0, 2, [], [sym(all)]) (%o19) done (%i20) First demonstrate that covariant differentiation commutes for scalars (%i21) iframe_flag : false (%o21) false (%i22) itorsion_flag : false (%o22) false (%i23) inonmet_flag : false (%o23) false (%i24) ishow(covdiff(covdiff(f([], []), i), j) - covdiff(covdiff(f([], []), j), i)) %10 %8 (%t24) f ichr2 - f ichr2 ,%10 j i ,%8 i j (%i25) ishow(canform(%)) (%t25) 0 (%i26) Now we introduce torsion (%i27) itorsion_flag : true (%o27) true (%i28) ishow(covdiff(covdiff(f([], []), i), j) - covdiff(covdiff(f([], []), j), i)) %14 %12 (%t28) f icc2 - f icc2 - f + f ,%14 j i ,%12 i j ,j i ,i j (%i29) exp : ishow(canform(%)) %1 %1 (%t29) f icc2 - f icc2 ,%1 j i ,%1 i j (%i30) ishow(ev(%, icc2)) %1 %1 %1 %1 (%t30) f (ichr2 - ikt2 ) - f (ichr2 - ikt2 ) ,%1 j i j i ,%1 i j i j (%i31) ishow(canform(%)) %1 %1 (%t31) f ikt2 - f ikt2 ,%1 i j ,%1 j i (%i32) Now we're ready to evaluate the contortion coefficients (%i33) ishow(ev(exp, ikt2)) %1 %1 %16 (%t33) f (ichr2 - g ikt1 ) ,%1 j i j i %16 %1 %1 %15 - f (ichr2 - g ikt1 ) ,%1 i j i j %15 (%i34) exp : ishow(ev(%, ikt1)) %1 (%t34) f (ichr2 ,%1 j i %1 %16 %18 %18 %18 g (- g itr - itr g - itr g ) %16 %18 j i %16 i j %18 %16 j i %18 - ---------------------------------------------------------------) 2 %1 - f (ichr2 ,%1 i j %1 %15 %17 %17 %17 g (- itr g - g itr - itr g ) %15 i j %17 %15 %17 i j %15 j i %17 - ---------------------------------------------------------------) 2 (%i35) Noun forms of g are a side effect which we must get rid of (%i36) ishow(subst(g, nounify(g), exp)) %1 (%t36) f (ichr2 ,%1 j i %1 %16 %18 %18 %18 g (- g itr - itr g - itr g ) %16 %18 j i %16 i j %18 %16 j i %18 - ---------------------------------------------------------------) 2 %1 - f (ichr2 ,%1 i j %1 %15 %17 %17 %17 g (- itr g - g itr - itr g ) %15 i j %17 %15 %17 i j %15 j i %17 - ---------------------------------------------------------------) 2 (%i37) exp : ishow(canform(%)) %2 %3 %1 (%t37) - f g g itr ,%3 %1 %2 i j (%i38) We declare itr antisymmetric, and contract g^2 to kdelta (%i39) decsym(itr, 2, 1, [anti(all)], []) (%o39) done (%i40) defcon(g, g, kdelta) (%o40) done (%i41) exp : ishow(canform(exp)) %2 %3 %1 (%t41) - f g g itr ,%3 %1 %2 i j (%i42) And we're quite done (%i43) ishow(contract(exp)) %1 (%t43) - f itr ,%1 i j (%i44) We can verify torsion in a frame base, too (%i45) iframe_flag : true (%o45) true (%i46) covdiff(v([i]), j) - covdiff(v([j]), i) (%i47) ishow(contract(canform(ev(%, icc2, ifc2, ifc1, ikt2, ikt1, ifg)))) %2 %1 %2 %1 ifg v ifb ifg v ifb %2 j i %1 %2 j %1 i (%t47) ---------------------- - ---------------------- - v 2 2 j,i %2 %1 %2 %1 ifg v ifb ifg v ifb %2 i j %1 %2 i %1 j - ---------------------- + ---------------------- + v 2 2 i,j %2 %1 %2 %1 ifg ifb v ifg ifb v %1 j i %2 %1 i j %2 - ---------------------- + ---------------------- 2 2 (%i48) Next, we verify the nonmetricity tensor (%i49) iframe_flag : false (%o49) false (%i50) inonmet_flag : true (%o50) true (%i51) itorsion_flag : false (%o51) false (%i52) We need all the metric tensor's contraction properties (%i53) imetric(g) (%o53) done (%i54) ishow(covdiff(g([i, j], []), k)) %23 %23 (%t54) - g icc2 - g icc2 + g i %23 j k %23 j i k i j,k (%i55) exp : ishow(ev(%, icc2)) %23 %23 %23 %23 (%t55) - g (ichr2 - inmc2 ) - g (ichr2 - inmc2 ) + g i %23 j k j k %23 j i k i k i j,k (%i56) Now we can evaluate ichr2, inmc1, and simplify (%i57) exp : ishow(canform(contract(rename(expand(ev(exp, ichr2)))))) (%t57) inmc1 + inmc1 j k i i k j (%i58) In order to get the expected result: (%i59) ishow(canform(ev(exp, inmc1))) (%t59) - g inm i j k INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 11; batching /home/vttoth/dev/maxima/share/tensor/ctensor1.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) To select a stock metric, use ct_coordsys (%i3) verbose : false (%o3) false (%i4) ct_coordsys(spherical) (%o4) done (%i5) The metric tensor is stored in the array lg (%i6) lg [ 1 0 0 ] [ ] [ 2 ] (%o6) [ 0 r 0 ] [ ] [ 2 2 ] [ 0 0 r sin (theta) ] (%i7) A call to cmetric() sets up the inverse and other properties (%i8) cmetric() (%o8) done (%i9) ug [ 1 0 0 ] [ ] [ 1 ] [ 0 -- 0 ] [ 2 ] (%o9) [ r ] [ ] [ 1 ] [ 0 0 -------------- ] [ 2 2 ] [ r sin (theta) ] (%i10) diagmetric (%o10) true (%i11) Most metrics are available also as a frame base (%i12) cframe_flag : true (%o12) true (%i13) ct_coordsys(spherical) (%o13) done (%i14) The inverse frame base is in the array fri; lfg is the frame metric (%i15) fri [ 1 0 0 ] [ ] (%o15) [ 0 r 0 ] [ ] [ 0 0 r sin(theta) ] (%i16) lfg [ 1 0 0 ] [ ] (%o16) [ 0 1 0 ] [ ] [ 0 0 1 ] (%i17) Now, cmetric computes the frame base, and also the metric (%i18) cmetric() (%o18) false (%i19) fr [ 1 0 0 ] [ ] [ 1 ] [ 0 - 0 ] (%o19) [ r ] [ ] [ 1 ] [ 0 0 ------------ ] [ r sin(theta) ] (%i20) ufg [ 1 0 0 ] [ ] (%o20) [ 0 1 0 ] [ ] [ 0 0 1 ] (%i21) lg [ 1 0 0 ] [ ] [ 2 ] (%o21) [ 0 r 0 ] [ ] [ 2 2 ] [ 0 0 r sin (theta) ] (%i22) You can also supply a set of transformation rules to ct_coordsys (%i23) ct_coordsys([r cos(theta) cos(phi), r cos(theta) sin(phi), r sin(theta), [r, theta, phi]]) (%o23) done (%i24) cmetric() (%o24) false (%i25) fri (%o25) [ cos(phi) cos(theta) - cos(phi) r sin(theta) - sin(phi) r cos(theta) ] [ ] [ sin(phi) cos(theta) - sin(phi) r sin(theta) cos(phi) r cos(theta) ] [ ] [ sin(theta) r cos(theta) 0 ] (%i26) lg : trigsimp(lg) [ 1 0 0 ] [ ] [ 2 ] (%o26) [ 0 r 0 ] [ ] [ 2 2 ] [ 0 0 r cos (theta) ] INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 12; batching /home/vttoth/dev/maxima/share/tensor/ctensor2.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Prove that the Schwarzschild line element is of an empty metric (%i3) The dimension of the manifold (%i4) dim : 4 (%o4) 4 (%i5) The coordinate labels (%i6) ct_coords : [x, y, z, t] (%o6) [x, y, z, t] (%i7) Rational simplification of geometrical objects (%i8) (ratwtlvl : false, ratfac : true) (%o8) true (%i9) Here is the Schwarzschild metric in standard coordinates: 1 2 2 2 (%i10) lg : matrix([-------, 0, 0, 0], [0, x , 0, 0], [0, 0, x sin (y), 0], 2 m 1 - --- x 2 m [0, 0, 0, --- - 1]) x [ 1 ] [ ------- 0 0 0 ] [ 2 m ] [ 1 - --- ] [ x ] [ ] [ 2 ] (%o10) [ 0 x 0 0 ] [ ] [ 2 2 ] [ 0 0 x sin (y) 0 ] [ ] [ 2 m ] [ 0 0 0 --- - 1 ] [ x ] (%i11) Compute metric inverse and determine diagonality (%i12) cmetric() (%o12) done (%i13) Compute and display mixed Christoffel symbols (%i14) christof(mcs) m (%t14) mcs = - ----------- 1, 1, 1 x (x - 2 m) 1 (%t15) mcs = - 1, 2, 2 x 1 (%t16) mcs = - 1, 3, 3 x m (%t17) mcs = ----------- 1, 4, 4 x (x - 2 m) (%t18) mcs = 2 m - x 2, 2, 1 cos(y) (%t19) mcs = ------ 2, 3, 3 sin(y) 2 (%t20) mcs = - (x - 2 m) sin (y) 3, 3, 1 (%t21) mcs = - cos(y) sin(y) 3, 3, 2 m (x - 2 m) (%t22) mcs = ----------- 4, 4, 1 3 x (%o22) done (%i23) Compute and rationally simplify the contravariant Ricci tensor (%i24) uricci(true) THIS SPACETIME IS EMPTY AND/OR FLAT (%o24) done (%i25) Computes scalar curvature (%i26) scurvature() (%o26) 0 (%i27) Compute the (3,1) Riemann tensor (%i28) riemann(true) m (%t28) riem = ------------ 1, 2, 1, 2 2 x (x - 2 m) m (%t29) riem = ------------ 1, 3, 1, 3 2 x (x - 2 m) 2 m m 2 m (%t30) riem = - ------------ - ------------ + ------------- 1, 4, 1, 4 2 2 2 2 x (x - 2 m) x (x - 2 m) x (x - 2 m) m (%t31) riem = - - 2, 2, 1, 1 x 2 m - x (%t32) riem = - ------- - 1 2, 3, 2, 3 x m (2 m - x) (%t33) riem = - ----------- 2, 4, 2, 4 x (x - 2 m) 2 m sin (y) (%t34) riem = - --------- 3, 3, 1, 1 x 2 2 m sin (y) (%t35) riem = ----------- 3, 3, 2, 2 x 2 m sin (y) (%t36) riem = --------- 3, 4, 3, 4 x 2 m (x - 2 m) (%t37) riem = - ------------- 4, 4, 1, 1 4 x m (x - 2 m) (%t38) riem = ----------- 4, 4, 2, 2 4 x m (x - 2 m) (%t39) riem = ----------- 4, 4, 3, 3 4 x (%o39) done (%i40) Compute the covariant Riemann tensor (%i41) lriemann(true) m (%t41) lriem = - ------- 2, 2, 1, 1 x - 2 m 2 m sin (y) (%t42) lriem = - --------- 3, 3, 1, 1 x - 2 m 2 (%t43) lriem = 2 m x sin (y) 3, 3, 2, 2 2 m (%t44) lriem = - --- 4, 4, 1, 1 3 x m (x - 2 m) (%t45) lriem = ----------- 4, 4, 2, 2 2 x 2 m (x - 2 m) sin (y) (%t46) lriem = ------------------- 4, 4, 3, 3 2 x (%o46) done (%i47) Compute the contravariant Riemann tensor (%i48) uriemann(true) m (x - 2 m) (%t48) uriem = - ----------- 2, 2, 1, 1 6 x m (x - 2 m) (%t49) uriem = - ----------- 3, 3, 1, 1 6 2 x sin (y) 2 m (%t50) uriem = ---------- 3, 3, 2, 2 7 2 x sin (y) 2 m (%t51) uriem = - --- 4, 4, 1, 1 3 x m (%t52) uriem = ------------ 4, 4, 2, 2 4 x (x - 2 m) m (%t53) uriem = -------------------- 4, 4, 3, 3 4 2 x (x - 2 m) sin (y) (%o53) done (%i54) Compute the Kretchmann invariant Rijkl^2 (%i55) rinvariant() 2 48 m (%o55) ----- 6 x INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 13; batching /home/vttoth/dev/maxima/share/tensor/ctensor3.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) A conformally flat metric helps demonstrate the curvature tensors (%i3) (ratwtlvl : false, ratfac : true) (%o3) true (%i4) derivabbrev : true (%o4) true (%i5) dim : 4 (%o5) 4 (%i6) ct_coords : [x, y, z, t] (%o6) [x, y, z, t] (%i7) lg : a ident(4) [ a 0 0 0 ] [ ] [ 0 a 0 0 ] (%o7) [ ] [ 0 0 a 0 ] [ ] [ 0 0 0 a ] (%i8) dependencies(a(t)) (%o8) [a(t)] (%i9) cmetric() computes the metric inverse: (%i10) cmetric() (%o10) done (%i11) ug [ 1 ] [ - 0 0 0 ] [ a ] [ ] [ 1 ] [ 0 - 0 0 ] [ a ] (%o11) [ ] [ 1 ] [ 0 0 - 0 ] [ a ] [ ] [ 1 ] [ 0 0 0 - ] [ a ] (%i12) christof() computes the Christoffel-symbols of the 1st and 2nd kind (%i13) christof(mcs) a t (%t13) mcs = - --- 1, 1, 4 2 a a t (%t14) mcs = --- 1, 4, 1 2 a a t (%t15) mcs = - --- 2, 2, 4 2 a a t (%t16) mcs = --- 2, 4, 2 2 a a t (%t17) mcs = - --- 3, 3, 4 2 a a t (%t18) mcs = --- 3, 4, 3 2 a a t (%t19) mcs = --- 4, 4, 4 2 a (%o19) done (%i20) ricci() computes and optionally displays the mixed-index Ricci tensor (%i21) ricci(true) a t t (%t21) ric = - ---- 1, 1 2 a a t t (%t22) ric = - ---- 2, 2 2 a a t t (%t23) ric = - ---- 3, 3 2 a 2 3 (a a - (a ) ) t t t (%t24) ric = - ------------------ 4, 4 2 2 a (%o24) done (%i25) uricci() computes the contravariant Ricci tensor (%i26) uricci(true) a t t (%t26) uric = - ---- 1, 1 2 2 a a t t (%t27) uric = - ---- 2, 2 2 2 a a t t (%t28) uric = - ---- 3, 3 2 2 a 2 3 (a a - (a ) ) t t t (%t29) uric = - ------------------ 4, 4 3 2 a (%o29) done (%i30) riemann() computes the (3,1) Riemann-tensor (%i31) riemann(true) 2 (a ) t (%t31) riem = ----- 1, 2, 1, 2 2 4 a 2 (a ) t (%t32) riem = ----- 1, 3, 1, 3 2 4 a 2 a (a ) t t t (%t33) riem = ---- - ----- 1, 4, 1, 4 2 a 2 2 a 2 (a ) t (%t34) riem = - ----- 2, 2, 1, 1 2 4 a 2 (a ) t (%t35) riem = ----- 2, 3, 2, 3 2 4 a 2 a (a ) t t t (%t36) riem = ---- - ----- 2, 4, 2, 4 2 a 2 2 a 2 (a ) t (%t37) riem = - ----- 3, 3, 1, 1 2 4 a 2 (a ) t (%t38) riem = - ----- 3, 3, 2, 2 2 4 a 2 a (a ) t t t (%t39) riem = ---- - ----- 3, 4, 3, 4 2 a 2 2 a 2 a a - (a ) t t t (%t40) riem = - -------------- 4, 4, 1, 1 2 2 a 2 a a - (a ) t t t (%t41) riem = - -------------- 4, 4, 2, 2 2 2 a 2 a a - (a ) t t t (%t42) riem = - -------------- 4, 4, 3, 3 2 2 a (%o42) done (%i43) The covariant Riemann-tensor is obtained with lriemann() (%i44) lriemann(true) 2 (a ) t (%t44) lriem = - ----- 2, 2, 1, 1 4 a 2 (a ) t (%t45) lriem = - ----- 3, 3, 1, 1 4 a 2 (a ) t (%t46) lriem = - ----- 3, 3, 2, 2 4 a 2 a a - (a ) t t t (%t47) lriem = - -------------- 4, 4, 1, 1 2 a 2 a a - (a ) t t t (%t48) lriem = - -------------- 4, 4, 2, 2 2 a 2 a a - (a ) t t t (%t49) lriem = - -------------- 4, 4, 3, 3 2 a (%o49) done (%i50) While uriemann() computes the contravariant Riemann tensor (%i51) uriemann(true) 2 (a ) t (%t51) uriem = - ----- 2, 2, 1, 1 5 4 a 2 (a ) t (%t52) uriem = - ----- 3, 3, 1, 1 5 4 a 2 (a ) t (%t53) uriem = - ----- 3, 3, 2, 2 5 4 a 2 a a - (a ) t t t (%t54) uriem = - -------------- 4, 4, 1, 1 5 2 a 2 a a - (a ) t t t (%t55) uriem = - -------------- 4, 4, 2, 2 5 2 a 2 a a - (a ) t t t (%t56) uriem = - -------------- 4, 4, 3, 3 5 2 a (%o56) done (%i57) The mixed-index Einstein tensor is computed by einstein() (%i58) einstein(true) 2 4 a a - 3 (a ) t t t (%t58) ein = ------------------ 1, 1 3 4 a 2 4 a a - 3 (a ) t t t (%t59) ein = ------------------ 2, 2 3 4 a 2 4 a a - 3 (a ) t t t (%t60) ein = ------------------ 3, 3 3 4 a 2 3 (a ) t (%t61) ein = ------- 4, 4 3 4 a (%o61) done (%i62) The covariant Einstein tensor is computed by leinstein() (%i63) leinstein(true) 2 4 a a - 3 (a ) t t t (%t63) lein = ------------------ 1, 1 2 4 a 2 4 a a - 3 (a ) t t t (%t64) lein = ------------------ 2, 2 2 4 a 2 4 a a - 3 (a ) t t t (%t65) lein = ------------------ 3, 3 2 4 a 2 3 (a ) t (%t66) lein = ------- 4, 4 2 4 a (%o66) done (%i67) Rinvariant obtains the Kretchmann-invariant: (%i68) rinvariant() 2 2 4 3 (a a - (a ) ) 3 (a ) t t t t (%o68) ------------------- + ------- 6 6 a 4 a (%i69) The Weyl tensor is empty for a conformally metric (%i70) weyl(true) THIS SPACETIME IS CONFORMALLY FLAT (%o70) done INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 14; batching /home/vttoth/dev/maxima/share/tensor/ctensor4.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Verify the Schwarzschild metric in tetrad base (%i3) The variable cframe_flag determines if a frame base is used (%i4) cframe_flag : true (%o4) true (%i5) ct_coordsys() can be used to set up predefined metrics (%i6) verbose : true (%o6) true (%i7) ct_coordsys(exteriorschwarzschild) (%t7) dim = 4 (%t8) ct_coords = [t, r, theta, phi] [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%t9) lfg = [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] [ sqrt(r - 2 m) ] [ ------------- 0 0 0 ] [ sqrt(r) ] [ ] [ sqrt(r) ] (%t10) fri = [ 0 ------------- 0 0 ] [ sqrt(r - 2 m) ] [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 r sin(theta) ] (%o10) done (%i11) A call to cmetric() computes the frame base and the metric (%i12) cmetric() (%i13) fr [ sqrt(r) ] [ - ------------- 0 0 0 ] [ sqrt(r - 2 m) ] [ ] [ sqrt(r - 2 m) ] [ 0 ------------- 0 0 ] [ sqrt(r) ] (%o13) [ ] [ 1 ] [ 0 0 - 0 ] [ r ] [ ] [ 1 ] [ 0 0 0 ------------ ] [ r sin(theta) ] (%i14) lg [ r - 2 m ] [ - ------- 0 0 0 ] [ r ] [ ] [ r ] [ 0 ------- 0 0 ] (%o14) [ r - 2 m ] [ ] [ 2 ] [ 0 0 r 0 ] [ ] [ 2 2 ] [ 0 0 0 r sin (theta) ] (%i15) But we're not using the metric when we compute the connection (%i16) christof(mcs) m (%t16) mcs = - ------------------ 1, 1, 2 3/2 r sqrt(r - 2 m) m (%t17) mcs = - ------------------ 1, 2, 1 3/2 r sqrt(r - 2 m) sqrt(r - 2 m) (%t18) mcs = ------------- 3, 3, 2 3/2 r sqrt(r - 2 m) (%t19) mcs = ------------- 4, 4, 2 3/2 r cos(theta) (%t20) mcs = ------------ 4, 4, 3 r sin(theta) (%o20) done (%i21) We can now compute the Ricci tensor in tetrad base (%i22) ricci(true) THIS SPACETIME IS EMPTY AND/OR FLAT (%o22) done INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 15; batching /home/vttoth/dev/maxima/share/tensor/ctensor5.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) We use a simple 2D metric to demonstrate torsion and nonmetricity (%i3) ct_coordsys(cartesian2d) (%t3) dim = 2 (%t4) ct_coords = [x, y] [ 1 0 ] (%t5) lg = [ ] [ 0 1 ] (%o5) done (%i6) ug : invert(lg) [ 1 0 ] (%o6) [ ] [ 0 1 ] (%i7) In a flat metric, the Christoffel symbols are zero (%i8) christof(false) (%o8) done (%i9) cdisplay(mcs) [ 0 0 ] mcs = [ ] 1 [ 0 0 ] [ 0 0 ] mcs = [ ] 2 [ 0 0 ] (%o9) done (%i10) Let us examine how torsion changes this (%i11) ctorsion_flag : true (%o11) true (%i12) christof(false) (%o12) done (%i13) cdisplay(mcs) [ 3 tr - 2 tr - tr ] [ 1, 1, 1 2, 1, 1 1, 1, 2 ] [ ----------- - ------------------------- ] [ 2 2 ] mcs = [ ] 1 [ - 2 tr - tr - tr - tr - tr ] [ 1, 2, 1 1, 1, 2 2, 2, 1 2, 1, 2 1, 2, 2 ] [ - ------------------------- - ----------------------------------- ] [ 2 2 ] [ - tr - tr - tr - tr - 2 tr ] [ 2, 1, 1 1, 2, 1 1, 1, 2 2, 2, 1 2, 1, 2 ] [ - ----------------------------------- - ------------------------- ] [ 2 2 ] mcs = [ ] 2 [ - tr - 2 tr 3 tr ] [ 2, 2, 1 1, 2, 2 2, 2, 2 ] [ - ------------------------- ----------- ] [ 2 2 ] (%o13) done (%i14) And now recalculate the Christoffel symbols with nonmetricity (%i15) ctorsion_flag : false (%o15) false (%i16) cnonmet_flag : true (%o16) true (%i17) christof(false) (%o17) done (%i18) cdisplay(mcs) [ nm - nm ] [ 1 2 ] mcs = [ ] 1 [ nm nm ] [ 2 1 ] [ nm nm ] [ 2 1 ] mcs = [ ] 2 [ - nm nm ] [ 1 2 ] (%o18) done (%i19) The arrays tr and nm are user-defined. INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 16; batching /home/vttoth/dev/maxima/share/tensor/ctensor6.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of the Schwarzschild metric (%i3) We use frames, set up simplification flags (%i4) (cframe_flag : true, gcd : spmod, ctrgsimp : true, ratwtlvl : false, ratfac : true) (%o4) true (%i5) We use the stock Schwarzschild frame (%i6) ct_coordsys(exteriorschwarzschild, all) (%t6) dim = 4 (%t7) ct_coords = [t, r, theta, phi] [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%t8) lfg = [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] [ sqrt(r - 2 m) ] [ ------------- 0 0 0 ] [ sqrt(r) ] [ ] [ sqrt(r) ] (%t9) fri = [ 0 ------------- 0 0 ] [ sqrt(r - 2 m) ] [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 r sin(theta) ] (%o9) done (%i10) The inverse metric tensor is needed by nptetrad() (%i11) ug : invert(lg) (%i12) The basis for the calculations is the Weyl tensor (%i13) weyl(false) (%o13) done (%i14) We compute a Newman-Penrose null tetrad (%i15) nptetrad(false) (%o15) done (%i16) Now we're ready to compute the coefficients (%i17) psi(true) (%t17) psi = 0 0 (%t18) psi = 0 1 m (%t19) psi = -- 2 3 r (%t20) psi = 0 3 (%t21) psi = 0 4 (%o21) done (%i22) And obtain the Petrov class (%i23) petrov() (%o23) D INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 17; batching /home/vttoth/dev/maxima/share/tensor/ctensor7.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) We set up a simple nonempty metric (%i3) derivabbrev : true (%o3) true (%i4) dim : 4 (%o4) 4 2 2 2 (%i5) lg : matrix([a, 0, 0, 0], [0, x , 0, 0], [0, 0, x sin (y), 0], [0, 0, 0, - d]) [ a 0 0 0 ] [ ] [ 2 ] [ 0 x 0 0 ] (%o5) [ ] [ 2 2 ] [ 0 0 x sin (y) 0 ] [ ] [ 0 0 0 - d ] (%i6) depends([a, d], x) (%o6) [a(x), d(x)] (%i7) ct_coords : [x, y, z, t] (%o7) [x, y, z, t] (%i8) Compute the inverse metric (%i9) cmetric() (%o9) done (%i10) Compute the Einstein tensor (%i11) einstein(false) (%o11) done (%i12) Find a set of unique differential equations in ein (%i13) findde(ein, 2) 2 (%o13) [d x - a d + d, 2 a d d x - a (d ) x - a d d x + 2 a d d x x x x x x x 2 2 - 2 a d , a x + a - a] x x (%i14) Find out which tensor components were used in these equations (%i15) deindex (%o15) [[1, 1], [2, 2], [4, 4]] INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) 18; batching /home/vttoth/dev/maxima/share/tensor/ctensor8.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Define a metric that is a perturbation of the Minkowski metric (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) ratfac : true (%o3) true (%i4) derivabbrev : true (%o4) true (%i5) ct_coords : [t, r, theta, phi] (%o5) [t, r, theta, phi] 2 (%i6) lg : matrix([- 1, 0, 0, 0], [0, 1, 0, 0], [0, 0, r , 0], 2 2 [0, 0, 0, r sin (theta)]) [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] [ ] (%o6) [ 2 ] [ 0 0 r 0 ] [ ] [ 2 2 ] [ 0 0 0 r sin (theta) ] (%i7) h : matrix([h11, 0, 0, 0], [0, h22, 0, 0], [0, 0, h33, 0], [0, 0, 0, h44]) [ h11 0 0 0 ] [ ] [ 0 h22 0 0 ] (%o7) [ ] [ 0 0 h33 0 ] [ ] [ 0 0 0 h44 ] (%i8) Spherically symmetric metric depends on the scalar field l (%i9) depends(l, r) (%o9) [l(r)] (%i10) lg : l h + lg [ h11 l - 1 0 0 0 ] [ ] [ 0 h22 l + 1 0 0 ] [ ] (%o10) [ 2 ] [ 0 0 r + h33 l 0 ] [ ] [ 2 2 ] [ 0 0 0 r sin (theta) + h44 l ] (%i11) First, we compute the Einstein tensor (%i12) cmetric(false) (%o12) done (%i13) Be patient, this will take a while... (%i14) einstein(false) (%o14) done (%i15) And it has far too many terms (%i16) ntermst(ein) [[1, 1], 62] [[1, 2], 0] [[1, 3], 0] [[1, 4], 0] [[2, 1], 0] [[2, 2], 24] [[2, 3], 6] [[2, 4], 0] [[3, 1], 0] [[3, 2], 6] [[3, 3], 46] [[3, 4], 0] [[4, 1], 0] [[4, 2], 0] [[4, 3], 0] [[4, 4], 46] (%o16) done (%i17) Now let's drop terms higher order in l (%i18) ctayswitch : true (%o18) true (%i19) ctayvar : l (%o19) l (%i20) ctaypov : 1 (%o20) 1 (%i21) ctaypt : 0 (%o21) 0 (%i22) We now explicitly recompute the Christoffel symbols and the Ricci tensor (%i23) christof(false) (%o23) done (%i24) ricci(false) (%o24) done (%i25) So that we can recompute the Einstein tensor (%i26) einstein(false) (%o26) done (%i27) Which now has far fewer terms: (%i28) ntermst(ein) [[1, 1], 5] [[1, 2], 0] [[1, 3], 0] [[1, 4], 0] [[2, 1], 0] [[2, 2], 13] [[2, 3], 2] [[2, 4], 0] [[3, 1], 0] [[3, 2], 2] [[3, 3], 9] [[3, 4], 0] [[4, 1], 0] [[4, 2], 0] [[4, 3], 0] [[4, 4], 9] (%o28) done (%i29) The truncated terms are small enough for display (%i30) for i thru dim do (ein : ratsimp(ein ), ldisplay(ein )) i, i i, i i, i 2 2 4 2 2 (%t30) ein = - (((h11 h22 - h11 ) (l ) r - 2 h33 l r ) sin (theta) 1, 1 r r r 2 2 4 2 - 2 h44 l r - h33 h44 (l ) )/(4 r sin (theta)) r r r 2 4 3 (%t31) ein = - (l (((h11 h22 - h11 ) l r + (4 h11 - 4 h22) r 2, 2 r r 2 2 4 + (h11 - h22) h33 l r - 4 h33 r - h33 l ) sin (theta) r r 2 2 2 + ((h11 - h22) h44 l r - 4 h44 r - h33 h44 l ) sin (theta) - h44 l )) r r r 4 4 /(4 r sin (theta)) 4 3 2 2 (%t32) ein = - ((2 h11 l r + (2 h11 - 2 h22) l r - h22 h33 (l ) r 3, 3 r r r r 2 2 2 2 2 - 2 h33 l r - h33 (l ) ) sin (theta) + (h11 h44 (l ) - 2 h44 l ) r r r r r r 4 2 + 2 h44 l r)/(4 r sin (theta)) r 4 3 (%t33) ein = - ((2 h11 l r + (2 h11 - 2 h22) l r 4, 4 r r r 2 2 4 + (h11 h33 (l ) - 2 h33 l ) r + 2 h33 l r) sin (theta) r r r r 2 2 2 2 2 + (- h22 h44 (l ) r - 2 h44 l r) sin (theta) - h44 (l ) ) r r r 4 4 /(4 r sin (theta)) (%o33) done INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) a; batching /home/vttoth/dev/maxima/share/tensor/atensor.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('atensor, 'version) = false then load(atensor) (%o1) /home/vttoth/dev/maxima/share/tensor/atensor.mac (%i2) ATENSOR can simplify noncommutative products in various algebras. (%i3) Let us begin with a Clifford algebra (%i4) init_atensor(clifford) (%o4) done (%i5) atensimp(u . u) (%o5) sf(u, u) (%i6) atensimp(u . v - v . u) (%o6) 2 (u . v) - 2 sf(u, v) (%i7) Here is the symplectic algebra (%i8) init_atensor(symplectic) (%o8) done (%i9) atensimp(v . u + u . v) (%o9) 2 (u . v) - 2 af(u, v) (%i10) The function af is an antisymmetric scalar-valued function. (%i11) atensimp(w . (u . v)) (%o11) - 2 u af(v, w) - 2 af(u, w) v + u . v . w (%i12) A Clifford algebra of positive dimension 3 is defined as (%i13) init_atensor(clifford, 3) (%o13) done (%i14) The symbol used for base vectors is stored in asymbol (%i15) asymbol (%o15) v (%i16) atensimp(v . v ) 1 1 (%o16) 1 (%i17) ATENSOR knows about predefined algebras, such as quaternions (%i18) init_atensor(quaternion) (%o18) done (%i19) Quaternions are defined as a Clifford algebra of 2 negative dimensions (%i20) adim (%o20) 2 (%i21) The antisymmetric function af() takes its values from the matrix aform (%i22) aform [ - 1 0 ] (%o22) [ ] [ 0 - 1 ] (%i23) Quaternionic units are v[1], v[2], and v[1].v[2] (%i24) atensimp(v . v ) 1 1 (%o24) - 1 (%i25) atensimp(v . v ) 2 2 (%o25) - 1 (%i26) atensimp((v . v ) . (v . v )) 1 2 1 2 (%o26) - 1 (%i27) We can even construct the quaternionic multiplication table: (%i28) q : zeromatrix(4, 4) [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%o28) [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i29) q : 1 1, 1 (%o29) 1 (%i30) for i thru adim do q : q : v 1, 1 + i 1 + i, 1 i (%o30) done (%i31) q : q : v . v 1, 4 4, 1 1 2 (%o31) v . v 1 2 (%i32) for i from 2 thru 4 do (for j from 2 thru 4 do q : atensimp(q . q )) i, j i, 1 1, j (%o32) done (%i33) q [ 1 v v v . v ] [ 1 2 1 2 ] [ ] [ v - 1 v . v - v ] [ 1 1 2 2 ] (%o33) [ ] [ v - v . v - 1 v ] [ 2 1 2 1 ] [ ] [ v . v v - v - 1 ] [ 1 2 2 1 ] (%i34) Scalar variables are treated appropriately (%i35) declare([a, b], scalar) (%o35) done (%i36) atensimp((b (v . v ) + a) . (v . v )) 1 2 1 2 (%o36) (v . v ) a - b 1 2 (%i37) Verify the Jacobi-identity for Lie algebras (%i38) init_atensor(lie_envelop) (%o38) done (%i39) Let's define the Lie-bracket (%i40) lbr(u, v) := u . v - v . u (%o40) lbr(u, v) := u . v - v . u (%i41) atensimp(lbr(u, lbr(v, w))) (%o41) 2 (u . av(v, w)) - 2 (u . av(v, w) - 2 av(u, av(v, w))) (%i42) atensimp(lbr(v, lbr(w, u))) (%o42) 2 (av(u, w) . v) - 2 (av(u, w) . v - 2 av(av(u, w), v)) (%i43) atensimp(lbr(w, lbr(u, v))) (%o43) 2 (av(u, w) . v - 2 av(av(u, w), v)) - 2 (av(u, w) . v) + 2 (u . av(v, w) - 2 av(u, av(v, w))) - 2 (u . av(v, w)) (%i44) %th(1) + %th(2) + %th(3) (%o44) 0 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 1; batching /home/vttoth/dev/maxima/share/tensor/bianchi.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) The curvature tensor satisfies the cyclic identity: (%i3) icurvature([l, j, k], [i]) + icurvature([k, l, j], [i]) + icurvature([j, k, l], [i]) (%i4) ishow(%) i i %3 i i %3 (%t4) - ichr2 - ichr2 ichr2 + ichr2 + ichr2 ichr2 l k,j %3 j l k l j,k %3 k l j i i %2 i i %2 + ichr2 + ichr2 ichr2 - ichr2 - ichr2 ichr2 k l,j %2 j k l k j,l %2 l k j i i %1 i i %1 - ichr2 - ichr2 ichr2 + ichr2 + ichr2 ichr2 j l,k %1 k j l j k,l %1 l j k (%i5) canform(%) (%o5) 0 (%i6) And the Bianchi identity: (%i7) canform(covdiff(icurvature([j, m, k], [i]), l) + covdiff(icurvature([j, l, m], [i]), k) + covdiff(icurvature([j, k, l], [i]), m)) (%o7) 0 (%i8) A consequence is that the Einstein-tensor is divergence-free (%i9) We prove this for a conformal metric in the weak field: (%i10) remcomps(g) (%o10) done (%i11) imetric(g) (%o11) done (%i12) declare(e, constant) (%o12) done (%i13) defcon(e, e, kdelta) (%o13) done (%i14) defcon(e, p, p) (%o14) done (%i15) defcon(p, e, p) (%o15) done (%i16) remsym(e, 0, 2) (%o16) done (%i17) decsym(e, 0, 2, [], [sym(all)]) (%o17) done (%i18) (ratfac : false, ratvars(l), ratweight(l, 1), ratwtlvl : 1) (%o18) 1 (%i19) components(g([i, j], []), 2 l p([i, j], []) + e([i, j], [])) (%o19) done (%i20) components(g([], [i, j]), e([], [i, j]) - 2 l p([], [i, j])) (%o20) done (%i21) ishow(g([i, j], [])) (%t21) 2 p l + e i j i j (%i22) ishow(g([], [i, j])) i j i j (%t22) e - 2 p l (%i23) scurv : g([], [r, t]) icurvature([r, s, t], [s]) (%i24) ricci : g([], [i, r]) g([], [j, t]) icurvature([r, s, t], [s]) (%i25) canform(rename(contract(ratexpand(ev(- (ricci scurv g([], [i, j]) - -------------------)))))) 2 (%i26) ishow(%) %1 j %2 i %3 %2 %3 i j %1 %1 %2 j i (%t26) - e e p l + e e p l - e p l %3,%1 %2 %1,%2 %3 ,%1 %2 %1 %2 i j %1 j %2 i %1 j %2 i - p e l + e p l + p e l ,%1 %2 ,%1 %2 ,%1 %2 (%i27) covdiff(%, j) (%i28) ev(%, ichr2) (%i29) ishow(canform(contract(ratexpand(%)))) (%t29) 0 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 2; batching /home/vttoth/dev/maxima/share/tensor/car_iden.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) (showtime : true, dummyx : z, allsym : false) Evaluation took 0.0000 seconds (0.0001 elapsed) using 120 bytes. (%i3) decsym(a, 2, 0, [anti(all)], []) Evaluation took 0.0000 seconds (0.0002 elapsed) using 2.469 KB. (%o3) done (%i4) decsym(a, 3, 0, [anti(all)], []) Evaluation took 0.0000 seconds (0.0002 elapsed) using 2.477 KB. (%o4) done (%i5) decsym(a, 4, 0, [anti(all)], []) Evaluation took 0.0000 seconds (0.0001 elapsed) using 2.484 KB. (%o5) done (%i6) decsym(a, 5, 0, [anti(all)], []) Evaluation took 0.0000 seconds (0.0001 elapsed) using 2.492 KB. (%o6) done (%i7) canform(liediff(v, extdiff(a([i1, i2]), i3)) - extdiff(liediff(v, a([i1, i2])), i3)) Evaluation took 0.1520 seconds (0.1534 elapsed) using 1.952 MB. (%o7) 0 (%i8) canform(liediff(v, extdiff(a([i1, i2, i3]), i4)) - extdiff(liediff(v, a([i1, i2, i3])), i4)) Evaluation took 0.7360 seconds (0.7381 elapsed) using 8.011 MB. (%o8) 0 (%i9) canform(liediff(v, extdiff(a([i1, i2, i3, i4]), i5)) - extdiff(liediff(v, a([i1, i2, i3, i4])), i5)) Evaluation took 4.9723 seconds (5.0138 elapsed) using 47.816 MB. (%o9) 0 (%i10) canform(liediff(v, extdiff(a([i1, i2, i3, i4, i5]), i6)) - extdiff(liediff(v, a([i1, i2, i3, i4, i5])), i6)) Evaluation took 44.9308 seconds (45.0317 elapsed) using 368.881 MB. (%o10) 0 (%i11) showtime : false (%o11) false INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 3; batching /home/vttoth/dev/maxima/share/tensor/kaluza.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Deriving the Kaluza-Klein equation of motion. For reference, see http://www.vttoth.com/KK/kk.htm (%i2) We first load ITENSOR and set up the 5-dimensional metric. We also set up contraction properties for both the 4-dimensional and the 5-dimensional metric tensors. (%i3) if get('itensor, 'version) = false then load(itensor) (%o3) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i4) (derivabbrev : true, dim : 5, imetric : g5, defcon(g4), defcon(g5), defcon(g4, g4, kdelta), defcon(g5, g5, kdelta)) (%i5) To set up the metric components, we need some helper functions. The function predval() determines if a predicate can be evaluated. It returns false if the predicate would return an error. The function difflist() applies the differential operator to elements in a list. (%i6) predval(prd) := block([retval, saved_prederror : prederror], prederror : false, retval : (ev(prd, pred) = true) or (ev(prd, pred) = false), prederror : saved_prederror, retval) (%i7) difflist(exp, lst) := if length(lst) = 0 then exp else difflist(idiff(exp, lst ), rest(lst)) 1 (%i8) Metric components are defined conditionally, allowing us to treat the fifth index in a unique way. (%i9) a(l1, l2, [l3]) := if member(5, l3) then 0 else funmake('a, append([l1, l2], l3)) (%i10) g4(l1, l2, [l3]) := if member(5, l3) then 0 else funmake('g4, append([l1, l2], l3)) (%i11) g5(l1, l2, [l3]) := if member(5, l3) then 0 else (if l1 # [] then (if not (predval(l1 <= 4) and predval(l1 <= 4)) 1 2 then funmake('g5, append([l1, l2], l3)) else (if (l1 <= 4) and (l1 <= 4) then g55 1 2 difflist(a([l1 ], []) a([l1 ], []), l3) + apply('g4, append([l1, l2], l3)) 1 2 else (if l1 <= 4 then g55 apply('a, append([[l1 ], []], l3)) 1 1 else (if l1 <= 4 then g55 apply('a, append([[l1 ], []], l3)) 2 2 else (if l3 # [] then 0 else g55))))) else (if l2 # [] then (if not (predval(l2 <= 4) and predval(l2 <= 4)) 1 2 then funmake('g5, append([l1, l2], l3)) else (if (l2 <= 4) and (l2 <= 4) then apply('g4, append([l1, l2], l3)) 1 2 else (if l2 <= 4 then - apply('a, append([[], [l2 ]], l3)) 1 1 else (if l2 <= 4 then - apply('a, append([[], [l2 ]], l3)) 2 2 else (if l3 # [] then sum(difflist(a([i], []) a([], [i]), l3), i, 1, 4) 1 else sum(a([i], []) a([], [i]), i, 1, 4) + ---))))) g55 else funmake('g5, append([l1, l2], l3)))) (%i12) Now we're ready to begin the analysis. First, we predeclare some 4-dimensional indices: (%i13) assume(k <= 4, l <= 4, m <= 4) (%i14) The equation of motion in empty 5-space: (%i15) depends(x, t) (%o15) [x(t)] (%i16) ishow(ichr2([b, c], [a]) x([], [b]) x([], [c]) + x([], [a]) = 0) t t t t b c a a (%t16) (x ) (x ) ichr2 + (x ) = 0 t t b c t t (%i17) ishow(part(first(%), 1)) b c a (%t17) (x ) (x ) ichr2 t t b c (%i18) ishow(subst(5, c, %) + subst(m, c, %)) b m a 5 b a (%t18) (x ) (x ) ichr2 + (x ) (x ) ichr2 t t b m t t b 5 (%i19) ishow(part(first(%th(3)), 2) + subst(5, b, %) + subst(l, b, %) = last(%th(3))) l m a 5 l a a 5 m (%t19) (x ) (x ) ichr2 + (x ) (x ) ichr2 + ichr2 (x ) (x ) t t l m t t l 5 5 m t t a a 5 2 + (x ) + ichr2 ((x ) ) = 0 t t 5 5 t (%i20) We are only interested in the case where A is a 4D index: (%i21) ishow(subst(k, a, %th(2))) l m k 5 l k k 5 m (%t21) (x ) (x ) ichr2 + (x ) (x ) ichr2 + ichr2 (x ) (x ) t t l m t t l 5 5 m t t k k 5 2 + (x ) + ichr2 ((x ) ) = 0 t t 5 5 t (%i22) We protect one of the Christoffel-symbols from expansion: (%i23) ishow(subst(chr2klm, ichr2([l, m], [k]), %th(2))) 5 l k l m k 5 m (%t23) (x ) (x ) ichr2 + (x ) (x ) chr2klm + ichr2 (x ) (x ) t t l 5 t t 5 m t t k k 5 2 + (x ) + ichr2 ((x ) ) = 0 t t 5 5 t (%i24) ev(%, ichr2) (%i25) ishow(rename(%)) l m k %1 5 %2 (%t25) (x ) (x ) chr2klm + g5 (x ) (x ) (g5 - g55 a ) t t t t 5 %1,%2 %2,%1 k + (x ) = 0 t t (%i26) Now we break this up into two parts depending on whether %1=5: (%i27) map(lambda([u], block(if freeof(%1, u) then u else subst(5, %1, u) + u)), first(%th(2))) = last(%th(2)) (%i28) assume(%1 <= 4) (%i29) ev(%th(2), g5) (%i30) ev(%, nouns) (%i31) ishow(%) k %1 5 %2 l m (%t31) g4 (x ) (x ) (a g55 - a g55) + (x ) (x ) chr2klm t t %1,%2 %2,%1 t t k + (x ) = 0 t t (%i32) Now we're ready to isolate the electromagnetic field tensor: (%i33) map(lambda([u], factorout(u, g55)), %th(2)) (%i34) ishow(ratsubst(- f([%1, %2], []), a([%1], [], %2) - a([%2], [], %1), %)) k %1 5 %2 l m k (%t34) - g4 (x ) (x ) f g55 + (x ) (x ) chr2klm + (x ) = 0 t t %1 %2 t t t t (%i35) Contracting and rearranging yields the equation in the usual form: (%i36) contract(%th(2)) (%i37) ev(%, nouns) (%i38) ishow(rename(%)) 5 %1 k l m k (%t38) - (x ) (x ) f g55 + (x ) (x ) chr2klm + (x ) = 0 t t %1 t t t t (%i39) % - part(first(%), 1) (%i40) EQ : subst(ichr2([l, m], [k]), chr2klm, %) (%i41) ishow(box(EQ)) """"""""""""""""""""""""""""""""""""""""""""""""""""""" " l m k k 5 %1 k " (%t41) "(x ) (x ) ichr2 + (x ) = (x ) (x ) f g55" " t t l m t t t t %1 " """"""""""""""""""""""""""""""""""""""""""""""""""""""" (%i42) But what about the 5D Christoffel-symbol? (%i43) ishow(ichr2([l, m], [k])) k %4 g5 (g5 - g55 (a a + a a ) - g4 + g5 ) m %4,l l m,%4 l,%4 m l m,%4 l %4,m (%t43) ------------------------------------------------------------------- 2 (%i44) rename(%) (%i45) forget(%1 <= 4) (%i46) subst(5, %1, %th(2)) (%i47) ev(%, g5, g4) (%i48) ishow(%) k a (g55 a + g55 a ) m,l l,m (%t48) - ------------------------ 2 (%i49) assume(%1 <= 4) (%i50) ev(%th(6), g5) (%i51) ratsubst(- f([%1, l], []), a([%1], [], l) - a([l], [], %1), %) (%i52) ratsubst(- f([%1, m], []), a([%1], [], m) - a([m], [], %1), %) (%i53) ishow(factor(contract(expand(%)))) k %1 k k k k %1 (%t53) (g4 g4 - g55 a f + a g55 a - g55 f a - g4 g4 m %1,l l m m,l l m l m,%1 k %1 k + g4 g4 + a g55 a )/2 l %1,m l,m (%i54) %th(6) + % (%i55) ev(%, nouns) (%i56) ratsubst(ichr42([l, m], [k]), (g4([], [k, %1]) (- g4([l, m], [], %1) + g4([l, %1], [], m) + g4([m, %1], [], l)))/2, %) (%i57) ishow(%) k k k g55 a f + g55 f a - 2 ichr42 l m l m l m (%t57) - ----------------------------------- 2 (%i58) contract(%) (%i59) The extra term is presumably the curvature caused by the EM field. (%i60) ishow(ichr2([l, m], [k]) = map(factor, combine(distrib(%th(2))))) k k g55 (a f + f a ) k k l m l m (%t60) ichr2 = ichr42 - ------------------- l m l m 2 (%i61) Or, if you wish, you can apply this result to the equation of motion: (%i62) ishow(subst(rhs(%th(2)), lhs(%th(2)), EQ)) k k g55 (a f + f a ) l m k l m l m k (%t62) (x ) (x ) (ichr42 - -------------------) + (x ) = t t l m 2 t t 5 %1 k (x ) (x ) f g55 t t %1 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 4; batching /home/vttoth/dev/maxima/share/tensor/ademo.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) The double divergence of the Riemann-tensor on its antisymmetric indices should vanish. We can prove this in geodesic coordinates: (%i2) showtime : true Evaluation took 0.0000 seconds (0.0001 elapsed) using 88 bytes. (%o2) true (%i3) if get('itensor, 'version) = false then load(itensor) Evaluation took 0.1720 seconds (0.1715 elapsed) using 2.894 MB. (%o3) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i4) remcomps(g) Evaluation took 0.0000 seconds (0.0000 elapsed) using 152 bytes. (%o4) done (%i5) imetric(g) Evaluation took 0.0000 seconds (0.0001 elapsed) using 712 bytes. (%o5) done (%i6) covdiff(icurvature([r, s, t], [u]) g([], [s, i]) g([], [t, j]), i) Evaluation took 0.0040 seconds (0.0039 elapsed) using 33.789 KB. (%i7) nterms(%) Evaluation took 0.0000 seconds (0.0002 elapsed) using 136 bytes. (%o7) 50 (%i8) rename(expand(%th(2))) Evaluation took 0.0720 seconds (0.0703 elapsed) using 415.562 KB. (%i9) igeodesic_coords(canform(rename(expand(ev(%)))), g) Evaluation took 18.3531 seconds (18.3676 elapsed) using 61.936 MB. (%i10) ishow(%) %1 u %2 %3 %4 j %1 u %2 j %3 %4 g g g g g g g g %2 r,%1 %3 %4 %2 r,%1 %3 %4 (%t10) - --------------------------------- + --------------------------------- 2 2 %1 u %2 %3 %4 j %1 u %2 j %3 %4 g g g g g g g g %1 %2,%3 %4 r %1 %2,%3 %4 r + --------------------------------- - --------------------------------- 2 2 Evaluation took 0.0000 seconds (0.0037 elapsed) using 80.055 KB. (%i11) canform(covdiff(%, j)) Evaluation took 0.1600 seconds (0.1595 elapsed) using 1.473 MB. (%i12) nterms(%) Evaluation took 0.0000 seconds (0.0002 elapsed) using 136 bytes. (%o12) 28 (%i13) rename(expand(igeodesic_coords(%th(2), g))) Evaluation took 0.0080 seconds (0.0088 elapsed) using 66.250 KB. (%o13) 0 (%i14) showtime : false (%o14) false INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 5; batching /home/vttoth/dev/maxima/share/tensor/helicity.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) (if get('itensor, 'version) = false then load(itensor), icounter : 5, idummyx : j, derivabbrev : false) (%i2) the conservation of helicity in hydrodynamics (%i3) the covariant formulation of the Euler equation is (%i4) euler : liediff(v, v([i0])) + d_t v([i1]) = v([i0]) | v - extdiff(p([]), i1) extdiff(----------- - phi([]), i1) + -------------------- 2 rho([]) (%i5) ishow(euler) j1 j1 v v v v p j1,i1 ,i1 j1 ,i1 (%t5) liediff(v, v ) + d_t v = ---------- + -------- - phi - ---- i0 i1 2 2 ,i1 rho (%i6) take the exterior derivative of both sides (%i7) euler : liediff(v, omega([i0, i1])) + d_t omega([i1, i2]) = v([i0]) | v - extdiff(p([]), i1) extdiff(extdiff(----------- - phi([]), i1) + --------------------, i2) 2 rho([]) (%i8) ishow(euler) p rho - rho p ,i1 ,i2 ,i1 ,i2 (%t8) liediff(v, omega ) + d_t omega = - ------------------------- i0 i1 i1 i2 2 2 rho (%i9) ishow(omega([i1, i2]) = extdiff(v([i1]), i2)) v - v i2,i1 i1,i2 (%t9) omega = --------------- i1 i2 2 (%i10) declare the function's dependencies (%i11) depends(p, [rho, s]) (%i12) define the chain rule for the derivatives' replacement (%i13) matchdeclare(i, symbolp) (%o13) done dp (%i14) defrule(p_r, p([], [], i), ---- rho([], [], i)) drho dp (%o14) p_r : p([], [], i) -> rho([], [], i) ---- drho dp dp (%i15) defrule(p_sr, p([], [], i), ---- rho([], [], i) + -- s([], [], i)) drho ds dp dp (%o15) p_sr : p([], [], i) -> s([], [], i) -- + rho([], [], i) ---- ds drho (%i16) apply the rules (%i17) ishow(ratsimp(apply1(euler, p_r))) (%t17) liediff(v, omega ) + d_t omega = 0 i0 i1 i1 i2 (%i18) this law was originally discovered by Lord Kelvin (%i19) for the more general case there is Ertel's theorem (%i20) apply another rule where pressure depends on both rho and the entropy (%i21) euler : factor(expand(apply1(euler, p_sr))) (%i22) ishow(euler) dp (rho s - s rho ) -- ,i1 ,i2 ,i1 ,i2 ds (%t22) liediff(v, omega ) + d_t omega = ------------------------------ i0 i1 i1 i2 2 2 rho (%i23) The RHS vanishes after forming the exterior product with the differential of the entropy (%i24) rhs(euler) ~ extdiff(s([]), i3) (%i25) ishow(lhs(euler) = factor(expand(apply1(%, p_sr)))) (%t25) liediff(v, omega ) + d_t omega = 0 i0 i1 i1 i2 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 6; batching /home/vttoth/dev/maxima/share/tensor/plasma.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) Examine magnetic field lines embedded in moving plasma (%i3) introduce the 2-form describing the magnetic field (%i4) decsym(B, 2, 0, [anti(all)], []) (%o4) done (%i5) Due to infinite conductivity the electric field is expressed as (%i6) E1 : ishow(B([i1, i2]) | v) %1 (%t6) v B %1 i2 (%i7) But we can also express it through the vector potential (%i8) E2 : ishow(expand(2 (extdiff(A([i1]), i2) | v))) %1 %1 (%t8) v A - v A i2,%1 %1,i2 (%i9) and put this result in the following equation: (%i10) EQ1 : ishow(dt B([i1, i2]) = extdiff(E2, i1)) %3 %3 v A - v A ,i1 %3,i2 ,i2 %3,i1 (%t10) dt B = ------------------------- i1 i2 2 %3 %3 %3 %3 v A + v A - v A - v A i2,%3 i1 ,i1 i2,%3 i1,%3 i2 ,i2 i1,%3 - --------------------------------------------------------- 2 (%i11) Now compute the Lie-derivative of B (%i12) EQ2 : ishow(liediff(v, B([i2, i1])) = liediff(v, extdiff(A([i1]), i2))) %10 %10 %9 (%t12) liediff(v, B ) = (v A + v A - v A i2 i1 i2,%10 i1 ,i1 i2,%10 i1,%9 i2 %9 %9 %10 - v A - v A + v A )/2 ,i2 i1,%9 ,i1 %9,i2 ,i2 %10,i1 (%i13) and sum up the LHS and RHS (%i14) ishow(lhs(EQ2) + lhs(EQ1) = rename(expand(rhs(EQ2) + rhs(EQ1)))) (%t14) liediff(v, B ) + dt B = 0 i2 i1 i1 i2 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 7; batching /home/vttoth/dev/maxima/share/tensor/spinor.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) We are working with a spinor base, which is two dimensional (%i3) dim : 2 (%o3) 2 (%i4) The epsilon-spinor is antisymmetric and contracts to the Kronecker-delta (%i5) defcon(e) (%o5) done (%i6) defcon(e, e, kdelta) (%o6) done (%i7) remsym(e, 2, 0) (%o7) done (%i8) remsym(e, 0, 2) (%o8) done (%i9) decsym(e, 2, 0, [anti(all)], []) (%o9) done (%i10) decsym(e, 0, 2, [], [anti(all)]) (%o10) done (%i11) Verifying the epsilon-spinor's properties (%i12) ishow(e([A, B], []) e([], [B, C])) B C (%t12) e e A B (%i13) ishow(contract(%)) C (%t13) - kdelta A (%i14) ishow(e([A, B], []) e([], [C, B])) C B (%t14) e e A B (%i15) ishow(contract(%)) C (%t15) kdelta A (%i16) ishow(contract(e([A], [A]))) (%t16) kdelta (%i17) ev(%, kdelta) (%o17) 2 (%i18) h is a spinor representing, for instance, a Lorentz transform (%i19) defcon(h, h, kdelta) (%o19) done (%i20) ev(h([A, B], []) h([], [A, B]), noeval) (%i21) ishow(%) A B (%t21) h h A B (%i22) ishow(LHS : contract(%)) (%t22) 2 (%i23) We split h into symmetric and antisymmetric parts: (%i24) decsym(f, 2, 0, [sym(all)], []) (%o24) done (%i25) decsym(f, 0, 2, [], [sym(all)]) (%o25) done (%i26) remcomps(h) (%o26) done (%i27) components(h([A, B], []), f([A, B], []) + a e([A, B], [])) (%o27) done (%i28) Now we compute the upper-index components of h (%i29) ishow(contract(h([A, B], []) e([], [A, D]))) A D (%t29) e (f + a e ) A B A B (%i30) ishow(contract(expand(%))) D D (%t30) f + a kdelta B B (%i31) ishow(contract(% e([], [C, B]))) C B D D (%t31) e (f + a kdelta ) B B (%i32) ishow(contract(expand(%))) C D C D (%t32) e a - f (%i33) components(h([], [C, D]), %) (%o33) done (%i34) We can now contract h with itself and evaluate (%i35) ishow(h([A, B], []) h([], [A, B])) A B A B (%t35) (e a - f ) (f + a e ) A B A B (%i36) ishow(RHS : contract(expand(%))) 2 A B (%t36) 2 a - f f A B (%i37) And get a simple identity for Lorentz transforms in a spinor base: LHS = RHS (%i38) ishow(ev(distrib(---------))) 2 A B f f 2 A B (%t38) 1 = a - --------- 2 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 8; batching /home/vttoth/dev/maxima/share/tensor/maxwell.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) idim(4) (%o2) done (%i3) imetric(g) (%o3) done (%i4) decsym(g, 2, 0, [sym(all)], []) (%o4) done (%i5) decsym(g, 0, 2, [], [sym(all)]) (%o5) done (%i6) The EM field tensor is the exterior derivative of a vector field (%i7) remcomps(F) (%o7) done (%i8) components(F([i, j], []), extdiff(A([i], []), j)) (%o8) done (%i9) components(F([], [i, j]), F([k, l], []) g([], [i, k]) g([], [j, l])) (%o9) done (%i10) showcomps(F([i, j], [])) [ A - A A - A A - A ] [ 1,2 2,1 1,3 3,1 1,4 4,1 ] [ 0 ----------- ----------- ----------- ] [ 2 2 2 ] [ ] [ A - A A - A A - A ] [ 2,1 1,2 2,3 3,2 2,4 4,2 ] A - A [ ----------- 0 ----------- ----------- ] j,i i,j [ 2 2 2 ] (%t10) ----------- = [ ] 2 [ A - A A - A A - A ] [ 3,1 1,3 3,2 2,3 3,4 4,3 ] [ ----------- ----------- 0 ----------- ] [ 2 2 2 ] [ ] [ A - A A - A A - A ] [ 4,1 1,4 4,2 2,4 4,3 3,4 ] [ ----------- ----------- ----------- 0 ] [ 2 2 2 ] (%o10) false (%i11) Two of Maxwell's equations reduce to simple geometric identities (%i12) ishow(extdiff(F([i, j], []), k) = extdiff(F([i, j], []), k)) (%t12) extdiff(F , k) = 0 i j (%i13) The other two Maxwell equations define the 4-current (%i14) remcomps(J) (%o14) done (%i15) components(J([], [i]), idiff(F([], [i, j]), j)) (%o15) done (%i16) We limit ourselves to the constant metric of special relativity... (%i17) declare(g, constant) (%o17) done (%i18) Here, the 4-current satisfies a conservation equation (%i19) covdiff(J([], [i]), i) (%i20) ev(%, ichr2) (%i21) undiff(%) (%i22) ev(%, idiff) (%i23) canform(%) (%i24) rename(%) (%o24) 0 (%i25) The EM field tensor is invariant under a gauge transformation. (%i26) We can add the gradient of an arbitrary scalar function to A: (%i27) extdiff(f([], [], i) + A([i], []), j) - F([i, j], []) (%o27) 0 (%i28) The dual of the EM field tensor shall be denoted xF here: (%i29) remcomps(xF) (%o29) done (%i30) components(xF([a, b], []), levi_civita([a, b, c, d], []) F([], [c, d])) (%o30) done (%i31) We also define mixed-index components (%i32) components(F([a], [b]), F([a, c], []) g([], [b, c])) (%o32) done (%i33) components(xF([a], [b]), xF([a, c], []) g([], [b, c])) (%o33) done (%i34) This is what we need to define the energy-momentum tensor (%i35) remcomps(T) (%o35) done (%i36) components(T([a, b], []), xF([a, c], []) xF([b], [c]) + F([a, c], []) F([b], [c]) ------------------------------------------------------- 8 -------------------------------------------------------) %pi (%o36) done (%i37) components(T([a], [b]), T([a, c], []) g([], [b, c])) (%o37) done (%i38) components(T([], [a, b]), T([c], [b]) g([], [a, c])) (%o38) done (%i39) T satisfies the equation T_[a,b;c] = 0 (%i40) - covdiff(canform(T([a, c], [])), b) + covdiff(canform(T([c, a], [])), b) - covdiff(canform(T([c, b], [])), a) + covdiff(canform(T([b, c], [])), a) - covdiff(canform(T([b, a], [])), c) + covdiff(canform(T([a, b], [])), c) (%i41) ev(%, ichr2) (%i42) undiff(%) (%i43) ev(%, idiff) (%i44) canform(%) (%o44) 0 (%i45) The energy-momentum tensor is symmetric in its indices (%i46) remove(g, constant) (%o46) done (%i47) T([a, b], []) - T([b, a], []) (%i48) canform(lc2kdt(%)) (%i49) ev(%, kdelta) (%i50) canform(rename(contract(expand(%)))) (%o50) 0 (%i51) Let us examine the 4-current again (%i52) declare(g, constant) (%o52) done (%i53) rename(J([], [a])) (%i54) undiff(%) (%i55) ev(%, idiff) (%i56) ishow(rename(%)) %1 %2 a %3 g g (A - A ) %2,%1 %3 %3,%1 %2 (%t56) ------------------------------------ 2 (%i57) In empty space, the 4-current is identically zero. (%i58) This can only happen if A([a],[],b,c)-A([b],[],a,c)=0. (%i59) In this case, the energy-momentum tensor should be conserved (%i60) covdiff(T([a], [b]), b) (%i61) ev(%, ichr2) (%i62) undiff(%) (%i63) ev(%, idiff) (%i64) canform(lc2kdt(%)) (%i65) ev(%, kdelta) (%i66) canform(%) (%i67) ishow(canform(rename(contract(expand(%))))) %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%3 a,%1 %2 ,%3 a,%1 %2 (%t67) --------------------------- - ----------------------- 8 %pi 32 %pi %1 %3 %2 %1 %3 %2 kdelta g A A 13 g A A ,%3 a,%1 %2 ,%3 a,%1 %2 - --------------------------- + ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%2 %3 a,%1 ,%2 %3 a,%1 + --------------------------- - ----------------------- 8 %pi 32 %pi %1 %3 %2 %1 %3 %2 %1 %2 %3 kdelta g A A 13 g A A A g A ,%2 %3 a,%1 ,%2 %3 a,%1 ,%2 %3 %1,a - --------------------------- + ----------------------- + -------------------- 8 %pi 32 %pi 16 %pi %1 %2 %3 %1 %2 %3 kdelta A g A 11 A g A ,%2 a %1,%3 ,%2 a %1,%3 + --------------------------- - ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 %1 %2 kdelta A g A 11 A g A kdelta A A ,a %1,%2 %3 ,a %1,%2 %3 ,a ,%1 %2 - --------------------------- + ----------------------- + ------------------ 8 %pi 32 %pi 8 %pi %1 %2 %1 %2 %1 %2 13 A A kdelta A A 11 A A ,a ,%1 %2 ,%2 a ,%1 ,%2 a ,%1 - -------------- - ------------------ + -------------- 32 %pi 8 %pi 32 %pi (%i68) Let us apply what we learned about the 4-current: (%i69) subst(A([%2], [], a, %1), A([a], [], %1, %2), %th(2)) (%i70) canform(%) (%i71) ishow(contract(%)) %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%2 %3 a,%1 ,%2 %3 a,%1 (%t71) --------------------------- - ----------------------- 8 %pi 32 %pi %1 %3 %2 %1 %3 %2 %1 %2 %3 kdelta g A A 13 g A A A g A ,%2 %3 a,%1 ,%2 %3 a,%1 ,%2 %3 %1,a - --------------------------- + ----------------------- + -------------------- 8 %pi 32 %pi 16 %pi %1 %2 %3 %1 %2 %3 kdelta A g A 11 A g A ,%2 a %1,%3 ,%2 a %1,%3 + --------------------------- - ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%3 %1,%2 a ,%3 %1,%2 a - --------------------------- + ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 %2 %3 kdelta A g A 11 A g A kdelta A A ,a %1,%2 %3 ,a %1,%2 %3 ,%3 ,%2 a - --------------------------- + ----------------------- + ------------------ 8 %pi 32 %pi 8 %pi %2 %3 %1 %2 %1 %2 %1 %2 13 A A kdelta A A 13 A A kdelta A A ,%3 ,%2 a ,a ,%1 %2 ,a ,%1 %2 ,%2 a ,%1 - -------------- + ------------------ - -------------- - ------------------ 32 %pi 8 %pi 32 %pi 8 %pi %1 %2 11 A A ,%2 a ,%1 + -------------- 32 %pi (%i72) and apply it again, resolving subexpressions 'by hand' (%i73) ratsubst(A([], [%3], %2, a) g([], [%1, %2]), A([], [%1], %2, a) g([], [%2, %3]), %th(2)) (%i74) ishow(canform(contract(expand(%)))) %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%2 %3 a,%1 ,%2 %3 a,%1 (%t74) --------------------------- - ----------------------- 8 %pi 32 %pi %1 %3 %2 %1 %3 %2 %1 %2 %3 kdelta g A A 13 g A A A g A ,%2 %3 a,%1 ,%2 %3 a,%1 ,%2 %3 %1,a - --------------------------- + ----------------------- + -------------------- 8 %pi 32 %pi 16 %pi %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%3 %1,%2 a ,%3 %1,%2 a - --------------------------- + ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 %1 %2 kdelta A g A 11 A g A kdelta A A ,a %1,%2 %3 ,a %1,%2 %3 ,a ,%1 %2 - --------------------------- + ----------------------- + ------------------ 8 %pi 32 %pi 8 %pi %1 %2 %1 %2 %1 %2 13 A A kdelta A A 13 A A ,a ,%1 %2 ,%2 a ,%1 ,%2 a ,%1 - -------------- + ------------------ - -------------- 32 %pi 8 %pi 32 %pi (%i75) ratsubst(A([], [%3], %2, %3) g([], [%1, %2]), A([], [%1], %2, %3) g([], [%2, %3]), %) (%i76) ishow(canform(contract(expand(%)))) %1 %2 %3 %1 %2 %3 kdelta A g A 13 A g A ,%3 %1,%2 a ,%3 %1,%2 a (%t76) - --------------------------- + ----------------------- 8 %pi 32 %pi %1 %2 %3 %1 %2 %3 %1 %2 kdelta A g A 11 A g A kdelta A A ,a %1,%2 %3 ,a %1,%2 %3 ,a ,%1 %2 - --------------------------- + ----------------------- + ------------------ 8 %pi 32 %pi 8 %pi %1 %2 %1 %2 %1 %2 11 A A kdelta A A 13 A A ,a ,%1 %2 ,%2 a ,%1 ,%2 a ,%1 - -------------- + ------------------ - -------------- 32 %pi 8 %pi 32 %pi (%i77) subst(A([%2], [], %1, a), A([%1], [], %2, a), %) (%i78) subst(A([%2], [], %1, %3), A([%1], [], %2, %3), %) (%i79) and we find that energy is, indeed, conserved for a free EM field: (%i80) canform(contract(%th(2))) (%o80) 0 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 9; batching /home/vttoth/dev/maxima/share/tensor/hodge.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Using the hodge() function (%i2) if get('itensor, 'version) = false then load(itensor) (%o2) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i3) We set up a standard metric (%i4) imetric(g) (%o4) done (%i5) dim : 4 (%o5) 4 (%i6) To avoid index conflicts, choose a suitable counter value (%i7) icounter : 100 (%o7) 100 (%i8) Declare the antisymmetric properties of a 3-form (%i9) decsym(A, 3, 0, [anti(all)], []) (%i10) Now compute the dual of the 3-form (%i11) ishow(A([i, j, k], [])) (%t11) A i j k (%i12) ishow(canform(hodge(%))) %1 %2 %3 %4 levi_civita g A %1 %102 %2 %3 %4 (%t12) ----------------------------------------- 6 (%i13) And compute the dual again (%i14) ishow(canform(hodge(%th(2)))) %1 %2 %3 %4 %5 %6 %7 %8 (%t14) - (levi_civita levi_civita g g %1 %108 %106 %3 g g A )/6 %107 %2 %4 %5 %6 %7 %8 (%i15) After simplification, we should get back the original 3-form up to sign (%i16) lc2kdt(%th(2)) (%i17) ev(%, kdelta) (%i18) ishow(canform(contract(expand(%)))) (%t18) - A %106 %107 %108 (%i19) The sign is (-1)^(p*(n-p)), in this case -1^3, which is correct. (%i20) Let's try another example (%i21) decsym(F, 2, 0, [anti(all)], []) (%i22) ishow(F([i, j], [])) A - A j,i i,j (%t22) ----------- 2 (%i23) ishow(canform(hodge(%))) %1 %2 %3 %4 levi_civita g g A %1 %116 %115 %2 %3,%4 (%t23) ----------------------------------------------- 4 %1 %2 %3 %4 levi_civita g g A %1 %116 %115 %2 %4,%3 - ----------------------------------------------- 4 (%i24) ishow(canform(hodge(%))) %1 %2 %3 %4 %5 %6 %7 %8 (%t24) (levi_civita levi_civita g g g %1 %120 %119 %2 %3 %5 %1 %2 %3 %4 %5 %6 %7 %8 g A )/8 - (levi_civita levi_civita g %4 %6 %8,%7 %1 %120 g g g A )/8 %119 %2 %3 %5 %4 %6 %7,%8 (%i25) lc2kdt(%) (%i26) ev(%, kdelta) (%i27) ishow(canform(contract(expand(%)))) A A %119,%120 %120,%119 (%t27) ---------- - ---------- 2 2 (%i28) And here's the Hodge star of the exterior product of two vectors (%i29) ishow(v([i], []) w([j], []) - v([j], []) w([i], [])) (%t29) v w - w v i j i j (%i30) ishow(canform(hodge(%))) %1 %2 %3 %4 levi_civita g g w v %1 %132 %131 %2 %3 %4 (%t30) ------------------------------------------------ 2 %1 %2 %3 %4 levi_civita g g v w %1 %132 %131 %2 %3 %4 - ------------------------------------------------ 2 (%i31) ishow(canform(hodge(%))) %1 %2 %3 %4 %5 %6 %7 %8 (%t31) (levi_civita levi_civita g g g %1 %136 %135 %2 %3 %5 %1 %2 %3 %4 %5 %6 %7 %8 g v w )/4 - (levi_civita levi_civita g %4 %6 %7 %8 %1 %136 g g g w v )/4 %135 %2 %3 %5 %4 %6 %7 %8 (%i32) lc2kdt(%) (%i33) ev(%, kdelta) (%i34) ishow(canform(contract(expand(%)))) (%t34) w v - v w %135 %136 %135 %136 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) a; batching /home/vttoth/dev/maxima/share/tensor/weyl.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Exploring the Riemann and Weyl tensors (%i2) if get('itensor, 'version) = false then load(itensor) (%o2) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i3) Define a standard metric (%i4) remcomps(g) (%o4) done (%i5) imetric(g) (%o5) done (%i6) decsym(g, 2, 0, [sym(all)], []) (%o6) done (%i7) decsym(g, 0, 2, [], [sym(all)]) (%o7) done (%i8) Let us prove some basic identities of the curvature tensor (%i9) ishow(icurvature([i, k, j], [l]) + icurvature([i, j, k], [l])) l %2 l %1 l %2 (%t9) ichr2 ichr2 - ichr2 ichr2 - ichr2 ichr2 %2 j i k %1 j i k %2 k i j l %1 + ichr2 ichr2 %1 k i j (%i10) canform(%) (%o10) 0 (%i11) ishow(icurvature([k, i, j], [l]) + icurvature([j, k, i], [l]) + icurvature([i, j, k], [l])) l l %5 l l %5 (%t11) - ichr2 - ichr2 ichr2 + ichr2 + ichr2 ichr2 k j,i %5 i k j k i,j %5 j k i l l %4 l l %4 + ichr2 + ichr2 ichr2 - ichr2 - ichr2 ichr2 j k,i %4 i j k j i,k %4 k j i l l %3 l l %3 - ichr2 - ichr2 ichr2 + ichr2 + ichr2 ichr2 i k,j %3 j i k i j,k %3 k i j (%i12) ev(%, ichr2) (%i13) Sometimes we need to simplify repeatedly... (%i14) canform(%th(2)) (%i15) nterms(%) (%o15) 126 (%i16) canform(contract(rename(%th(2)))) (%i17) nterms(%) (%o17) 16 (%i18) canform(contract(rename(%th(2)))) (%o18) 0 (%i19) Now define the covariant Riemann-tensor (%i20) remcomps(R) (%o20) done (%i21) kill(R) (%o21) done (%i22) components(R([i, j, k, l], []), icurvature([i, j, k], [m]) g([l, m], [])) (%o22) done (%i23) which is antisymmetric in its middle two indices (%i24) R([i, k, j, l], []) + R([i, j, k, l], []) (%i25) ev(%, icurvature) (%i26) ev(%, ichr2) (%i27) canform(contract(contract(expand(%)))) (%i28) canform(contract(rename(%))) (%o28) 0 (%i29) decsym(R, 4, 0, [anti(2, 3)], []) (%o29) done (%i30) and also antisymmetric in its first and last index (%i31) R([l, j, k, i], []) + R([i, j, k, l], []) (%i32) ev(%, icurvature) (%i33) canform(contract(rename(%))) (%i34) ev(%, ichr2) (%i35) canform(contract(canform(simpmetderiv(canform(%))))) (%i36) canform(contract(rename(%))) (%i37) allsym : true (%o37) true (%i38) canten(%th(2)) (%o38) 0 (%i39) allsym : false (%o39) false (%i40) decsym(R, 4, 0, [anti(1, 4)], []) (%o40) done (%i41) But it is equal to itself with the first and last index pair swapped (%i42) ev(R([i, j, k, l], []) - R([j, i, l, k], []), noeval) (%o42) R([i, j, k, l], []) - R([j, i, l, k], []) (%i43) ishow(canform(%)) (%t43) R - R i j k l j i l k (%i44) ev(%, R) (%i45) ev(%, icurvature) (%i46) canform(contract(rename(%))) (%i47) ev(%, ichr2) (%i48) canform(contract(canform(simpmetderiv(canform(%))))) (%i49) canform(contract(rename(%))) (%i50) allsym : true (%o50) true (%i51) canten(%th(2)) (%o51) 0 (%i52) allsym : false (%o52) false (%i53) Contraction of R in the first and last indices yields zero (%i54) ishow(canform(icurvature([k, i, j], [k]))) %1 %1 (%t54) ichr2 - ichr2 %1 i,j %1 j,i (%i55) ev(%, ichr2) (%i56) canform(rename(expand(%))) (%i57) canform(contract(rename(%))) (%i58) ishow(simpmetderiv(%)) %1 %2 %3 %4 %1 %2 %3 %4 g g g g g g g g %1 %4,j %3 i,%2 %2 %4,j %3 i,%1 (%t58) ------------------------------- - ------------------------------- 2 2 (%i59) ishow(rename(canform(conmetderiv(%, imetric)))) (%t59) 0 (%i60) Now let us define the Ricci-tensor (%i61) components(R([i, j], []), icurvature([i, j, k], [k])) (%o61) done (%i62) The Ricci tensor is symmetrical (%i63) ishow(canform(R([i, j], []) - R([j, i], []))) %1 %1 (%t63) icurvature - icurvature j %1 i i %1 j (%i64) ev(%, icurvature) (%i65) ishow(canform(%)) %1 %1 (%t65) ichr2 - ichr2 %1 j,i %1 i,j (%i66) ev(%, ichr2) (%i67) ishow(rename(canform(rename(expand(%))))) %1 %2 %3 %4 %1 %2 %3 %4 g g g g g g g g ,j ,%1 %3 %2 %4 i ,j ,%2 %1 %3 %4 i (%t67) -------------------------- - -------------------------- 2 2 %1 %2 %3 %4 %1 %2 %3 %4 g g g g g g g g ,i ,j %1 %3 %4 %2 ,j ,i %1 %3 %4 %2 - --------------------------- + --------------------------- 2 2 (%i68) rename(contract(rename(contract(rename(canform(simpmetderiv(%))))))) (%i69) rename(canform(factor(simpmetderiv(canform(%))))) (%o69) 0 (%i70) decsym(R, 2, 0, [sym(all)], []) (%o70) done (%i71) decsym(R, 0, 2, [], [sym(all)]) (%o71) done (%i72) This is the curvature scalar (%i73) components(R([], []), R([i, j], []) g([], [i, j])) (%o73) done (%i74) Now we can define the Weyl-tensor (%i75) To do this, we need an improved definition of the Riemann tensor (%i76) This definition will not mess up index ordering (%i77) remcomps(R) (%o77) done (%i78) First, a helper function (%i79) coni(x) := (not atom(x)) and (op(x) = "-") (%i80) R() is now defined as a function taking two lists as parameters (%i81) R(cov, con) := (if length(con) > 0 then (cov : append(cov, map("-", con)), con : []), if length(cov) = 4 then block([tmp : idummy()], if coni(cov ) then g([], [tmp, - cov ]) 'R([tmp, cov , cov , cov ], []) 1 1 2 3 4 else (if coni(cov ) then g([], [tmp, - cov ]) 'R([cov , tmp, cov , cov ], []) 2 2 1 3 4 else (if coni(cov ) then g([], [tmp, - cov ]) 'R([cov , cov , tmp, cov ], []) 3 3 1 2 4 else (if coni(cov ) then 'icurvature([cov , cov , cov ], [- cov ]) 4 1 2 3 4 else g([tmp, cov ], []) 'icurvature([cov , cov , cov ], [tmp]))))) 4 1 2 3 else (if length(cov) = 2 then ([tmp : idummy()], if coni(cov ) then g([], [tmp, - cov ]) 'R([tmp, cov ], []) 1 1 2 else (if coni(cov ) then g([], [tmp, - cov ]) 'R([tmp, cov ], []) 2 2 1 else 'icurvature([cov , cov , tmp], [tmp]))) 1 2 else (if length(cov) = 0 then ([tmp : idummy()], 'R([tmp], [tmp])) else funmake(R, append([[cov, con]], der))))) (%i82) Now we can define the Weyl tensor itself (%i83) remcomps(W) (%o83) done (%i84) components(W([i, j, k, l], []), (g([j, l], []) R([i, k], []) - g([j, i], []) R([l, k], []) - g([k, l], []) R([i, j], []) + g([k, i], []) R([l, j], []))/('dim - 2) 1 + (-------- R([], []) (g([j, i], []) g([l, k], []) 'dim - 1 - g([j, l], []) g([i, k], [])))/('dim - 2) + R([i, j, k, l], [])) (%o84) done (%i85) Let us prove that the Weyl-tensor is trace free in all its indices (%i86) We work in arbitrary dimensions (%i87) dim : 'dim (%o87) dim (%i88) This hand-crafted simplification function works well on W (%i89) simpW(x) := (x : canform(factor(canform(contract(canform(x))))), x : ev(x, R), x : canform(factor(canform(x))), x : ev(x, icurvature), x : canform(x), x : ev(x, ichr2), x : canform(contract(simpmetderiv(canform(contract(canform(x)))))), flipflag : not flipflag, x : simpmetderiv(canform(contract(simpmetderiv(x, stop))), stop), flipflag : not flipflag, canform(conmetderiv(canform(contract(simpmetderiv(x, stop))), imetric))) (%i90) And here we go... (%i91) ishow(W([i, j, k, l], []) g([- i, - j], [])) - g R + g R - R g + R g i j j i l k k i l j i j k l i k j l (%t91) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i92) simpW(%) (%o92) 0 (%i93) ishow(W([i, j, k, l], []) g([- i, - k], [])) - g R + g R - R g + R g i k j i l k k i l j i j k l i k j l (%t93) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i94) simpW(%) (%o94) 0 (%i95) ishow(W([i, j, k, l], []) g([- i, - l], [])) - g R + g R - R g + R g i l j i l k k i l j i j k l i k j l (%t95) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i96) simpW(%) (%o96) 0 (%i97) ishow(W([i, j, k, l], []) g([- j, - k], [])) - g R + g R - R g + R g j k j i l k k i l j i j k l i k j l (%t97) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i98) simpW(%) (%o98) 0 (%i99) ishow(W([i, j, k, l], []) g([- j, - l], [])) - g R + g R - R g + R g j l j i l k k i l j i j k l i k j l (%t99) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i100) simpW(%) (%o100) 0 (%i101) ishow(W([i, j, k, l], []) g([- k, - l], [])) - g R + g R - R g + R g k l j i l k k i l j i j k l i k j l (%t101) g (----------------------------------------------- dim - 2 R (g g - g g ) j i l k i k j l + ------------------------- + R ) (dim - 2) (dim - 1) i j k l (%i102) simpW(%) (%o102) 0 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) b; batching /home/vttoth/dev/maxima/share/tensor/rainich.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('itensor, 'version) = false then load(itensor) (%o1) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i2) The Rainich-conditions apply to electrovacuum solutions. (%i3) The simplest of these states that the trace of the Ricci tensor is zero. (%i4) To begin, we set up the metric: (%i5) imetric(g) (%o5) done (%i6) We also specify symmetry properties of the Ricci tensor: (%i7) remcomps(F) (%o7) done (%i8) remcomps(R) (%o8) done (%i9) remcomps(T) (%o9) done (%i10) decsym(R, 2, 0, [sym(all)], []) (%o10) done (%i11) decsym(R, 0, 2, [], [sym(all)]) (%o11) done (%i12) The Ricci tensor contracts to form the Ricci scalar: (%i13) defcon(R, R, R) (%o13) done (%i14) The electromagnetic field tensor is antisymmetric: (%i15) decsym(F, 2, 0, [anti(all)], []) (%o15) done (%i16) decsym(F, 0, 2, [], [anti(all)]) (%o16) done (%i17) Now we can write the Einstein equation for the electrovacuum field: R([], []) g([i, j], []) (%i18) Ein : R([i, j], []) - ----------------------- = 2 F([a, b], []) F([], [a, b]) g([i, j], []) - 8 %pi (F([i, b], []) F([j], [b]) - -----------------------------------------) 4 (%i19) ishow(%) a b R g F F g i j b a b i j (%t19) R - ------ = - 8 %pi (F F - --------------) i j 2 i b j 4 (%i20) For the proof, we first contract it with the metric tensor: (%i21) ishow(Ein g([- i, - j], [])) a b R g F F g i j i j i j b a b i j (%t21) g (R - ------) = - 8 %pi g (F F - --------------) i j 2 i b j 4 (%i22) ishow(contract(expand(%))) j a b j b (%t22) R - 2 R = 8 %pi F F - 8 %pi F F j a b b j (%i23) We now express F using the mixed index form: (%i24) components(F([a, b], []), g([b, c], []) F([a], [c])) (%o24) done (%i25) components(F([], [a, b]), g([], [a, c]) F([c], [b])) (%o25) done (%i26) ishow(%th(5)) a b R g F F g i j i j i j b a b i j (%t26) g (R - ------) = - 8 %pi g (F F - --------------) i j 2 i b j 4 (%i27) ev(%, F) (%i28) ishow(rename(contract(rename(contract(expand(%)))))) (%t28) - R = 0 (%i29) We remove the definitions for F to avoid further substitutions. (%i30) remcomps(F) (%o30) done (%i31) The remaining algebraic Rainich conditions are much harder to prove. (%i32) For reference, the other two conditions are: (%i33) ishow(T([a, c], []) T([b], [c]) = (- 1) (R([d, e], []) R([], [d, e])) g([a, b], []) -------------------------------------------------) 4 d e R g R c a b d e (%t33) T T = - -------------- a c b 4 (%i34) ishow(T([a, b], []) v([], [a]) v([], [b]) >= 0) a b (%t34) v v T >= 0 a b INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) c; batching /home/vttoth/dev/maxima/share/tensor/einhil.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Deriving the Einstein field equations in FLRW cosmology (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) if get('itensor, 'version) = false then load(itensor) (%o3) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i4) The first step is to construct a symmetrized Riemann tensor. (%i5) For this, we employ an auxiliary symmetrized metric. (%i6) remsym(g, 2, 0) (%o6) done (%i7) remsym(g, 0, 2) (%o7) done (%i8) remsym(gg, 2, 0) No symmetries have been declared for this tensor. (%o8) done (%i9) remsym(gg, 0, 2) No symmetries have been declared for this tensor. (%o9) done (%i10) remcomps(gg) (%o10) done (%i11) imetric(gg) (%o11) done (%i12) icurvature([a, b, c], [e]) gg([d, e], []) (%i13) contract(rename(expand(%))) (%i14) ev(%, ichr2) (%i15) contract(rename(expand(%))) (%i16) canform(%) (%i17) contract(rename(expand(%))) (%i18) We now reexpress gg by symmetrizing g using kdels and simplify: kdels([a, b], [u, v]) g([u, v], []) (%i19) components(gg([a, b], []), -----------------------------------) 2 (%o19) done kdels([u, v], [a, b]) g([], [u, v]) (%i20) components(gg([], [a, b]), -----------------------------------) 2 (%o20) done (%i21) ev(%th(5), gg) (%i22) Some of the following simplifications may take some time... (%i23) contract(rename(expand(%th(2)))) (%i24) contract(canform(%)) (%i25) Now we can switch to the real metric: (%i26) imetric(g) (%o26) done (%i27) contract(rename(expand(%th(3)))) (%i28) At last, we got the covariant Riemann tensor. (%i29) remcomps(R) (%o29) done (%i30) components(R([a, b, c, d], []), %th(3)) (%o30) done (%i31) What we really need, though, is the curvature scalar: (%i32) g([], [a, b]) R([a, b, c, d]) g([], [c, d]) (%i33) contract(rename(canform(%))) (%i34) contract(rename(canform(%))) (%i35) components(R([], []), %) (%o35) done (%i36) Before going further, we establish the symmetry properties of g. (%i37) decsym(g, 2, 0, [sym(all)], []) (%o37) done (%i38) decsym(g, 0, 2, [], [sym(all)]) (%o38) done (%i39) Now we can construct the Einstein-Hilbert action. (R([], []) + 2 L) sqrt(- determinant(g)) (%i40) ishow(----------------------------------------) 16 %pi G sqrt(- determinant(g)) (2 L + R) (%t40) -------------------------------- 16 %pi G (%i41) ev(L0 : %, R) (%i42) We construct and simplify the 2nd order Euler-Lagrange equation: (%i43) canform(contract(canform(rename(contract(expand(idiff(rename(idiff(contract(diff (L0, g([], [m, n], k, l))), k), 1000), l) - idiff(diff(L0, g([], [m, n], k)), k) + diff(L0, g([], [m, n])))))))) % 16 %pi (%i44) ishow(e([m, n], []) = canform(----------------------)) sqrt(- determinant(g)) %1 %2 %3 %5 %4 g L g g g ichr2 g m n ,%3 %1 %2 %4 %5 m n (%t44) e = - ------ + ------------------------------------ m n G 2 G %1 %2 %3 %6 %4 %5 %2 %4 %1 %3 g g g g g g g ichr2 ichr2 g ,%3 ,%6 %1 %2 %4 %5 m n %1 %2 %3 %4 m n + --------------------------------------- + --------------------------------- 8 G G %1 %2 %3 %6 %4 %5 3 g g g g g g ,%3 ,%6 %1 %4 %2 %5 m n - ----------------------------------------- 16 G %1 %2 %3 %6 %4 %5 %1 %2 %3 %4 5 g g g g g g g g g g ,%3 ,%6 %1 %5 %2 %4 m n ,%3 ,%1 %2 %4 m n + ----------------------------------------- - ------------------------- 16 G 4 G %1 %2 %3 %1 %2 %3 %2 %3 %1 g ichr2 g g ichr2 g g ichr2 g ,%1 %2 %3 m n ,%2 %1 %3 m n %1 %2,%3 m n + ---------------------- + ---------------------- + ------------------------- 2 G 2 G G %1 %2 %1 %2 %3 %5 %4 g g g g g g ichr2 ,%1 %2 m n ,%3 %1 n %2 m %4 %5 + ------------ + ------------------------------------ 2 G 2 G %1 %2 %3 %1 %2 %3 %4 g g ichr2 g g g g ,n %1 %2 %3 m ,n ,%1 %2 %4 %3 m - ----------------------- + -------------------------- 2 G 4 G %1 %2 %3 %4 %1 %5 %2 %3 %4 %6 g g g g g g g g g g ,n ,%2 %1 %4 %3 m ,%6 ,%4 %1 n %2 m %3 %5 + -------------------------- - --------------------------------------- 4 G 2 G %1 %2 %3 %4 %1 %2 g g g g ichr2 ichr2 ,n ,m %1 %2 %3 %4 %1 n %2 m - --------------------------- - ------------------- 4 G G %1 %2 %3 %4 %1 %2 %3 %4 9 g g g g g g g g ,%3 ,%4 %1 n %2 m ,%4 ,%3 %1 n %2 m + --------------------------- - ------------------------- 16 G 16 G %1 %2 %3 %4 %1 %4 %2 %3 g g g g g g g g ,%3 %4 %1 n %2 m ,%3 ,%4 %1 n %2 m + -------------------------- - ------------------------- 2 G 2 G %1 %2 %3 %1 %2 %1 %4 %2 %3 g ichr2 g g g g g g g ,n %1 %3 %2 m ,%1 n %2 m ,%3 ,m %1 n %2 %4 - ----------------------- - ------------ + -------------------------- 4 G 4 G 2 G %1 %2 %3 %4 %1 %2 %3 3 g g g g g g ichr2 ,n ,m %1 %3 %2 %4 ,m %1 n %2 %3 + ----------------------------- - ----------------------- 8 G 2 G %1 %2 %3 %2 %3 %1 g g ichr2 g ichr2 g ,n %1 m %2 %3 ,m %1 n %2 %3 - ----------------------- - ----------------------- 4 G 2 G %1 %2 %3 %4 %1 %2 %1 %1 %2 5 g g g g g g ichr2 g g ,n ,m %1 %4 %2 %3 ,%2 m %1 n %1 m,n ,%2 n %1 m - ----------------------------- - ------------ - ----------- - ------------ 8 G 2 G G 4 G (%i45) We build a ctensor program to calculate tensor components: (%i46) EQ : ic_convert(%th(2)) (%i47) Now we set up the FLRW metric of cosmology: (%i48) ct_coords : [t, r, u, v] (%o48) [t, r, u, v] (%i49) lg : ident(4) [ 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o49) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] 2 - a (%i50) lg : -------- 2, 2 2 1 - k r 2 a (%o50) - -------- 2 1 - k r 2 2 (%i51) lg : - a r 3, 3 2 2 (%o51) - a r 2 2 2 (%i52) lg : - a r sin (u) 4, 4 2 2 2 (%o52) - a r sin (u) (%i53) dependencies(a(t)) (%o53) [a(t)] (%i54) cmetric() (%o54) done (%i55) derivabbrev : true (%o55) true (%i56) christof(false) (%o56) done (%i57) We can at last evaluate the Euler-Lagrange equation... (%i58) e : zeromatrix(4, 4) [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%o58) [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i59) This is definitely going to take a little time... (%i60) ev(EQ) (%o60) done (%i61) ...and obtain the Einstein tensor for cosmology. (%i62) expand(radcan(ug . e)) [ 2 ] [ 3 (a ) ] [ L 3 k t ] [ - - + ---- + ------- ] [ G 2 2 ] (%o62) Col 1 = [ a G a G ] [ ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ 2 ] [ 2 a (a ) ] [ L k t t t ] Col 2 = [ - - + ---- + ------ + ----- ] [ G 2 a G 2 ] [ a G a G ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 2 ] Col 3 = [ 2 a (a ) ] [ L k t t t ] [ - - + ---- + ------ + ----- ] [ G 2 a G 2 ] [ a G a G ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] Col 4 = [ ] [ 2 ] [ 2 a (a ) ] [ L k t t t ] [ - - + ---- + ------ + ----- ] [ G 2 a G 2 ] [ a G a G ] (%i63) What about the spherically symmetric case? (%i64) lg : ident(4) [ 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o64) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] (%i65) lg : B 1, 1 (%o65) B (%i66) lg : - A 2, 2 (%o66) - A 2 (%i67) lg : - r 3, 3 2 (%o67) - r 2 2 (%i68) lg : - r sin (u) 4, 4 2 2 (%o68) - r sin (u) (%i69) kill(dependencies) (%o69) done (%i70) dependencies(A(r), B(r)) (%o70) [A(r), B(r)] (%i71) cmetric() (%o71) done (%i72) christof(false) (%o72) done (%i73) e : zeromatrix(4, 4) [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%o73) [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i74) We re-evaluate the Euler-Lagrange equation. Be patient... (%i75) ev(EQ) (%o75) done (%i76) E : expand(radcan(ug . e)) [ A ] [ L r 1 1 ] [ - - + ------ - ------ + ---- ] [ G 2 2 2 ] [ r A G r A G r G ] (%o76) Col 1 = [ ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ B ] [ L r 1 1 ] [ - - - ------- - ------ + ---- ] Col 2 = [ G r A B G 2 2 ] [ r A G r G ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 2 ] Col 3 = [ B (B ) A B B A ] [ L r r r r r r r ] [ - - - ------- + -------- + -------- - --------- + -------- ] [ G 2 A B G 2 2 2 r A B G 2 ] [ 4 A B G 4 A B G 2 r A G ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] Col 4 = [ ] [ 2 ] [ B (B ) A B B A ] [ L r r r r r r r ] [ - - - ------- + -------- + -------- - --------- + -------- ] [ G 2 A B G 2 2 2 r A B G 2 ] [ 4 A B G 4 A B G 2 r A G ] (%i77) In a vacuum solution, E should be zero. Let's solve for it! (%i78) exp : findde(E, 2) 2 2 2 2 (%o78) [r A L - r A - A + A, r A B L + r B - A B + B, r r 2 2 2 2 4 r A B L + 2 r A B B - r A (B ) - r A B B + 2 A B B - 2 A B ] r r r r r r r (%i79) solve(ode2(exp , A, r), A) 1 3 r (%o79) [A = - -----------------] 3 r L - 3 r - 3 %c (%i80) ev(%, %c = - 2 M) 3 r (%o80) [A = - ----------------] 3 6 M + r L - 3 r (%i81) ev(a : % , %c = - 2 M) 1 3 r (%o81) A = - ---------------- 3 6 M + r L - 3 r (%i82) ode2(ev(exp , a), B, r) 2 3 %c (6 M + r L - 3 r) (%o82) B = --------------------- r (%i83) b : ev(%, %c = rhs(solve(rhs(%) rhs(a) = 1, %c) )) 1 3 6 M + r L - 3 r (%o83) B = - ---------------- 3 r (%i84) Finally, we obtain the Schwarzschild-de Sitter metric (%i85) expand(ev(lg, a, b)) [ 2 ] [ 2 M r L ] [ - --- - ---- + 1 0 0 0 ] [ r 3 ] [ ] [ 3 r ] [ 0 ---------------- 0 0 ] (%o85) [ 3 ] [ 6 M + r L - 3 r ] [ ] [ 2 ] [ 0 0 - r 0 ] [ ] [ 2 2 ] [ 0 0 0 - r sin (u) ] INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) d; batching /home/vttoth/dev/maxima/share/tensor/bradic.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Deriving the field equations in FLRW cosmology for the Brans-Dicke action (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) if get('itensor, 'version) = false then load(itensor) (%o3) /home/vttoth/dev/maxima/share/tensor/itensor.lisp (%i4) The first step is to construct a symmetrized Riemann tensor. (%i5) For this, we employ an auxiliary symmetrized metric. (%i6) remsym(g, 2, 0) (%o6) done (%i7) remsym(g, 0, 2) (%o7) done (%i8) remsym(gg, 2, 0) No symmetries have been declared for this tensor. (%o8) done (%i9) remsym(gg, 0, 2) No symmetries have been declared for this tensor. (%o9) done (%i10) remcomps(gg) (%o10) done (%i11) imetric(gg) (%o11) done (%i12) icurvature([a, b, c], [e]) gg([d, e], []) (%i13) contract(rename(expand(%))) (%i14) ev(%, ichr2) (%i15) contract(rename(expand(%))) (%i16) canform(%) (%i17) contract(rename(expand(%))) (%i18) We now reexpress gg by symmetrizing g using kdels and simplify: kdels([a, b], [u, v]) g([u, v], []) (%i19) components(gg([a, b], []), -----------------------------------) 2 (%o19) done kdels([u, v], [a, b]) g([], [u, v]) (%i20) components(gg([], [a, b]), -----------------------------------) 2 (%o20) done (%i21) ev(%th(5), gg) (%i22) Some of the following simplifications may take some time... (%i23) contract(rename(expand(%th(2)))) (%i24) contract(canform(%)) (%i25) Now we can switch to the real metric: (%i26) imetric(g) (%o26) done (%i27) contract(rename(expand(%th(3)))) (%i28) At last, we got the covariant Riemann tensor. (%i29) remcomps(R) (%o29) done (%i30) components(R([a, b, c, d], []), %th(3)) (%o30) done (%i31) What we really need, though, is the curvature scalar: (%i32) g([], [a, b]) R([a, b, c, d]) g([], [c, d]) (%i33) contract(rename(canform(%))) (%i34) contract(rename(canform(%))) (%i35) components(R([], []), %) (%o35) done (%i36) Before going further, we establish the symmetry properties of g. (%i37) decsym(g, 2, 0, [sym(all)], []) (%o37) done (%i38) decsym(g, 0, 2, [], [sym(all)]) (%o38) done (%i39) Now we can construct the Brans-Dicke action. R([], []) sqrt(- determinant(g)) (%i40) L1 : -------------------------------- 16 %pi (w gg([], [a, b]) f([], [], a) f([], [], b)) sqrt(- determinant(g)) (%i41) L2 : ------------------------------------------------------------------- (16 %pi) f([], []) (%i42) L0 : radcan(L2 - f([], []) L1) (%i43) L0 : contract(ev(L0, R)) (%i44) We construct and simplify the 2nd order Euler-Lagrange equation: (%i45) canform(contract(canform(rename(contract(expand(idiff(rename(idiff(contract(diff (L0, g([], [m, n], k, l))), k), 1000), l) - idiff(diff(L0, g([], [m, n], k)), k) + diff(L0, g([], [m, n])))))))) % 16 %pi (%i46) ishow(e([m, n], []) = canform(----------------------)) sqrt(- determinant(g)) %1 %2 f f g g w f f w ,%1 ,%2 m n ,m ,n (%t46) e = - ----------------------- + --------- m n 2 f f %1 %2 %3 %5 %4 f g g g ichr2 g ,%3 %1 %2 %4 %5 m n - -------------------------------------- 2 %1 %2 %3 %6 %4 %5 f g g g g g g ,%3 ,%6 %1 %2 %4 %5 m n - ----------------------------------------- 8 %1 %2 %3 %4 f g g g g %2 %4 %1 %3 ,%2 ,%1 %3 %4 m n - f g ichr2 ichr2 g + --------------------------- %1 %2 %3 %4 m n 4 %1 %2 %3 %6 %4 %5 3 f g g g g g g ,%3 ,%6 %1 %4 %2 %5 m n + ------------------------------------------- 16 %1 %2 %3 %6 %4 %5 %1 %2 %3 %4 5 f g g g g g g f g g g g ,%3 ,%6 %1 %5 %2 %4 m n ,%3 ,%1 %2 %4 m n - ------------------------------------------- + --------------------------- 16 4 %1 %2 %3 %1 %2 %3 f g ichr2 g f g ichr2 g ,%1 %2 %3 m n ,%2 %1 %3 m n - ------------------------ - ------------------------ 2 2 %2 %3 %1 %2 %3 %1 - f g ichr2 g - 2 f g ichr2 g %1 %2,%3 m n ,%3 %1 %2 m n %1 %2 %3 %4 %1 %2 %3 %4 f g g g g f g g g g ,%3 ,%4 %1 %2 m n ,%4 ,%3 %1 %2 m n - --------------------------- - ------------------------------ 4 2 %1 %2 %1 %2 %1 %2 f g g f g g f g g ,%1 ,%2 m n ,%1 %2 m n ,%2 ,%1 m n %1 %2 - ---------------- - -------------- - ---------------- - f g g 2 2 2 ,%1 %2 m n %1 %2 %3 %5 %4 %1 %2 %3 f g g g g ichr2 f g g ichr2 ,%3 %1 n %2 m %4 %5 ,n %1 %2 %3 m - -------------------------------------- + ------------------------- 2 2 %1 %2 %3 %4 %1 %2 %3 %4 f g g g g f g g g g ,n ,%1 %2 %4 %3 m ,n ,%2 %1 %4 %3 m - ---------------------------- - ---------------------------- 4 4 %1 %5 %2 %3 %4 %6 %1 %2 %3 %4 f g g g g g g f g g g g ,%6 ,%4 %1 n %2 m %3 %5 ,n ,m %1 %2 %3 %4 + ----------------------------------------- + ----------------------------- 2 4 %1 %2 %3 %4 3 f g g g g %1 %2 ,%3 ,%4 %1 n %2 m + f ichr2 ichr2 - ----------------------------- %1 n %2 m 4 %1 %2 %3 %4 %1 %2 %3 %4 f g g g g f g g g g ,%4 ,%3 %1 n %2 m ,%3 %4 %1 n %2 m + --------------------------- - ---------------------------- 4 2 %1 %2 %3 %4 %1 %4 %2 %3 f g g g g f g g g g ,%4 ,%3 %1 n %2 m ,%3 ,%4 %1 n %2 m - ------------------------------ + --------------------------- 2 2 %1 %2 %3 %1 %2 %1 %2 f g ichr2 g f g g f g g ,n %1 %3 %2 m ,%1 ,n %2 m ,%1 n %2 m + ------------------------- + ----------------- + -------------- 4 4 4 %1 %4 %2 %3 %1 %2 %3 %4 f g g g g 3 f g g g g ,%3 ,m %1 n %2 %4 ,n ,m %1 %3 %2 %4 - ---------------------------- - ------------------------------- 2 8 %1 %2 %3 %1 %2 %3 f g g ichr2 f g g ichr2 ,m %1 n %2 %3 ,n %1 m %2 %3 + ------------------------- + ------------------------- 2 4 %2 %3 %1 %1 %2 %3 %4 f g ichr2 g 5 f g g g g ,m %1 n %2 %3 ,n ,m %1 %4 %2 %3 %1 + ------------------------- + ------------------------------- + f ichr2 2 8 %1 n,m %1 %2 %1 %2 f g g f g g %1 ,%2 ,m %1 n ,%2 m %1 n %1 + f ichr2 + ----------------- + -------------- + f ichr2 ,m %1 n 2 2 ,n %1 m %1 %2 %1 %2 %1 %2 %1 %2 f g g f g g f g g f g g ,%2 ,n %1 m ,%2 n %1 m ,m ,n %1 %2 ,n ,m %1 %2 + ----------------- + -------------- + ----------------- + ----------------- 4 4 2 2 + f ,m n (%i47) We build a ctensor program to calculate tensor components: (%i48) EQ : ic_convert(%th(2)) (%i49) Now we set up the FLRW metric of cosmology: (%i50) ct_coords : [t, r, u, v] (%o50) [t, r, u, v] (%i51) lg : ident(4) [ 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o51) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] 2 - a (%i52) lg : -------- 2, 2 2 1 - k r 2 a (%o52) - -------- 2 1 - k r 2 2 (%i53) lg : - a r 3, 3 2 2 (%o53) - a r 2 2 2 (%i54) lg : - a r sin (u) 4, 4 2 2 2 (%o54) - a r sin (u) (%i55) Let's not forget that the scalar field is also a function of time. (%i56) dependencies(a(t), f(t)) (%o56) [a(t), f(t)] (%i57) cmetric() (%o57) done (%i58) derivabbrev : true (%o58) true (%i59) christof(false) (%o59) done (%i60) We can at last evaluate the Euler-Lagrange equation... (%i61) e : zeromatrix(4, 4) [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%o61) [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i62) This is definitely going to take a little time... (%i63) ev(EQ) (%o63) done (%i64) ug . e (%i65) subst(f, f([], []), %) % (%i66) expand(radcan(-)) f [ 2 2 ] [ (f ) w 3 a f 3 (a ) ] [ t 3 k t t t ] [ ------- - --- - ------- - ------- ] [ 2 2 a f 2 ] (%o66) Col 1 = [ 2 f a a ] [ ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ 2 2 ] [ (f ) w f 2 a f 2 a (a ) ] [ t k t t t t t t t ] Col 2 = [ - ------- - -- - ---- - ------- - ------ - ----- ] [ 2 2 f a f a 2 ] [ 2 f a a ] [ ] [ 0 ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 2 2 ] Col 3 = [ (f ) w f 2 a f 2 a (a ) ] [ t k t t t t t t t ] [ - ------- - -- - ---- - ------- - ------ - ----- ] [ 2 2 f a f a 2 ] [ 2 f a a ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ ] [ 0 ] Col 4 = [ ] [ 2 2 ] [ (f ) w f 2 a f 2 a (a ) ] [ t k t t t t t t t ] [ - ------- - -- - ---- - ------- - ------ - ----- ] [ 2 2 f a f a 2 ] [ 2 f a a ] (%i67) As a last step, let us calculate the Hamiltonian associated with f. (%i68) ic_convert(L([], []) = L0) (%i69) ev(%) (%i70) L : factor(subst(f, f([], []), L)) 2 2 2 2 2 2 sqrt(- determinant(g)) (a (f ) w + 6 f k + 6 a a f + 6 (a ) f ) t t t t (%o70) ----------------------------------------------------------------------- 2 16 %pi a f (%i71) P : subst(diff(f, t), ft, diff(subst(ft, diff(f, t), L), ft)) f sqrt(- determinant(g)) w t (%o71) --------------------------- 8 %pi f (%i72) H : ratsimp(P diff(f, t) - L) 2 2 2 2 2 sqrt(- determinant(g)) (a (f ) w - 6 f k + (- 6 a a - 6 (a ) ) f ) t t t t (%o72) ------------------------------------------------------------------------ 2 16 %pi a f INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 11; batching /home/vttoth/dev/maxima/share/tensor/schwarz.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) kill(allbut(props)) (%o0) done (%i1) Finding the Schwarzschild solution of the Einstein vacuum equations (%i2) showtime : all Evaluation took 0.0000 seconds (0.0001 elapsed) using 88 bytes. (%o2) all (%i3) if get('ctensor, 'version) = false then load(ctensor) Evaluation took 0.2960 seconds (0.2951 elapsed) using 1.410 MB. (%o3) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i4) (ratwtlvl : false, ratfac : true) Evaluation took 0.0000 seconds (0.0001 elapsed) using 104 bytes. (%o4) true (%i5) Specify the dimension of the manifold and the coordinate labels. Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i6) (dim : 4, ct_coords : [r, th, ph, t]) Evaluation took 0.0000 seconds (0.0001 elapsed) using 384 bytes. (%o6) [r, th, ph, t] (%i7) Enter the general static spherically symmetric metric. Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. 2 2 2 (%i8) lg : matrix([a, 0, 0, 0], [0, r , 0, 0], [0, 0, r sin (th), 0], [0, 0, 0, - d]) Evaluation took 0.0000 seconds (0.0004 elapsed) using 1.953 KB. [ a 0 0 0 ] [ ] [ 2 ] [ 0 r 0 0 ] (%o8) [ ] [ 2 2 ] [ 0 0 r sin (th) 0 ] [ ] [ 0 0 0 - d ] (%i9) ug : invert(lg) Evaluation took 0.0000 seconds (0.0032 elapsed) using 21.133 KB. (%i10) Specify functional dependencies Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i11) depends([a, d], r) Evaluation took 0.0000 seconds (0.0001 elapsed) using 512 bytes. (%o11) [a(r), d(r)] (%i12) computes inverse metric and specifies diagonality Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i13) ug : invert(lg) Evaluation took 0.0040 seconds (0.0032 elapsed) using 21.125 KB. [ 1 ] [ - 0 0 0 ] [ a ] [ ] [ 1 ] [ 0 -- 0 0 ] [ 2 ] [ r ] (%o13) [ ] [ 1 ] [ 0 0 ----------- 0 ] [ 2 2 ] [ r sin (th) ] [ ] [ 1 ] [ 0 0 0 - - ] [ d ] (%i14) computes the mixed Christoffel symbols but not display them Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i15) christof(false) Evaluation took 0.0440 seconds (0.0404 elapsed) using 249.086 KB. (%o15) done (%i16) computes and ratsimps Ricci tensor Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i17) uricci(false) Evaluation took 0.0880 seconds (0.0872 elapsed) using 895.766 KB. (%o17) done (%i18) computes and displays the Einstein tensor Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i19) einstein(true) dd -- r - a d + d dr (%t19) ein = -------------- 1, 1 2 a d r 2 d d dd 2 da dd dd da 2 2 a d --- r - a (--) r - -- d -- r + 2 a d -- - 2 -- d 2 dr dr dr dr dr dr (%t20) ein = -------------------------------------------------------- 2, 2 2 2 4 a d r 2 d d dd 2 da dd dd da 2 2 a d --- r - a (--) r - -- d -- r + 2 a d -- - 2 -- d 2 dr dr dr dr dr dr (%t21) ein = -------------------------------------------------------- 3, 3 2 2 4 a d r da 2 -- r + a - a dr (%t22) ein = - ------------- 4, 4 2 2 a r Evaluation took 0.0600 seconds (0.0619 elapsed) using 653.758 KB. (%o22) done (%i23) List of the non-zero components of the rank 2 Einstein tensor Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i24) exp : findde(ein, 2) Evaluation took 0.0160 seconds (0.0133 elapsed) using 182.625 KB. 2 dd d d dd 2 da dd dd (%o24) [-- r - a d + d, 2 a d --- r - a (--) r - -- d -- r + 2 a d -- dr 2 dr dr dr dr dr da 2 da 2 - 2 -- d , -- r + a - a] dr dr (%i25) Now begin to solve the field equations Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i26) exp1 : ode2(last(exp), a, r) Evaluation took 0.0800 seconds (0.0779 elapsed) using 599.258 KB. (%o26) log(a) - log(a - 1) = log(r) + %c (%i27) A kludge to get the solution (the 1,1 component) explicitly Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i28) solve(exp1, r) Evaluation took 0.0040 seconds (0.0045 elapsed) using 63.555 KB. a (%o28) [r = -------------] %c %c %e a - %e (%i29) resultlist : solve(%, a) Evaluation took 0.0040 seconds (0.0032 elapsed) using 42.109 KB. (%i30) h : ev(part(resultlist, 1), eval) Evaluation took 0.0000 seconds (0.0008 elapsed) using 9.070 KB. %c %e r (%o30) a = ---------- %c %e r - 1 (%i31) To cast the solution into standard form Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. 1 (%i32) ev(h1 : h, exp(%c) = ---, factor) 2 m Evaluation took 0.0000 seconds (0.0012 elapsed) using 9.602 KB. r (%o32) a = ------- r - 2 m (%i33) Now to find the 4,4 component Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i34) ev(first(exp), h1, diff, factor) Evaluation took 0.0040 seconds (0.0039 elapsed) using 35.281 KB. dd 2 dd -- r - 2 -- m r - 2 d m dr dr (%o34) ------------------------ r - 2 m (%i35) ode2(num(%), d, r) Evaluation took 0.0080 seconds (0.0080 elapsed) using 87.266 KB. log(r - 2 m) log(r) 2 m (------------ - ------) 2 m 2 m (%o35) d = %c %e (%i36) expand(radcan(%)) Evaluation took 0.0120 seconds (0.0123 elapsed) using 480.336 KB. 2 %c m (%o36) d = %c - ------ r (%i37) h2 : ev(%, %c = 1) Evaluation took 0.0000 seconds (0.0003 elapsed) using 904 bytes. 2 m (%o37) d = 1 - --- r (%i38) h1 and h2 should be the solution and to check Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i39) sol : [h1, h2] Evaluation took 0.0000 seconds (0.0001 elapsed) using 224 bytes. r 2 m (%o39) [a = -------, d = 1 - ---] r - 2 m r (%i40) ev(exp, sol, diff, ratsimp) Evaluation took 0.0040 seconds (0.0053 elapsed) using 49.414 KB. (%o40) [0, 0, 0] (%i41) kill(allbut(props)) Evaluation took 0.0120 seconds (0.0135 elapsed) using 6.742 KB. (%o0) done (%i1) if get('ctensor, 'version) = false then load(ctensor) Evaluation took 0.0000 seconds (0.0001 elapsed) using 328 bytes. (%o1) false (%i2) (dim : 4, ct_coords : [r, th, ph, t]) Evaluation took 0.0000 seconds (0.0001 elapsed) using 280 bytes. (%o2) [r, th, ph, t] (%i3) Enter the Schwarzschild metric in standard coordinates. Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. 1 2 2 2 (%i4) lg : matrix([-------, 0, 0, 0], [0, r , 0, 0], [0, 0, r sin (th), 0], 2 m 1 - --- r 2 m [0, 0, 0, --- - 1]) r Evaluation took 0.0040 seconds (0.0008 elapsed) using 3.086 KB. [ 1 ] [ ------- 0 0 0 ] [ 2 m ] [ 1 - --- ] [ r ] [ ] [ 2 ] (%o4) [ 0 r 0 0 ] [ ] [ 2 2 ] [ 0 0 r sin (th) 0 ] [ ] [ 2 m ] [ 0 0 0 --- - 1 ] [ r ] (%i5) ug : invert(lg) Evaluation took 0.0040 seconds (0.0037 elapsed) using 20.992 KB. (%i6) Compute and display mixed Christoffel symbols Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i7) christof(all) Evaluation took 0.0000 seconds (0.0000 elapsed) using 192 bytes. (%o7) christof(all) (%i8) uricci(true) Evaluation took 0.0000 seconds (0.0000 elapsed) using 192 bytes. (%o8) uricci(true) (%i9) computes scalar curvature Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i10) scurvature() Evaluation took 0.0000 seconds (0.0000 elapsed) using 176 bytes. (%o10) scurvature() (%i11) computes Riemann tensor Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i12) lriemann(true) Evaluation took 0.0000 seconds (0.0000 elapsed) using 192 bytes. (%o12) lriemann(true) (%i13) computes contravariant Riemann tensor Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i14) uriemann(false) Evaluation took 0.0000 seconds (0.0000 elapsed) using 192 bytes. (%o14) uriemann(false) (%i15) computes the Kretchmann invariant Rijkl^2 Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i16) rinvariant() Evaluation took 0.0040 seconds (0.0000 elapsed) using 176 bytes. (%o16) rinvariant() (%i17) diagmetric : true Evaluation took 0.0000 seconds (0.0000 elapsed) using 96 bytes. (%o17) true (%i18) Compute the covariant form of geodesic equations Evaluation took 0.0000 seconds (0.0000 elapsed) using 80 bytes. (%i19) cgeodesic(true) Evaluation took 0.0000 seconds (0.0000 elapsed) using 192 bytes. (%o19) cgeodesic(true) (%i20) block([title : Schwarzschild Potential for Mass M=2, m : 2], plot3d([r cos(th), r sin(th), ug ], [r, 0.4, 4], [th, - %pi, %pi], 1, 1 ['grid, 50, 15])) Evaluation took 2.0881 seconds (2.0924 elapsed) using 45.371 MB. (%o20) false (%i21) showtime : false (%o21) false INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 12; batching /home/vttoth/dev/maxima/share/tensor/reissner.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Verify that the Reissner-Nordstrom metric is that of a point charge. First, we load ctensor... (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) We also need NCHRPL that contains the MATTRACE function: (%i4) load(nchrpl) (%o4) /home/vttoth/dev/maxima/share/matrix/nchrpl.mac (%i5) Now we set up the metric with (+,-,-,-) signature: (%i6) dim : 4 (%o6) 4 (%i7) ct_coords : [t, r, o, f] (%o7) [t, r, o, f] 2 2 2 - 2 m r + q + r r (%i8) lg : matrix([-----------------, 0, 0, 0], [0, -----------------, 0, 0], 2 2 2 r - q - r + 2 m r 2 2 2 [0, 0, - r , 0], [0, 0, 0, - r sin (o)]) [ 2 2 ] [ r - 2 m r + q ] [ --------------- 0 0 0 ] [ 2 ] [ r ] [ ] [ 2 ] [ r ] (%o8) [ 0 ----------------- 0 0 ] [ 2 2 ] [ - r + 2 m r - q ] [ ] [ 2 ] [ 0 0 - r 0 ] [ ] [ 2 2 ] [ 0 0 0 - sin (o) r ] (%i9) ug : ratsimp(invert(lg)) [ 2 ] [ r ] [ --------------- 0 0 0 ] [ 2 2 ] [ r - 2 m r + q ] [ ] [ 2 2 ] [ r - 2 m r + q ] [ 0 - --------------- 0 0 ] [ 2 ] (%o9) [ r ] [ ] [ 1 ] [ 0 0 - -- 0 ] [ 2 ] [ r ] [ ] [ 1 ] [ 0 0 0 - ---------- ] [ 2 2 ] [ sin (o) r ] (%i10) Next, we compute the Christoffel-symbols: (%i11) christof(false) (%o11) done (%i12) Predefine Ricci & Einstein tensors as matrices for later use: (%i13) ric : lein : ident(4) (%i14) ricci(false) (%o14) done (%i15) leinstein(false) (%o15) done (%i16) Part II: we set up the electromagnetic 4-potential: q (%i17) a : [-, 0, 0, 0] r q (%o17) [-, 0, 0, 0] r (%i18) From which we compute the covariant electromagnetic field tensor: (%i19) fl : ident(4) (%i20) for i thru dim do (for j thru dim do fl : diff(a , ct_coords ) - diff(a , ct_coords )) i, j i j j i (%o20) done (%i21) We can now obtain the mixed and contravariant EM field tensors: (%i22) fm : ug . fl [ q ] [ 0 - --------------- 0 0 ] [ 2 2 ] [ r - 2 m r + q ] [ ] [ 2 2 ] (%o22) [ q (r - 2 m r + q ) ] [ - ------------------- 0 0 0 ] [ 4 ] [ r ] [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i23) fu : fm . ug [ q ] [ 0 -- 0 0 ] [ 2 ] [ r ] [ ] [ q ] (%o23) [ - -- 0 0 0 ] [ 2 ] [ r ] [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%i24) And now we can compute the stress-energy tensor (times 8*%pi). lg mattrace(fl . fu) (%i25) t : ratsimp(2 (fl . fm - --------------------)) 4 [ 2 2 2 ] [ q (r - 2 m r + q ) ] [ -------------------- 0 0 0 ] [ 6 ] [ r ] [ ] [ 2 ] [ q ] [ 0 - -------------------- 0 0 ] [ 2 2 2 ] [ r (r - 2 m r + q ) ] (%o25) [ ] [ 2 ] [ q ] [ 0 0 -- 0 ] [ 2 ] [ r ] [ ] [ 2 2 ] [ sin (o) q ] [ 0 0 0 ---------- ] [ 2 ] [ r ] (%i26) This and the covariant Einstein tensor should be identical: (%i27) ratsimp(lein - t) [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] (%o27) [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 1; batching /home/vttoth/dev/maxima/share/tensor/ctensor6.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of the Schwarzschild metric (%i3) We use frames, set up simplification flags (%i4) (cframe_flag : true, gcd : spmod, ctrgsimp : true, ratwtlvl : false, ratfac : true) (%o4) true (%i5) We use the stock Schwarzschild frame (%i6) ct_coordsys(exteriorschwarzschild, all) (%t6) dim = 4 (%t7) ct_coords = [t, r, theta, phi] [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%t8) lfg = [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] [ sqrt(r - 2 m) ] [ ------------- 0 0 0 ] [ sqrt(r) ] [ ] [ sqrt(r) ] (%t9) fri = [ 0 ------------- 0 0 ] [ sqrt(r - 2 m) ] [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 r sin(theta) ] (%o9) done (%i10) The inverse metric tensor is needed by nptetrad() (%i11) ug : invert(lg) (%i12) The basis for the calculations is the Weyl tensor (%i13) weyl(false) (%o13) done (%i14) We compute a Newman-Penrose null tetrad (%i15) nptetrad(false) (%o15) done (%i16) Now we're ready to compute the coefficients (%i17) psi(true) (%t17) psi = 0 0 (%t18) psi = 0 1 m (%t19) psi = -- 2 3 r (%t20) psi = 0 3 (%t21) psi = 0 4 (%o21) done (%i22) And obtain the Petrov class (%i23) petrov() (%o23) D INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 2; batching /home/vttoth/dev/maxima/share/tensor/petrov.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Attempt to compute the Petrov classification of the Kerr metric. (%i2) First, we need to load modules and define the metric: (%i3) if get('ctensor, 'version) = false then load(ctensor) (%o3) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i4) init_ctensor() (%o4) done (%i5) gcd : spmod (%o5) spmod (%i6) ct_coords : [t, r, h, p] (%i7) declare([a, m], constant) 2 2 (%i8) s(r, h) := (a cos(h)) + r 2 2 (%i9) d(r) := r - 2 m r + a (%i10) dim : 4 d(r) d(r) 2 (%i11) fri : matrix([sqrt(-------), 0, 0, - sqrt(-------) a sin (h)], s(r, h) s(r, h) s(r, h) [0, sqrt(-------), 0, 0], [0, 0, sqrt(s(r, h)), 0], d(r) 2 (- a) sin(h) ((a sin(h)) + s(r, h)) sin(h) [-------------, 0, 0, ------------------------------]) sqrt(s(r, h)) sqrt(s(r, h)) [ 2 2 ] [ sqrt(r - 2 m r + a ) ] [ 0 ] [ --------------------- ] [ ] [ 2 2 2 ] [ 2 2 2 ] [ sqrt(r + a cos (h)) ] [ sqrt(r + a cos (h)) ] [ ] [ --------------------- ] (%o11) Col 1 = [ 0 ] Col 2 = [ 2 2 ] [ ] [ sqrt(r - 2 m r + a ) ] [ 0 ] [ ] [ ] [ 0 ] [ a sin(h) ] [ ] [ - --------------------- ] [ 0 ] [ 2 2 2 ] [ sqrt(r + a cos (h)) ] [ 0 ] [ ] [ 0 ] Col 3 = [ ] [ 2 2 2 ] [ sqrt(r + a cos (h)) ] [ ] [ 0 ] [ 2 2 2 ] [ a sin (h) sqrt(r - 2 m r + a ) ] [ - ------------------------------- ] [ 2 2 2 ] [ sqrt(r + a cos (h)) ] [ ] [ 0 ] Col 4 = [ ] [ 0 ] [ ] [ 2 2 2 2 2 ] [ sin(h) (r + a sin (h) + a cos (h)) ] [ ------------------------------------- ] [ 2 2 2 ] [ sqrt(r + a cos (h)) ] (%i12) We need aggressive simplification to ensure that the result is correct. (%i13) ctrgsimp : true (%o13) true (%i14) ratfac : true (%o14) true (%i15) cframe_flag : true (%o15) true (%i16) cmetric(false) (%o16) false (%i17) ug : invert(lg) (%i18) nptetrad(false) (%o18) done (%i19) Verify the tetrad (%i20) trigsimp(np . transpose(npi)) [ 0 - 1 0 0 ] [ ] [ - 1 0 0 0 ] (%o20) [ ] [ 0 0 0 1 ] [ ] [ 0 0 1 0 ] (%i21) christof(false) (%o21) done (%i22) lriemann(false) (%o22) done (%i23) ricci(false) (%o23) done (%i24) weyl(false) (%o24) done (%i25) Now we're ready to compute the Newman-Penrose coefficients: (%i26) psi(true) (%t26) psi = 0 0 (%t27) psi = 0 1 m (%t28) psi = ------------------ 2 3 (r + %i a cos(h)) (%t29) psi = 0 3 (%t30) psi = 0 4 (%o30) done (%i31) petrov() (%o31) D INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 3; batching /home/vttoth/dev/maxima/share/tensor/adsitter.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of the anti-deSitter metric (%i3) We use frames (%i4) cframe_flag : true (%o4) true (%i5) We set up the metric by hand (%i6) ct_coords : [t, x, theta, phi] (%o6) [t, x, theta, phi] (%i7) (lfg : ident(4), lfg : - 1, lfg) 1, 1 t t - %i a cos(-) a cos(-) 1 a - %i 1 a (%i8) fri : matrix([-------, -------------, 0, 0], [-------, --------, 0, 0], sqrt(2) sqrt(2) sqrt(2) sqrt(2) t t a cos(-) sinh(x) %i a cos(-) sin(theta) sinh(x) a a [0, 0, ----------------, ------------------------------], sqrt(2) sqrt(2) t t a cos(-) sinh(x) - %i a cos(-) sin(theta) sinh(x) a a [0, 0, ----------------, --------------------------------]) sqrt(2) sqrt(2) [ t ] [ %i a cos(-) ] [ 1 ] [ a ] [ ------- ] [ - ----------- ] [ sqrt(2) ] [ sqrt(2) ] [ ] [ ] [ %i ] [ t ] (%o8) Col 1 = [ - ------- ] Col 2 = [ a cos(-) ] [ sqrt(2) ] [ a ] [ ] [ -------- ] [ 0 ] [ sqrt(2) ] [ ] [ ] [ 0 ] [ 0 ] [ ] [ 0 ] [ 0 ] [ 0 ] [ ] [ ] [ 0 ] [ 0 ] [ ] [ ] [ t ] [ t ] [ a cos(-) sinh(x) ] [ %i a cos(-) sin(theta) sinh(x) ] [ a ] [ a ] Col 3 = [ ---------------- ] Col 4 = [ ------------------------------ ] [ sqrt(2) ] [ sqrt(2) ] [ ] [ ] [ t ] [ t ] [ a cos(-) sinh(x) ] [ %i a cos(-) sin(theta) sinh(x) ] [ a ] [ a ] [ ---------------- ] [ - ------------------------------ ] [ sqrt(2) ] [ sqrt(2) ] (%i9) cmetric(false) (%o9) false (%i10) ug : invert(lg) (%o10) [ - 1 0 0 0 ] [ ] [ 1 ] [ 0 ---------- 0 0 ] [ 2 2 t ] [ a cos (-) ] [ a ] [ ] [ 1 ] [ 0 0 ------------------- 0 ] [ 2 2 t 2 ] [ a cos (-) sinh (x) ] [ a ] [ ] [ 1 ] [ 0 0 0 - ------------------------------- ] [ 2 2 t 2 2 ] [ a cos (-) sin (theta) sinh (x) ] [ a ] (%i11) weyl(false) (%o11) done (%i12) nptetrad(false) (%o12) done (%i13) ctrgsimp : true (%o13) true (%i14) psi(true) (%t14) psi = 0 0 (%t15) psi = 0 1 (%t16) psi = 0 2 (%t17) psi = 0 3 (%t18) psi = 0 4 (%o18) done (%i19) And obtain the Petrov class (%i20) petrov() (%o20) 0 INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 4; batching /home/vttoth/dev/maxima/share/tensor/godel.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of Godel's universe (%i3) We use frames (%i4) cframe_flag : true (%o4) true (%i5) We set up the metric by hand (%i6) ct_coords : [t, x, y, z] (%o6) [t, x, y, z] (%i7) (lfg : ident(4), lfg : - 1, lfg) 1, 1 a exp(x) (%i8) fri : matrix([a, 0, a exp(x), 0], [0, a, 0, 0], [0, 0, --------, 0], sqrt(2) [0, 0, 0, a]) [ x ] [ a 0 a %e 0 ] [ ] [ 0 a 0 0 ] [ ] (%o8) [ x ] [ a %e ] [ 0 0 ------- 0 ] [ sqrt(2) ] [ ] [ 0 0 0 a ] (%i9) cmetric(false) (%o9) false (%i10) ug : invert(lg) [ - x ] [ 1 2 %e ] [ -- 0 - ------- 0 ] [ 2 2 ] [ a a ] [ ] [ 1 ] [ 0 -- 0 0 ] [ 2 ] [ a ] (%o10) [ ] [ - x - 2 x ] [ 2 %e 2 %e ] [ - ------- 0 --------- 0 ] [ 2 2 ] [ a a ] [ ] [ 1 ] [ 0 0 0 -- ] [ 2 ] [ a ] (%i11) weyl(false) (%o11) done (%i12) nptetrad(false) (%o12) done (%i13) psi(true) 1 (%t13) psi = - ---- 0 2 4 a (%t14) psi = 0 1 1 (%t15) psi = - ----- 2 2 12 a (%t16) psi = 0 3 1 (%t17) psi = - ---- 4 2 4 a (%o17) done (%i18) And obtain the Petrov class (%i19) petrov() (%o19) D INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 5; batching /home/vttoth/dev/maxima/share/tensor/taubnut.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of the Taub-Nut plane vacuum (%i3) We use frames (%i4) cframe_flag : true (%o4) true (%i5) We set up the metric by hand (%i6) ct_coords : [t, x, y, z] (%o6) [t, x, y, z] (%i7) (lfg : ident(4), lfg : - 1, lfg) 1, 1 [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o7) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] - 1 - 1 - 1 - 1 --- --- --- --- 4 4 4 4 - z %i z %i z - z (%i8) fri : matrix([-------, 0, 0, -------], [-------, 0, 0, -------], sqrt(2) sqrt(2) sqrt(2) sqrt(2) - sqrt(z) sqrt(z) - sqrt(z) - sqrt(z) [0, ---------, -------, 0], [0, ---------, ---------, 0]) sqrt(2) sqrt(2) sqrt(2) sqrt(2) [ 1 %i ] [ - ------------ 0 0 ------------ ] [ 1/4 1/4 ] [ sqrt(2) z sqrt(2) z ] [ ] [ %i 1 ] [ ------------ 0 0 - ------------ ] [ 1/4 1/4 ] (%o8) [ sqrt(2) z sqrt(2) z ] [ ] [ sqrt(z) sqrt(z) ] [ 0 - ------- ------- 0 ] [ sqrt(2) sqrt(2) ] [ ] [ sqrt(z) sqrt(z) ] [ 0 - ------- - ------- 0 ] [ sqrt(2) sqrt(2) ] (%i9) cmetric(false) (%o9) false (%i10) ug : invert(lg) (%i11) nptetrad(false) (%o11) done (%i12) weyl(false) (%o12) done (%i13) psi(false) (%o13) done (%i14) And obtain the Petrov class (%i15) petrov() (%o15) D INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 13; Choose from the following metrics 1. The Schwarschild metric (type D) 2. The Kerr metric (type D) 3. The anti-deSitter metric (type 0) 4. Godel's universe (type D) 5. Taub-Nut plane vacuum (type D) 6. Allnutt's perfect fluid metric (type III) X. Return to main menu Select an option by its number followed by a semicolon (;) 6; batching /home/vttoth/dev/maxima/share/tensor/allnutt.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Computing the Petrov classification of Allnutt's perfect fluid metric (%i3) We use frames (%i4) cframe_flag : true (%o4) true (%i5) We set up the metric by hand (%i6) ct_coords : [t, x, y, z] (%o6) [t, x, y, z] (%i7) (lfg : ident(4), lfg : - 1, lfg) 1, 1 [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o7) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] 4 exp(- 4 y - 3 x) (%i8) g : ------------------ 9 - 4 y - 3 x 4 %e (%o8) --------------- 9 2 g (%i9) f : n exp(- x) - - 3 - 4 y - 3 x 2 - x 4 %e (%o9) n %e - --------------- 27 2 2 (%i10) h : n exp(2 z - x) - n exp(- x) 2 2 z - x 2 - x (%o10) n %e - n %e - 3 --- 4 - x 3 sqrt(6) g exp(--- - z) 4 (%i11) q : --------------------------- 4 3 (- 4 y - 3 x) - z - --------------- - x/4 3/2 4 3 3 sqrt(6) %e (%o11) -------------------------------------------- 3/2 4 2 (- q) (f exp(2 x) - exp(- 2 x)) exp(2 x) (%i12) fri : matrix([-------------------------------, --------, 0, 0], sqrt(2) sqrt(2) (- q) (exp(- 2 x) + f exp(2 x)) exp(2 x) [-------------------------------, --------, 0, 0], sqrt(2) sqrt(2) 3 1 [- sqrt(2 g) q, 0, ---------, 0], [- sqrt(2 h) q, 0, 0, ---------]) sqrt(2 g) sqrt(2 h) (%i13) cmetric(false) (%o13) false (%i14) ug : invert(lg) (%i15) nptetrad(false) (%o15) done (%i16) We return to a coordinate base to compute the Weyl tensor (%i17) cframe_flag : false (%o17) false (%i18) The metric was computed for us by cmetric() already (%i19) weyl(false) (%o19) done (%i20) psi(true) - 8 y - 2 x 2 2 z + 2 y + x (%t20) psi = - (64 %e (3 %i n %e 0 2 z 2 2 y + x 2 z + abs(n) sqrt(%e - 1) - 3 %i n %e ))/(729 abs(n) sqrt(%e - 1)) 5 x - 6 y - --- 2 16 %e (%t21) psi = ---------------- 1 243 (%t22) psi = 0 2 (%t23) psi = 0 3 (%t24) psi = 0 4 (%o24) done (%i25) And obtain the Petrov class (%i26) petrov() (%o26) III INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 14; batching /home/vttoth/dev/maxima/share/tensor/tetrad.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) if get('ctensor, 'version) = false then load(ctensor) (%o1) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i2) Derive and verify Schwarzschild's solution in a tetrad base. (%i3) init_ctensor() (%o3) done (%i4) ct_coords : [t, r, d, c] (%i5) We use dimension 4. The four base vectors arranged in matrix form: (%i6) fri : matrix([sqrt(f(r)), 0, 0, 0], [0, sqrt(h(r)), 0, 0], [0, 0, r, 0], [0, 0, 0, r sin(d)]) [ sqrt(f(r)) 0 0 0 ] [ ] [ 0 sqrt(h(r)) 0 0 ] (%o6) [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 sin(d) r ] (%i7) The problem is simple enough for automatic simplification: (%i8) (ctrgsimp : true, ratwtlvl : false, ratfac : true, cframe_flag : true) (%i9) cmetric() (%o9) false (%i10) Compute the Ricci rotation coefficients (%i11) christof(true) (%o11) done (%i12) And the Riemann tensor in tetrad base (%i13) lriemann(true) (%t13) lriem = 2, 2, 1, 1 2 f(r) f(r) h(r) - 2 f(r) h(r) f(r) + h(r) (f(r) ) r r r r r - ------------------------------------------------------ 2 2 4 f (r) h (r) f(r) r (%t14) lriem = ------------- 3, 3, 1, 1 2 r f(r) h(r) f(r) r (%t15) lriem = ------------- 4, 4, 1, 1 2 r f(r) h(r) h(r) r (%t16) lriem = --------- 3, 3, 2, 2 2 2 r h (r) h(r) r (%t17) lriem = --------- 4, 4, 2, 2 2 2 r h (r) h(r) - 1 (%t18) lriem = -------- 4, 4, 3, 3 2 r h(r) (%o18) done (%i19) Now compute the Ricci tensor (%i20) ricci(true) (%t20) ric = - (r f(r) f(r) h(r) - 2 r f(r) h(r) f(r) 1, 1 r r r r 2 2 2 + r h(r) (f(r) ) - 4 f(r) h(r) f(r) )/(4 r f (r) h (r)) r r (%t21) ric = 2, 2 2 2 (r f(r) f(r) + 4 f (r)) h(r) - 2 r f(r) h(r) f(r) + r h(r) (f(r) ) r r r r r ------------------------------------------------------------------------ 2 2 4 r f (r) h (r) 2 r f(r) h(r) - r h(r) f(r) + 2 f(r) h (r) - 2 f(r) h(r) r r (%t22) ric = -------------------------------------------------------- 3, 3 2 2 2 r f(r) h (r) 2 r f(r) h(r) - r h(r) f(r) + 2 f(r) h (r) - 2 f(r) h(r) r r (%t23) ric = -------------------------------------------------------- 4, 4 2 2 2 r f(r) h (r) (%o23) done (%i24) For a vacuum metric, the components of the Ricci tensor must be 0 (%i25) We begin by adding ric1,1 and ric2,2 which yields a simple equation: (%i26) ric + ric 1, 1 2, 2 2 2 (r f(r) f(r) + 4 f (r)) h(r) - 2 r f(r) h(r) f(r) + r h(r) (f(r) ) r r r r r (%o26) ------------------------------------------------------------------------ 2 2 4 r f (r) h (r) 2 - (r f(r) f(r) h(r) - 2 r f(r) h(r) f(r) + r h(r) (f(r) ) r r r r r 2 2 - 4 f(r) h(r) f(r) )/(4 r f (r) h (r)) r (%i27) Some algebraic manipulation yields a solution for f(r) in terms of h(r): (%i28) factor(%th(2)) f(r) h(r) + h(r) f(r) r r (%o28) ----------------------- 2 r f(r) h (r) (%i29) num(%) (%o29) f(r) h(r) + h(r) f(r) r r % ---- f(r) (%i30) ---- h(r) f(r) h(r) + h(r) f(r) r r (%o30) ----------------------- f(r) h(r) (%i31) distrib(%) h(r) f(r) r r (%o31) ----- + ----- h(r) f(r) (%i32) first(%) = - last(%) h(r) f(r) r r (%o32) ----- = - ----- h(r) f(r) (%i33) integrate(%, r) (%o33) log(h(r)) = %c2 - log(f(r)) (%i34) solve(%, f(r)) %c2 %e (%o34) [f(r) = -----] h(r) (%i35) We can choose the constant to be 1 by rescaling the metric: (%i36) solf : subst(1, num(last(%th(2) )), last(%th(2) )) 1 1 1 (%o36) ---- h(r) (%i37) We substitute the solution for f(r) into ric3,3: (%i38) ric 3, 3 2 r f(r) h(r) - r h(r) f(r) + 2 f(r) h (r) - 2 f(r) h(r) r r (%o38) -------------------------------------------------------- 2 2 2 r f(r) h (r) (%i39) Further algebraic manipulation helps get a solution for h(r): (%i40) ratsimp(%th(2)) 2 r f(r) h(r) - r h(r) f(r) + 2 f(r) h (r) - 2 f(r) h(r) r r (%o40) -------------------------------------------------------- 2 2 2 r f(r) h (r) (%i41) subst(solf, f(r), %) r h(r) r 1 ------- - r h(r) (----) + 2 h(r) - 2 h(r) h(r) r (%o41) ------------------------------------- 2 2 r h(r) (%i42) ratsimp(%) 2 1 2 r h(r) - r h (r) (----) + 2 h (r) - 2 h(r) r h(r) r (%o42) -------------------------------------------- 2 2 2 r h (r) (%i43) num(%) 2 1 2 (%o43) r h(r) - r h (r) (----) + 2 h (r) - 2 h(r) r h(r) r (%i44) ev(%, diff) 2 (%o44) 2 r h(r) + 2 h (r) - 2 h(r) r (%i45) ode2(%, h(r), r) (%o45) log(h(r)) - log(h(r) - 1) = log(r) + %c (%i46) exp(first(%)) = exp(last(%)) h(r) %c (%o46) -------- = %e r h(r) - 1 (%i47) solve(%, h(r)) %c %e r (%o47) [h(r) = ----------] %c %e r - 1 (%i48) We rename the constant to get the result in the usual form: 1 - 2 (%i49) solh : ratsimp(subst(-, exp(%c), last(%th(2) ))) m 1 r (%o49) ------- r - 2 m (%i50) Now substitute the solutions back into our base vectors: (%i51) subst(solf, f(r), fri) [ 1 ] [ ---------- 0 0 0 ] [ sqrt(h(r)) ] [ ] (%o51) [ 0 sqrt(h(r)) 0 0 ] [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 sin(d) r ] (%i52) fri : subst(solh, h(r), %) [ 1 ] [ ------------- 0 0 0 ] [ r ] [ sqrt(-------) ] [ r - 2 m ] [ ] (%o52) [ r ] [ 0 sqrt(-------) 0 0 ] [ r - 2 m ] [ ] [ 0 0 r 0 ] [ ] [ 0 0 0 sin(d) r ] (%i53) And compute the metric, which is the standard Schwarzschild metric: (%i54) cmetric(true) [ r - 2 m ] [ - ------- 0 0 0 ] [ r ] [ ] [ r ] [ 0 ------- 0 0 ] (%t54) lg = [ r - 2 m ] [ ] [ 2 ] [ 0 0 r 0 ] [ ] [ 2 2 ] [ 0 0 0 sin (d) r ] (%o54) [%t54] (%i55) We're done... now let's verify our solution. (%i56) We begin with recomputing the Ricci rotation coefficients: (%i57) christof(true) (%o57) done (%i58) And the Riemann tensor: (%i59) lriemann(true) 2 m (%t59) lriem = - --- 2, 2, 1, 1 3 r m (%t60) lriem = -- 3, 3, 1, 1 3 r m (%t61) lriem = -- 4, 4, 1, 1 3 r m (%t62) lriem = - -- 3, 3, 2, 2 3 r m (%t63) lriem = - -- 4, 4, 2, 2 3 r 2 m (%t64) lriem = --- 4, 4, 3, 3 3 r (%o64) done (%i65) And last, the Ricci tensor, which should indicate an empty spacetime: (%i66) ricci(true) THIS SPACETIME IS EMPTY AND/OR FLAT (%o66) done INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 15; batching /home/vttoth/dev/maxima/share/tensor/friedmann.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Deriving the Friedmann-equations of cosmology (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) We start with the Friedmann-Lemaitre-Robertson-Walker metric (%i4) This metric describes a homogeneous, isotropic universe. (%i5) Our coordinate system is spherical: (%i6) dim : 4 (%o6) 4 (%i7) ct_coords : [t, r, u, v] (%o7) [t, r, u, v] (%i8) lg : ident(4) [ 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o8) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] 2 - a (%i9) lg : -------- 2, 2 2 1 - k r 2 a (%o9) - -------- 2 1 - k r 2 2 (%i10) lg : - a r 3, 3 2 2 (%o10) - a r 2 2 2 (%i11) lg : - a r sin (u) 4, 4 2 2 2 (%o11) - a r sin (u) (%i12) dependencies(a(t)) (%o12) [a(t)] (%i13) cmetric() (%o13) done (%i14) Let us review the contravariant and covariant metric tensor: (%i15) ug [ 1 0 0 0 ] [ ] [ 2 ] [ k r - 1 ] [ 0 -------- 0 0 ] [ 2 ] [ a ] [ ] (%o15) [ 1 ] [ 0 0 - ----- 0 ] [ 2 2 ] [ a r ] [ ] [ 1 ] [ 0 0 0 - ------------- ] [ 2 2 2 ] [ a r sin (u) ] (%i16) lg [ 1 0 0 0 ] [ ] [ 2 ] [ a ] [ 0 - -------- 0 0 ] [ 2 ] (%o16) [ 1 - k r ] [ ] [ 2 2 ] [ 0 0 - a r 0 ] [ ] [ 2 2 2 ] [ 0 0 0 - a r sin (u) ] (%i17) And let us calculate the Einstein tensor. (%i18) derivabbrev : true (%o18) true (%i19) christof(mcs) a t (%t19) mcs = -- 1, 2, 2 a a t (%t20) mcs = -- 1, 3, 3 a a t (%t21) mcs = -- 1, 4, 4 a a a t (%t22) mcs = - -------- 2, 2, 1 2 k r - 1 k r (%t23) mcs = - -------- 2, 2, 2 2 k r - 1 1 (%t24) mcs = - 2, 3, 3 r 1 (%t25) mcs = - 2, 4, 4 r 2 (%t26) mcs = a a r 3, 3, 1 t 2 (%t27) mcs = r (k r - 1) 3, 3, 2 cos(u) (%t28) mcs = ------ 3, 4, 4 sin(u) 2 2 (%t29) mcs = a a r sin (u) 4, 4, 1 t 2 2 (%t30) mcs = r (k r - 1) sin (u) 4, 4, 2 (%t31) mcs = - cos(u) sin(u) 4, 4, 3 (%o31) done (%i32) ricci(true) 3 a t t (%t32) ric = - ------ 1, 1 a 2 2 k + a a + 2 (a ) t t t (%t33) ric = - ---------------------- 2, 2 2 k r - 1 2 2 (%t34) ric = (2 k + a a + 2 (a ) ) r 3, 3 t t t 2 2 2 (%t35) ric = (2 k + a a + 2 (a ) ) r sin (u) 4, 4 t t t (%o35) done (%i36) einstein(true) 2 3 (k + (a ) ) t (%t36) ein = ------------- 1, 1 2 a 2 k + 2 a a + (a ) t t t (%t37) ein = -------------------- 2, 2 2 a 2 k + 2 a a + (a ) t t t (%t38) ein = -------------------- 3, 3 2 a 2 k + 2 a a + (a ) t t t (%t39) ein = -------------------- 4, 4 2 a (%o39) done (%i40) The Weyl tensor is null. No gravitational waves in this metric! (%i41) weyl(true) THIS SPACETIME IS CONFORMALLY FLAT (%o41) done (%i42) The energy-momentum tensor is that of an ideal fluid with (%i43) energy density e and pressure p: (%i44) T : - p ident(4) [ - p 0 0 0 ] [ ] [ 0 - p 0 0 ] (%o44) [ ] [ 0 0 - p 0 ] [ ] [ 0 0 0 - p ] (%i45) T : e 1, 1 (%o45) e (%i46) T [ e 0 0 0 ] [ ] [ 0 - p 0 0 ] (%o46) [ ] [ 0 0 - p 0 ] [ ] [ 0 0 0 - p ] (%i47) The Einstein field equations are reduced to two differential equations: ein L + 8 %pi G T 1, 1 1, 1 (%i48) expand(------- = -----------------) 3 3 2 (a ) k t L 8 %pi e G (%o48) -- + ----- = - + --------- 2 2 3 3 a a ein T 1, 1 L 1, 1 expand(ein - -------) L - - 8 %pi G (T - -----) 2, 2 3 3 2, 2 3 (%i49) ------------------------- = ----- + factor(-----------------------) 2 2 2 a t t L 4 %pi (3 p + e) G (%o49) ---- = - - ----------------- a 3 3 (%i50) These two are known as the Friedmann equations of cosmology. (%i51) The size of the universe is proportional to the scale factor a; (%i52) L (Lambda) is the infamous cosmological constant; k (=0, +1, or -1) (%i53) determines the curvature (flat, closed, or open universe, respectively.) INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) e; The following specific examples demonstrate practical applications: INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric 2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom 3. The Kaluza-Klein metric 13. Petrov classification of metrics 4. The double divergence of R 14. Using a tetrad base 5. Helicity in hydrodynamics 15. The Friedmann equations 6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric 7. Spinor algebra 8. The EM field tensor 9. The Hodge star operator A. The Riemann and Weyl tensors B. The Rainich conditions C. The Einstein-Hilbert action D. Brans-Dicke cosmology X. Return to main menu Select an option by its number followed by a semicolon (;) 16; batching /home/vttoth/dev/maxima/share/tensor/papapetrou.dem At the _ prompt, type ';' followed by enter to get next demo (%i1) Papapetrou's metric is a nonsymmetric metric. (%i2) if get('ctensor, 'version) = false then load(ctensor) (%o2) /home/vttoth/dev/maxima/share/tensor/ctensor.mac (%i3) We start with the covariant metric tensor. (%i4) ratfac : true (%o4) true (%i5) dim : 4 (%o5) 4 (%i6) ct_coords : [r, u, v, t] (%o6) [r, u, v, t] (%i7) lg : ident(4) [ 1 0 0 0 ] [ ] [ 0 1 0 0 ] (%o7) [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] (%i8) lg : - A 1, 1 (%o8) - A 2 (%i9) lg : - r 2, 2 2 (%o9) - r 2 2 (%i10) lg : - r sin (u) 3, 3 2 2 (%o10) - r sin (u) (%i11) lg : C 4, 4 (%o11) C (%i12) lg : W 1, 4 (%o12) W (%i13) lg : - W 4, 1 (%o13) - W (%i14) depends([A, C, W], [r]) (%o14) [A(r), C(r), W(r)] (%i15) cmetric() (%o15) done (%i16) Let us review the contravariant and covariant metric tensor: (%i17) ug [ C W ] [ -------- 0 0 -------- ] [ 2 2 ] [ W - A C W - A C ] [ ] [ 1 ] [ 0 - -- 0 0 ] [ 2 ] [ r ] (%o17) [ ] [ 1 ] [ 0 0 - ---------- 0 ] [ 2 2 ] [ r sin (u) ] [ ] [ W A ] [ - -------- 0 0 - -------- ] [ 2 2 ] [ W - A C W - A C ] (%i18) lg [ - A 0 0 W ] [ ] [ 2 ] [ 0 - r 0 0 ] (%o18) [ ] [ 2 2 ] [ 0 0 - r sin (u) 0 ] [ ] [ - W 0 0 C ] (%i19) And let us calculate the connection coefficients. (%i20) Note that Gamma(a,b,c)=Gamma(b,a,c) is no longer true! (%i21) derivabbrev : true (%o21) true (%i22) The next calculation can take quite a bit of time. (%i23) christof(mcs) A r (%t23) mcs = --- 1, 1, 1 2 A 1 (%t24) mcs = - 1, 2, 2 r 1 (%t25) mcs = - 1, 3, 3 r (A C + A C) W - 2 A C W r r r (%t26) mcs = - -------------------------- 1, 4, 1 2 2 A (W - A C) 2 2 - 2 A W W + A W + A C r r r (%t27) mcs = - -------------------------- 1, 4, 4 2 2 A (W - A C) 1 (%t28) mcs = - 2, 1, 2 r r (%t29) mcs = - - 2, 2, 1 A cos(u) (%t30) mcs = ------ 2, 3, 3 sin(u) W (%t31) mcs = - --- 2, 4, 2 r A 1 (%t32) mcs = - 3, 1, 3 r cos(u) (%t33) mcs = ------ 3, 2, 3 sin(u) 2 r sin (u) (%t34) mcs = - --------- 3, 3, 1 A (%t35) mcs = - cos(u) sin(u) 3, 3, 2 W (%t36) mcs = - --- 3, 4, 3 r A (A C + A C) W - 2 A C W r r r (%t37) mcs = -------------------------- 4, 1, 1 2 2 A (W - A C) 2 2 - 2 A W W + A W + A C r r r (%t38) mcs = - -------------------------- 4, 1, 4 2 2 A (W - A C) W (%t39) mcs = --- 4, 2, 2 r A W (%t40) mcs = --- 4, 3, 3 r A 2 2 - 4 A C W W + (A C + 2 A C) W + A C C r r r r (%t41) mcs = - ------------------------------------------- 4, 4, 1 2 2 2 A (W - A C) (%o41) done (%i42) We can also calculate the Ricci tensor for this metric. (%i43) ricci(true) (%t43) ric = 1, 1 2 2 2 2 (- 2 A W W - 2 A (W ) + A W + A C + 2 A A C ) r r r r r r r r r - (- ------------------------------------------------------------ 2 A (W - A C) 2 2 2 (2 W W - A C - A C) (- 2 A W W + A W + A C ) r r r r r r + ----------------------------------------------------- 2 2 A (W - A C) 2 2 2 2 2 2 A (- 2 A W W + A W + A C ) (- 2 A W W + A W + A C ) r r r r r r r + ---------------------------------)/4 - ----------------------------- 2 2 2 2 2 A (W - A C) 4 A (W - A C) 2 2 A 2 (A ) r r r 2 2 ------ - ------- 2 A (- 2 A W W + A W + A C ) A 2 A (A ) A r r r r A r r r r - ------------------------------- - ---------------- + ---- - ----- + --- 2 2 4 2 A 2 r A 4 A (W - A C) 2 A (%t44) ric = - (- 2 A C W + (A C + A C) W - 2 A C W - 2 A C W 1, 4 r r r r r r r r r 2 + (A C + 2 A C + A C) W)/(2 A (W - A C)) r r r r r r 2 2 ((A C + A C) W - 2 A C W ) (- 2 A W W + A W + A C ) r r r r r r - --------------------------------------------------------- 2 2 2 4 A (W - A C) 2 2 W (- 2 A W W + A W + A C ) r r r - ------------------------------ 2 2 r A (W - A C) ((A C + A C) W - 2 A C W ) (2 W W - A C - A C) r r r r r r + --------------------------------------------------- 2 2 2 A (W - A C) A ((A C + A C) W - 2 A C W ) (A C + A C) W - 2 A C W r r r r r r r 2 W + ------------------------------- - -------------------------- + ---- 2 2 2 2 2 A (W - A C) r A (W - A C) r A 2 4 cos (u) 2 2 - --------- - 4 r (- 2 A W W + A W + A C ) r A 2 r r r r 1 sin (u) (%t45) ric = ------------------------------ + ---- - - - --------------- 2, 2 2 2 2 A 4 2 A (W - A C) 2 A 2 cos (u) - ------- 2 sin (u) 2 2 2 2 r sin (u) (- 2 A W W + A W + A C ) r sin (u) A r r r r (%t46) ric = -------------------------------------- + ------------ 3, 3 2 2 2 2 A (W - A C) 2 A 2 sin (u) 2 - ------- + sin (u) A (%t47) ric = (- 2 A C W + (A C + A C) W - 2 A C W - 2 A C W 4, 1 r r r r r r r r r 2 + (A C + 2 A C + A C) W)/(2 A (W - A C)) r r r r r r 2 2 ((A C + A C) W - 2 A C W ) (- 2 A W W + A W + A C ) r r r r r r - --------------------------------------------------------- 2 2 2 4 A (W - A C) 2 2 W (- 2 A W W + A W + A C ) r r r - ------------------------------ 2 2 r A (W - A C) ((A C + A C) W - 2 A C W ) (2 W W - A C - A C) r r r r r r - --------------------------------------------------- 2 2 2 A (W - A C) A ((A C + A C) W - 2 A C W ) (A C + A C) W - 2 A C W r r r r r r r 2 W - ------------------------------- + -------------------------- - ---- 2 2 2 2 2 A (W - A C) r A (W - A C) r A 2 (%t48) ric = - (- 4 A C W W - 4 A C (W ) + 2 (A C + 2 A C) W W 4, 4 r r r r r r 2 2 - 4 A C W W - 4 A C W W + (A C + 3 A C + 2 A C) W + A C C r r r r r r r r r r r r 2 2 2 2 + A (C ) + 2 A A C C )/(2 A (W - A C)) r r r 2 2 2 2 (- 2 A W W + A W + A C ) (- 4 A C W W + (A C + 2 A C) W + A C C ) r r r r r r r - -------------------------------------------------------------------------- 3 2 2 4 A (W - A C) 2 2 (2 W W - A C - A C) (- 4 A C W W + (A C + 2 A C) W + A C C ) r r r r r r r + -------------------------------------------------------------------- 2 2 2 2 A (W - A C) 2 2 3 A (- 4 A C W W + (A C + 2 A C) W + A C C ) r r r r r + -------------------------------------------------- 3 2 4 A (W - A C) 2 2 2 - 4 A C W W + (A C + 2 A C) W + A C C ((A C + A C) W - 2 A C W ) r r r r r r r - ------------------------------------------- + ----------------------------- 2 2 2 2 2 r A (W - A C) 4 A (W - A C) 2 2 W + ----- 2 2 r A (%o48) done (%i49) Some components have a particularly simple relationship, e.g., ric 3, 3 (%i50) ratsimp(-------) ric 2, 2 2 (%o50) sin (u) (%i51) For more information, see Moffat & Boal, (%i52) Phys. Rev. D Vol. 11 No. 6, p1375. INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION 1. Basics 11. Initialization 2. Index contraction 12. Differential geometry 3. Simplification and symmetries 13. Gravitational theory 4. Special tensors 14. Frame fields 5. Coordinate differentiation 15. Torsion and nonmetricity 6. Covariant derivatives, curvature 16. Algebraic classification 7. Exterior algebra 17. Differential equations 8. Generating CTENSOR programs 18. Using Taylor series 9. Frames, torsion, nonmetricity A. Algebraic tensor manipulation E. Complete examples X. Exit this demo Select an option by its number followed by a semicolon (;) x; (%i1)