Loading [MathJax]/jax/output/HTML-CSS/jax.js
Cadabra
a field-theory motivated approach to computer algebra

The Kaluza-Klein example from section 2.5 of hep-th/0701238

This example shows how to use split_index in a somewhat more complicated setting. We first declare the indices that we will use.
{\mu,\nu,\rho,\sigma,\kappa,\lambda,\eta,\chi#}::Indices(full, position=independent); {m,n,p,q,r,s,t,u,v,w,x,y,z,m#}::Indices(subspace, position=independent, parent=full);
Attached property Indices(position=independent) to [μ,ν,ρ,σ,κ,λ,η,χ#].
Attached property Indices(position=independent) to [m,n,p,q,r,s,t,u,v,w,x,y,z,m#].
Note the appearance of parent=full. This indicates that the indices in the second set span a subspace of the indices in the first set. Also note that we have declared the indices as position=independent, to prevent Cadabra from automatically raising or lowering them when canonicalising (as this does not really help us here). The remaining declarations are standard,
\partial{#}::PartialDerivative. g_{\mu\nu}::Metric. g^{\mu\nu}::InverseMetric. g_{\mu? \nu?}::Symmetric. g^{\mu? \nu?}::Symmetric. h_{m n}::Metric. h^{m n}::InverseMetric. \delta^{\mu?}_{\nu?}::KroneckerDelta. \delta_{\mu?}^{\nu?}::KroneckerDelta. F_{m n}::AntiSymmetric.
We will want to expand the Riemann tensor in terms of the metric. The following two substitution rules do the conversion from Riemann tensor to Christoffel symbol and from Christoffel symbol to metric (a library with common substitution rules like these is in preparation).
RtoG:= R^{\lambda?}_{\mu?\nu?\kappa?} -> - \partial_{\kappa?}{ \Gamma^{\lambda?}_{\mu?\nu?} } + \partial_{\nu?}{ \Gamma^{\lambda?}_{\mu?\kappa?} } - \Gamma^{\eta}_{\mu?\nu?} \Gamma^{\lambda?}_{\kappa?\eta} + \Gamma^{\eta}_{\mu?\kappa?} \Gamma^{\lambda?}_{\nu?\eta}; Gtog:= \Gamma^{\lambda?}_{\mu?\nu?} -> (1/2) * g^{\lambda?\kappa} ( \partial_{\nu?}{ g_{\kappa\mu?} } + \partial_{\mu?}{ g_{\kappa\nu?} } - \partial_{\kappa}{ g_{\mu?\nu?} } );
Rλ?μ?ν?κ?κ?Γλ?μ?ν?+ν?Γλ?μ?κ?Γημ?ν?Γλ?κ?η+Γημ?κ?Γλ?ν?η
Γλ?μ?ν?12gλ?κ(ν?gκμ?+μ?gκν?κgμ?ν?)
In this example we want to compute the Kaluza-Klein reduction of the Rm4n4 component of the Riemann tensor. So we enter this component and do the substitution that takes the Riemann tensor to metrics. After each substitution, we distribute products over sums. We also apply the product rule to distribute derivatives over factors in a product.
todo:= g_{m1 m} R^{m1}_{4 n 4} + g_{4 m} R^{4}_{4 n 4};
gm1mRm14n4+g4mR44n4
substitute(_, RtoG) substitute(_, Gtog) distribute(_) product_rule(_) distribute(_) sort_product(_);
12ngκ44gm1κgm1m124ngκ4gm1mgm1κ124gm1κ4gκngm1m1244gκngm1mgm1κ+12κg4n4gm1κgm1m+124κg4ngm1mgm1κ+ngm1κ4gκ4gm1m+n4gκ4gm1mgm1κ12κg44ngm1κgm1m12nκg44gm1mgm1κ14ηgμ4ngκ4gm1mgηκgm1μ14ngκ44gμηgm1mgηκgm1μ+14μg4ηngκ4gm1mgηκgm1μ14ηgμ44gκngm1mgηκgm1μ144gμη4gκngm1mgηκgm1μ+14μg4η4gκngm1mgηκgm1μ+14ηgμ4κg4ngm1mgηκgm1μ+14κg4n4gμηgm1mgηκgm1μ14μg4ηκg4ngm1mgηκgm1μ+12ηgμn4gκ4gm1mgηκgm1μ+12ngμη4gκ4gm1mgηκgm1μ12μgnη4gκ4gm1mgηκgm1μ14ηgμnκg44gm1mgηκgm1μ14κg44ngμηgm1mgηκgm1μ+14μgnηκg44gm1mgηκgm1μ12ngκ44g4κg4m124ngκ4g4mg4κ124g4κ4gκng4m1244gκng4mg4κ+12κg4n4g4κg4m+124κg4ng4mg4κ+ng4κ4gκ4g4m+n4gκ4g4mg4κ12κg44ng4κg4m12nκg44g4mg4κ14ηgμ4ngκ4g4mgηκg4μ14ngκ44gμηg4mgηκg4μ+14μg4ηngκ4g4mgηκg4μ14ηgμ44gκng4mgηκg4μ144gμη4gκng4mgηκg4μ+14μg4η4gκng4mgηκg4μ+14ηgμ4κg4ng4mgηκg4μ+14κg4n4gμηg4mgηκg4μ14μg4ηκg4ng4mgηκg4μ+12ηgμn4gκ4g4mgηκg4μ+12ngμη4gκ4g4mgηκg4μ12μgnη4gκ4g4mgηκg4μ14ηgμnκg44g4mgηκg4μ14κg44ngμηg4mgηκg4μ+14μgnηκg44g4mgηκg4μ
We then split the greek indices into roman indices and the 4-th direction. Notice the use of repeat=True which will keep doing this substitution until all greek indices have been split. After that we again have to set all derivatives in the 4-th direction to zero.
split_index(_, $\mu, m1, 4$, repeat=True) substitute(_, $\partial_{4}{A??} -> 0$, repeat=True) substitute(_, $\partial_{4 m?}{A??} -> 0$, repeat=True) substitute(_, $\partial_{m? 4}{A??} -> 0$, repeat=True) canonicalise(_);
12m1g44ngm1pgmp12nm1g44gmpgm1p14ng4m1pg4qgmrgm1pgqr12m1g44ng4pgmqgm1pg4q14m1g4png44gmqg4m1gpq12ng44m1g44gmpg4m1g4p+14m1g4png4qgmrgm1rgpq+14m1g4png44gmqg4pgm1q+14m1g44ng4pgmqg4pgm1q+14ng44m1g44gmpg44gm1p+14m1g4pqgn4gmrgm1qgpr+14m1g44pgn4gmqgm1pg4q14m1gn4pg4qgmrgm1qgpr14m1g44pgn4gmqg4pgm1q14m1gnpqg44gmrgm1qgpr14m1gn4pg44gmqgm1pg4q14m1g44ngpqgmrgm1pgqr14m1g44ng4pgmqg4m1gpq+14m1gnpqg44gmrgm1rgpq+14m1gn4pg44gmqg4pgm1q12pg44ng4pgm412npg44gm4g4p14ng4pqg4rgm4gpqg4r12pg44ng4qgm4gpqg4414pg4qng44gm4g4pg4q12ng44pg44gm4g4pg44+14pg4qng4rgm4gqrg4p+14pg4qng44gm4g4qg4p+14ng44pg44gm4g44g4p+14pg4qrgn4gm4gprg4q+14pg44qgn4gm4gpqg4414pgn4qg4rgm4gprg4q14pg44qgn4gm4g4pg4q14pgnqrg44gm4gprg4q14pgn4qg44gm4gpqg4414pg44ngqrgm4gpqg4r+14pgnqrg44gm4gqrg4p+14pgn4qg44gm4g4pg4q
Now comes the ansatz of the metric in terms of the Kaluza-Klein gauge field Aμ and the scalar ϕ. We substitute this with the lines below. The output is not particularly enlightening...
substitute(_, $g_{4 4} -> \phi$ ) substitute(_, $g_{m 4} -> \phi A_{m}$ ) substitute(_, $g_{4 m} -> \phi A_{m}$ ) substitute(_, $g_{m n} -> \phi**{-1} h_{m n} + \phi A_{m} A_{n}$ ) substitute(_, $g^{4 4} -> \phi**{-1} + \phi A_{m} h^{m n} A_{n}$ ) substitute(_, $g^{m 4} -> - \phi h^{m n} A_{n}$ ) substitute(_, $g^{4 m} -> - \phi h^{m n} A_{n}$ ) substitute(_, $g^{m n} -> \phi h^{m n}$ );
12m1ϕn(ϕhm1p)(ϕ1hmp+ϕAmAp)12nm1ϕ(ϕ1hmp+ϕAmAp)ϕhm1p14n(ϕAm1)p(ϕAq)(ϕ1hmr+ϕAmAr)ϕhm1pϕhqr+12m1ϕn(ϕAp)(ϕ1hmq+ϕAmAq)ϕhm1pϕhqrAr+14m1(ϕAp)nϕ(ϕ1hmq+ϕAmAq)ϕhm1rArϕhpq12nϕm1ϕ(ϕ1hmp+ϕAmAp)ϕhm1qAqϕhprAr+14m1(ϕAp)n(ϕAq)(ϕ1hmr+ϕAmAr)ϕhm1rϕhpq14m1(ϕAp)nϕ(ϕ1hmq+ϕAmAq)ϕhprArϕhm1q14m1ϕn(ϕAp)(ϕ1hmq+ϕAmAq)ϕhprArϕhm1q+14nϕm1ϕ(ϕ1hmp+ϕAmAp)(ϕ1+ϕAqhqrAr)ϕhm1p+14m1(ϕAp)q(ϕAn)(ϕ1hmr+ϕAmAr)ϕhm1qϕhpr14m1ϕp(ϕAn)(ϕ1hmq+ϕAmAq)ϕhm1pϕhqrAr14m1(ϕAn)p(ϕAq)(ϕ1hmr+ϕAmAr)ϕhm1qϕhpr+14m1ϕp(ϕAn)(ϕ1hmq+ϕAmAq)ϕhprArϕhm1q14m1(ϕ1hnp+ϕAnAp)qϕ(ϕ1hmr+ϕAmAr)ϕhm1qϕhpr+14m1(ϕAn)pϕ(ϕ1hmq+ϕAmAq)ϕhm1pϕhqrAr14m1ϕn(ϕ1hpq+ϕApAq)(ϕ1hmr+ϕAmAr)ϕhm1pϕhqr+14m1ϕn(ϕAp)(ϕ1hmq+ϕAmAq)ϕhm1rArϕhpq+14m1(ϕ1hnp+ϕAnAp)qϕ(ϕ1hmr+ϕAmAr)ϕhm1rϕhpq14m1(ϕAn)pϕ(ϕ1hmq+ϕAmAq)ϕhprArϕhm1q+12pϕn(ϕhpqAq)ϕAm+12npϕϕAmϕhpqAq+14n(ϕAp)q(ϕAr)ϕAmϕhpqϕhrsAs12pϕn(ϕAq)ϕAmϕhpq(ϕ1+ϕArhrsAs)14p(ϕAq)nϕϕAmϕhprArϕhqsAs+12nϕpϕϕAmϕhpsAs(ϕ1+ϕAqhqrAr)14p(ϕAq)n(ϕAr)ϕAmϕhqrϕhpsAs+14p(ϕAq)nϕϕAmϕhqrArϕhpsAs14nϕpϕϕAm(ϕ1+ϕAqhqrAr)ϕhpsAs14p(ϕAq)r(ϕAn)ϕAmϕhprϕhqsAs+14pϕq(ϕAn)ϕAmϕhpq(ϕ1+ϕArhrsAs)+14p(ϕAn)q(ϕAr)ϕAmϕhprϕhqsAs14pϕq(ϕAn)ϕAmϕhprArϕhqsAs+14p(ϕ1hnq+ϕAnAq)rϕϕAmϕhprϕhqsAs14p(ϕAn)qϕϕAmϕhpq(ϕ1+ϕArhrsAs)+14pϕn(ϕ1hqr+ϕAqAr)ϕAmϕhpqϕhrsAs14p(ϕ1hnq+ϕAnAq)rϕϕAmϕhqrϕhpsAs+14p(ϕAn)qϕϕAmϕhprArϕhqsAs
We now need to distribute derivatives over sums and use the product rule. This has to be done a few times, so we wrap this in a converge block which applies the operations until the result no longer changes. The output of those operations is quite large, so we suppress it (by not writing semi-colons after the function calls or after the converge block).
converge(todo): distribute(_) product_rule(_) canonicalise(_)
We then convert derivatives of the inverse metric to derivatives of the metric, and cleanup contractions which lead to Kronecker deltas.
substitute(_, $\partial_{p}{h^{n m}} h_{q m} -> - \partial_{p}{h_{q m}} h^{n m}$ ) collect_factors(_) sort_product(_) converge(todo): substitute(_, $h_{m1 m2} h^{m3 m2} -> \delta_{m1}^{m3}$, repeat=True ) eliminate_kronecker(_) canonicalise(_) ;
14mϕnϕϕ1+14m1ϕnhmphm1p34AmAm1nϕpϕϕhm1p12AmAm1pϕnhm1pϕ212mnϕ12AmAm1npϕϕ2hm1p14Am1pAmnϕϕ2hm1p12AmnAm1pϕϕ2hm1p14nAm1pAmϕ3hm1p14AmAm1nApqArϕ5hm1rhpq+34AmAm1nϕqϕϕhm1q+12AmnApqϕϕ2hpq+14Am1rAmnϕϕ2hm1r+14Am1Aqmϕnϕϕhm1q+14ApnAqmϕϕ2hpq+14ApmAqnϕϕ2hpq+14mAm1nAqϕ3hm1q+14AmAm1nApqArϕ5hm1qhpr14Am1Armϕnϕϕhm1r14ApmArnϕϕ2hpr14ApArmϕnϕϕhpr14ApnArmϕϕ2hpr+14AqArmϕnϕϕhqr+14AmAnm1ϕpϕϕhm1p+14m1AmpAnϕ3hm1p+14AmAm1pAnqArϕ5hm1rhpq14AnAm1mϕqϕϕhm1q14AnmAm1qϕϕ2hm1q14Am1qAnmϕϕ2hm1q14mAm1qAnϕ3hm1q14AmAm1pAnqArϕ5hm1qhpr+14AprAnmϕϕ2hpr+14m1ϕqϕϕ1hmnhm1q14m1ϕqhmnhm1q+14AmAnpϕqϕϕhpq14AmAm1pϕqhnrϕ2hm1rhpq14AmAnm1ϕqϕϕhm1q14AmAm1pϕnhqrϕ2hm1qhpr14Am1nAmpϕϕ2hm1p+14Am1nAmrϕϕ2hm1r+14pϕmhnqhpq14AmAqnϕrϕϕhqr+14AmAm1pϕqhnrϕ2hm1qhpr+14AnAm1mϕpϕϕhm1p+14ApmAnqϕϕ2hpq+14AnmApqϕϕ2hpq14ApmAnrϕϕ2hpr+12AmApqϕnhpqϕ2+12AmApnqϕϕ2hpq+14AmApnAqrAsϕ5hpshqr+14AmApnϕsϕϕhps14AmApnAqrAsϕ5hprhqs14AmApqAnrAsϕ5hpshqr+14AmApqAnrAsϕ5hprhqs14AmAnqϕrϕϕhqr+14AmApqϕrhnsϕ2hpshqr14AmApnϕrϕϕhpr+14AmApqϕnhrsϕ2hprhqs+14AmArnϕsϕϕhrs14AmApqϕrhnsϕ2hprhqs
This is almost the finaly result, but one would normally write it in terms of the field strength, not the gauge potential. This can be done with one further substitution and some simplification, to get the result
substitute(_, $\partial_{n}{A_{m}} -> 1/2*\partial_{n}{A_{m}} + 1/2*F_{n m} + 1/2*\partial_{m}{A_{n}}$ ) distribute(_) sort_product(_) canonicalise(_) rename_dummies(_);
14mϕnϕϕ1+14pϕnhmqhpq12mnϕ+14FmpFnqϕ3hpq+14pϕqϕϕ1hmnhpq14pϕqhmnhpq+14pϕmhnqhpq
Copyright © 2001-2025 Kasper Peeters
Questions? info@cadabra.science