I would like to factor the vector $v$ out of the following expression:
$-4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g_{\mu \nu} g_{\rho}^{\sigma} v{\sigma}-4D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g_{\nu \sigma} g_{\mu \rho}}{)} g^{\alpha \sigma} v{\alpha}+4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g_{\mu \rho} g_{\nu}^{\sigma} v{\sigma}+4D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g_{\nu \rho} g_{\mu \sigma}}{)} g^{\alpha \sigma} v{\alpha}$
My attempt so far is:
factor_out(expr,$v_{\sigma}$)
factor_out(expr,$v_{\alpha}$);
${(}{-4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g{\mu \nu} g{\rho}^{\sigma}+4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g{\mu \rho} g{\nu}^{\sigma}}{)} v{\sigma}+4D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g{\mu \sigma} g{\nu \rho}}{)} g^{\alpha \sigma} v{\alpha}-4v^{\alpha} D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g{\mu \rho} g{\nu \sigma}}{)} g_{\alpha}^{\sigma})$
rename_dummies(expr);
${(}{-4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g{\mu \nu} g{\rho}^{\sigma}+4\partial^{\mu}{(}{D \partial^{\nu}{A^{\rho}}}{)} g{\mu \rho} g{\nu}^{\sigma}}{)} v{\sigma}+4D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g{\nu \rho} g{\mu \sigma}}{)} g^{\alpha \sigma} v{\alpha}-4D \partial^{\mu}{A^{\nu}} \partial^{\rho}{(}{g{\nu \sigma} g{\mu \rho}}{)} g^{\alpha \sigma} v_{\alpha})$
but as you can see I haven't managed to isolate the vector. Is there a standard way to do this?
By the way, my initial definitions are
def post_process(ex):
sort_product(ex)
canonicalise(ex)
collect_terms(ex)
{x}::Coordinate;
{\mu ,\nu ,\rho ,\sigma, \alpha,\beta}::Indices{position= fixed};
\partial{#}::PartialDerivative;
g_{\mu\nu}::Metric.
g^{\mu\nu}::InverseMetric.
I wondered if adding a SortOrder might be able to help, e.g.
{v_{\mu},v_{\mu\nu},A^{\mu},D,g_{\mu\nu}}::SortOrder;
, but it had no effect.