Tensor manipulation with sagemath
Hello everyone, I am new to SageMath and would like to use it to verify a series of relations in quantum field theory. In particular, I would like to know how well Sage handles tensors and the verification of identities. The identity is as follows. I have a tensor $N$ defined like this: $$ \begin{aligned} N^{\mu \nu}=\left[g^{\mu \alpha}(p+k)^\rho+\right. & \left.g^{\alpha \rho}(p-2 k)^\mu+g^{\rho \mu}(k-2 p)^\alpha\right] g^{\alpha \beta} g^{\rho \sigma} \ & \times\left[g^{\nu \beta}(p+k)^\sigma-g^{\beta \sigma}(2 k-p)^\nu-g^{\sigma \nu}(2 p-k)^\beta\right] . \end{aligned} $$ I make the transformation: $$ k^\mu \rightarrow k^\mu+x p^\mu $$ Then supposing g is a Lorentz metric (+---), and to be in dimension d, so as as to have $g^{\mu \mu}=d$. I'm wondering if sagemath can verify is after the subsitution and this identity, the result is: $$ \begin{aligned} N^{\mu \nu}=2 k^2 g^{\mu \nu} & -(6-4 d) k^\mu k^\nu \ - & {\left[6\left(x^2-x+1\right)-d(1-2 x)^2\right] p^\mu p^\nu+\left(2 x^2-2 x+5\right) p^2 g^{\mu \nu} } \ & -(2-4 x) g^{\mu \nu}(k \cdot p)+(2 d-3)(2 x-1)\left(k^\mu p^\nu+k^\nu p^\mu\right) . \end{aligned} $$