InvarLagrangian[g, order]
gives the most general Lagrangian up to order in derivatives of the metric, consisting solely of curvature tensors of the metric g.
  • The second argument order has standard level specitification.
  • The Invar database must be installed in order for InvarLagrangian to work correctly. It can be downloaded from
  • The following options can be given:
specifies the coefficients in the Lagrangian. It can either be a function that takes two arguments, or None.
OrderParameter1specifies the parameter that labels the order of derivatives