Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

I would like to prove that the scalar action is dilatation invariant.

(m,n,p,q)::Indices(position=free).
\eta_{m n}::Metric.
\eta^{m n}::InverseMetric.
\eta^{m}_{n}::KroneckerDelta.
\eta_{n}^{m}::KroneckerDelta.

\partial{#}::PartialDerivative.
\phi::Depends(\partial{#}).
x^{m}::Depends(\partial{#}).

S := -1/2 \int{ \partial_{m}{\phi} \partial^{m}{\phi}}{x};

$$ S := -1/2 \int{ \partial_{m}{\phi} \partial^{m}{\phi}} \ {dx}; $$

\delta::Accent.

dil:= \delta{\phi}= \alpha x^{m} \partial_{m}{\phi} + \alpha \phi;

$$ \delta{\phi}= \alpha x^{m} \partial_{m}{\phi} + \alpha \phi; $$

vary(S, \$ \phi -> \delta{\phi} \$).
substitute(S,dil).
distribute(S).
product_rule(S).
unwrap(S);

$$\begin{gathered} -1/2 \int\left(\left(\alpha \partial_{m}{x^{n}} \partial_{n}{\phi}+\alpha x^{n} \partial_{m n}{\phi}\right) \partial^{m}{\phi}\\ +\alpha \partial_{m}{\phi} \partial^{m}{\phi}+\partial_{m}{\phi} \left(\alpha \partial^{m}{x^{n}} \partial_{n}{\phi}+\alpha x^{n} \partial^{m}_{n}{\phi}\right)+\partial_{m}{\phi} \alpha \partial^{m}{\phi}\right)\, {\rm d}x \end{gathered} $$

Now how do I tell $\partial_{m} x_{n} = \eta_{m n}$ without exploiting free index structure. Does Cadabra understand that?

I tried to force it using a relation, but later Cadabra fails to identify indices as free.

in General questions by (160 points)

1 Answer

+1 vote
 
Best answer

The easiest way out is

substitute(S, $\partial_{m} x^{n} = \delta_{m}^{n}$)
by (82.6k points)
selected by

Then, it later fails to sum terms like $\partial_{m} \phi \partial^{m} \phi + \partial^{n} \phi \partial_{n} \phi$.

Do

rename_dummies(S)
canonicalise(S)

The first is to ensure that all dummies have the same name. The second will raise/lower so as to make the terms equal.

Thank you very much. I did not know about rename_dummies.

Yeah, I should really get that tutorial on simplifying expressions out, but there are currently only about 27 hours in a day unfortunately... Feel free to ask again though if you get stuck somewhere else.

By the way, your problem makes for a nice example, I'll see if I can polish/extend it a bit and include it on the web site.

...