Including anisotropic stress in xPand

112 views
Skip to first unread message

Theo

unread,
May 6, 2021, 6:30:57 AM5/6/21
to xAct Tensor Computer Algebra
Hi,

I'm currently using xPand to obtain linear perturbation theory equations in a class of scalar-tensor theories. This has worked fine so far, but with T_{\mu\nu} restricted to a perfect fluid - so I don't have to define any new matter variables, as the density and pressure are defined automatically when you use DefMatterFields[u,du,h].

I want to generalise the matter energy-momentum tensor perturbation to include not just a perfect fluid part but also an anisotropic stress tensor (potentially also a heat flux type term as well). How can this be done while enforcing the correct rules, e.g. that the anisotropic stress is traceless?

Thank you for any help! 

Best wishes,

Theo

Sergi Sirera-Lahoz

unread,
Jun 20, 2025, 1:25:34 PMJun 20
to xAct Tensor Computer Algebra
Hello!

I realise that this is an old question but I recently tried to tackle the same problem so I thought it would still be nice to share what I've done in case anyone finds it useful and/or has suggestions on how to improve and develop it. Note that this is just a simple construction and does not fully specify the symmetries of the anisotropic stress tensor (these could be added at this stage or maybe later as rules). I also haven't thought about how this will work with perturbations... The following is not a full script and relies on some standard previous definitions such as DefMatterFields[u,du,h]. Any comments are very welcome!

Best wishes,
Sergi


(*define stress-energy tensor*)
DefTensor[T[-b, -c], Md];
DefTensor[Ts[], Md, PrintAs -> "T"];
DefTensor[PiRaw[-b, -c], Md, Symmetric[{-b, -c}],
  PrintAs -> "\[CapitalPi]^{raw}"];
DefTensor[PiST[-b, -c], Md, Symmetric[{-b, -c}],
  PrintAs -> "\[CapitalPi]"];
IndexSet[PiST[b_, c_], PiRaw[b, c] - (1/4) g[b, c] PiRaw[d, -d]];


(*Options:"Dust", "PerfectFluid", "ImperfectFluid"*)
$FluidModel = "Dust";

(*Set fluid model flags*)
If[$FluidModel === "Dust", ($Density = True;
   $Pressure = False;
   $AnisotropicStress = False;)];
If[$FluidModel === "PerfectFluid", ($Density = True;
   $Pressure = True;
   $AnisotropicStress = False;)];
If[$FluidModel === "ImperfectFluid", ($Density = True;
   $Pressure = True;
   $AnisotropicStress = True;)];

(*Define T_ab*)
IndexSet[
  T[b_, c_], (If[$Density, \[Rho][u][] u[b] u[c], 0] +
    If[$Pressure, P[u][] (g[b, c] + u[b] u[c]), 0] +
    If[$AnisotropicStress, PiST[b, c], 0])];

Reply all
Reply to author
Forward
0 new messages